mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
early return if len of trades == 0
This commit is contained in:
parent
870bae19d3
commit
916b3b0eca
|
@ -23,6 +23,17 @@ func (c *AverageCostCalculator) Calculate(symbol string, trades []types.Trade, c
|
|||
var bidFeeUSD = 0.0
|
||||
var feeRate = 0.0015
|
||||
|
||||
if len(trades) == 0 {
|
||||
return &AverageCostPnlReport{
|
||||
Symbol: symbol,
|
||||
CurrentPrice: currentPrice,
|
||||
NumTrades: 0,
|
||||
BidVolume: bidVolume,
|
||||
AskVolume: askVolume,
|
||||
FeeUSD: feeUSD,
|
||||
}
|
||||
}
|
||||
|
||||
var currencyFees = map[string]float64{}
|
||||
|
||||
for _, trade := range trades {
|
||||
|
|
Loading…
Reference in New Issue
Block a user