mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-14 02:53:50 +00:00
xmaker: call reset today if the date exceeded
This commit is contained in:
parent
fcc1331fcd
commit
1d316ed89c
|
@ -85,6 +85,10 @@ func (s *ProfitStats) AddProfit(profit, netProfit fixedpoint.Value) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProfitStats) AddTrade(trade types.Trade) {
|
func (s *ProfitStats) AddTrade(trade types.Trade) {
|
||||||
|
if s.IsOver24Hours() {
|
||||||
|
s.ResetToday()
|
||||||
|
}
|
||||||
|
|
||||||
if trade.Exchange == s.MakerExchange {
|
if trade.Exchange == s.MakerExchange {
|
||||||
s.AccumulatedMakerVolume.AtomicAdd(fixedpoint.NewFromFloat(trade.Quantity))
|
s.AccumulatedMakerVolume.AtomicAdd(fixedpoint.NewFromFloat(trade.Quantity))
|
||||||
s.TodayMakerVolume.AtomicAdd(fixedpoint.NewFromFloat(trade.Quantity))
|
s.TodayMakerVolume.AtomicAdd(fixedpoint.NewFromFloat(trade.Quantity))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user