alpacahq / alpacahq/alpaca-trade-api-go

No trade updates for crypto orders/positions

Ouverte
#205 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Go
Étoiles
429
Forks
118
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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)
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.