initial
This commit is contained in:
31
trade/history.go
Normal file
31
trade/history.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user