This commit is contained in:
2026-01-09 15:48:31 +08:00
parent e32eabbf95
commit c8e189e9c7
28 changed files with 2795 additions and 0 deletions

31
trade/history.go Normal file
View File

@@ -0,0 +1,31 @@
package trade
import (
"context"
"time"
"git.apinb.com/bsm-sdk/core/utils"
)
func RefreshHistoryTotal(p *Spec) (tradeNum int64, pl float64) {
switch p.Api.Exchange {
case "BINANCE":
for _, v := range p.AllowSymbols {
data, err := p.BinanceClient.Futures.NewListAccountTradeService().Symbol(v).Do(context.Background())
if err == nil {
for _, res := range data {
tradeNum++
pl += utils.String2Float64(res.RealizedPnl)
}
}
time.Sleep(1 * time.Second)
}
break
case "BITGET":
//summary, orders, _ := GetPositions_Bitget(api)
break
default:
}
return
}