mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
bbgo: do not write trade when writing position
This commit is contained in:
parent
0e417f6f71
commit
450517d159
|
@ -702,17 +702,6 @@ func (environ *Environment) RecordPosition(position *types.Position, trade types
|
||||||
log.WithError(err).Errorf("can not insert position record")
|
log.WithError(err).Errorf("can not insert position record")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if:
|
|
||||||
// 1) we are not using sync
|
|
||||||
// 2) and not sync-ing trades from the user data stream
|
|
||||||
if environ.TradeService != nil && (environ.syncConfig == nil ||
|
|
||||||
(environ.syncConfig.UserDataStream == nil) ||
|
|
||||||
(environ.syncConfig.UserDataStream != nil && !environ.syncConfig.UserDataStream.Trades)) {
|
|
||||||
if err := environ.TradeService.Insert(trade); err != nil {
|
|
||||||
log.WithError(err).Errorf("can not insert trade record: %+v", trade)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (environ *Environment) RecordProfit(profit types.Profit) {
|
func (environ *Environment) RecordProfit(profit types.Profit) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user