alpacahq / alpacahq/alpaca-trade-api-go

No trade updates for crypto orders/positions

未关闭
#205 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
429
派生
118
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。