alpacahq / alpacahq/alpaca-trade-api-go

No trade updates for crypto orders/positions

Abierto
#205 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Go
Estrellas
429
Forks
118
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Hi,

Ver: `github.com/alpacahq/alpaca-trade-api-go/v2 v2.5.0`

Seems that trade updates using the `client.StreamTradeUpdates()` functionality differ quite a bit from stocks to crypto.
For stocks I would be notified of any `new`, `rejected`, `fill` etc. type of events, doesn't seem to be the case for crypto where I've only been able to get `canceled` events.

Is there a different implementation for crypto streams? Or are the events different for crypto? (the [docs](https://alpaca.markets/docs/api-references/trading-api/streaming/) doesn't give a clear indication about this)

NOTE: The code below works fine for stocks

```
// Start the trade client
client := alpaca.NewClient(alpaca.ClientOpts{
ApiKey: "***",
ApiSecret: "***",
BaseURL: "https://paper-api.alpaca.markets",
RetryLimit: 100,
RetryDelay: 5 * time.Second,
})

handler := func(tu alpaca.TradeUpdate) {
fmt.Printf("NEW EVENT: %+v\n", tu)
}

err := client.StreamTradeUpdates(context.Background(), handler)
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.