types: preset fixedpoint zero fields

This commit is contained in:
c9s 2022-09-19 09:31:04 +08:00
parent dc0fca09f2
commit 26cf048c84
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -168,10 +168,20 @@ type ProfitStats struct {
func NewProfitStats(market Market) *ProfitStats {
return &ProfitStats{
Symbol: market.Symbol,
BaseCurrency: market.BaseCurrency,
QuoteCurrency: market.QuoteCurrency,
AccumulatedSince: time.Now().Unix(),
Symbol: market.Symbol,
QuoteCurrency: market.QuoteCurrency,
BaseCurrency: market.BaseCurrency,
AccumulatedPnL: fixedpoint.Zero,
AccumulatedNetProfit: fixedpoint.Zero,
AccumulatedGrossProfit: fixedpoint.Zero,
AccumulatedGrossLoss: fixedpoint.Zero,
AccumulatedVolume: fixedpoint.Zero,
AccumulatedSince: 0,
TodayPnL: fixedpoint.Zero,
TodayNetProfit: fixedpoint.Zero,
TodayGrossProfit: fixedpoint.Zero,
TodayGrossLoss: fixedpoint.Zero,
TodaySince: 0,
}
}