c9s / bbgo

The modern cryptocurrency trading bot framework written in Go.
https://bbgo.finance
GNU Affero General Public License v3.0
1.15k stars 277 forks source link

MinNotional and MinAmount are not been set correctly when the futures mode is enabled #1610

Open 981746 opened 3 months ago

981746 commented 3 months ago

When the futures mode is enabled and with bbgo run command, MinNotionalFilter() of go-binance returns a nil value, but other filter functions like LotSizeFilter() and PriceFilter() work fine.

I disabled markets cache in .env.local using DISABLE_MARKETS_CACHE=true.

Then run the "bbgo run" command in the toGlobalFuturesMarket() function of pkg/exchange/binance/convert.go, the following code snippet's f shows nil:

if f := symbol.MinNotionalFilter(); f != nil {
    market.MinNotional = fixedpoint.MustNewFromString(f.Notional)
    market.MinAmount = fixedpoint.MustNewFromString(f.Notional)
}

I think market.MinNotional and market.MinAmount are not being set correctly, causing me to always get 0 from s.Market.MinNotional and s.Market.MinAmount in my strategy.

c9s commented 3 months ago

which version do you use? because I thought this was fixed few weeks ago?

c9s commented 3 months ago

image

c9s commented 3 months ago

@981746 I just upgraded the adshao/go-binance package in revision d55d1e9867383fb2fbf5a9416b9c7f8d74402c4b, please give it a try

981746 commented 3 months ago

@981746 I just upgraded the adshao/go-binance package in revision d55d1e9, please give it a try

It works now, thank you very much