mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
Merge pull request #793 from LarryLuTW/larry/fix-pnl-market
Fix pnl command
This commit is contained in:
commit
6fe980a2a3
|
@ -184,9 +184,15 @@ var PnLCmd = &cobra.Command{
|
|||
return errors.New("no ticker data for current price")
|
||||
}
|
||||
|
||||
market, ok := session.Market(symbol)
|
||||
if !ok {
|
||||
return fmt.Errorf("market not found: %s, %s", symbol, session.Exchange.Name())
|
||||
}
|
||||
|
||||
currentPrice := currentTick.Last
|
||||
calculator := &pnl.AverageCostCalculator{
|
||||
TradingFeeCurrency: tradingFeeCurrency,
|
||||
Market: market,
|
||||
}
|
||||
|
||||
report := calculator.Calculate(symbol, trades, currentPrice)
|
||||
|
|
Loading…
Reference in New Issue
Block a user