mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
add warning logs to pnl cmd
This commit is contained in:
parent
8c6331073d
commit
99bf914415
|
@ -4,6 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -105,7 +106,12 @@ var PnLCmd = &cobra.Command{
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
_ = withdrawals
|
|
||||||
|
sort.Slice(withdrawals, func(i, j int) bool {
|
||||||
|
a := withdrawals[i].ApplyTime.Time()
|
||||||
|
b := withdrawals[j].ApplyTime.Time()
|
||||||
|
return a.Before(b)
|
||||||
|
})
|
||||||
|
|
||||||
// we need the backtest klines for the daily prices
|
// we need the backtest klines for the daily prices
|
||||||
backtestService := &service.BacktestService{DB: environ.DatabaseService.DB}
|
backtestService := &service.BacktestService{DB: environ.DatabaseService.DB}
|
||||||
|
@ -155,6 +161,9 @@ var PnLCmd = &cobra.Command{
|
||||||
|
|
||||||
report := calculator.Calculate(symbol, trades, currentPrice)
|
report := calculator.Calculate(symbol, trades, currentPrice)
|
||||||
report.Print()
|
report.Print()
|
||||||
|
|
||||||
|
log.Warnf("note that if you're using cross-exchange arbitrage, the PnL won't be accurate")
|
||||||
|
log.Warnf("withdrawal and deposits are not considered in the PnL")
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user