mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 01:01:56 +00:00
xfunding: always sync funding fee
This commit is contained in:
parent
dc16e0c299
commit
f9eba64816
|
@ -350,9 +350,7 @@ func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.Order
|
|||
bbgo.Notify("Neutral Position", s.NeutralPosition)
|
||||
|
||||
// sync funding fee txns
|
||||
if !s.ProfitStats.LastFundingFeeTime.IsZero() {
|
||||
s.syncFundingFeeRecords(ctx, s.ProfitStats.LastFundingFeeTime)
|
||||
}
|
||||
s.syncFundingFeeRecords(ctx, s.ProfitStats.LastFundingFeeTime)
|
||||
|
||||
// TEST CODE:
|
||||
// s.syncFundingFeeRecords(ctx, time.Now().Add(-3*24*time.Hour))
|
||||
|
@ -538,6 +536,10 @@ func (s *Strategy) handleAccountUpdate(ctx context.Context, e *binance.AccountUp
|
|||
func (s *Strategy) syncFundingFeeRecords(ctx context.Context, since time.Time) {
|
||||
now := time.Now()
|
||||
|
||||
if since.IsZero() {
|
||||
since = now.AddDate(0, -3, 0)
|
||||
}
|
||||
|
||||
log.Infof("syncing funding fee records from the income history query: %s <=> %s", since, now)
|
||||
|
||||
defer log.Infof("sync funding fee records done")
|
||||
|
|
Loading…
Reference in New Issue
Block a user