mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-21 22:43:52 +00:00
add JSON method to the pnl report
This commit is contained in:
parent
0c6055a201
commit
1e151a170a
|
@ -1,6 +1,7 @@
|
|||
package pnl
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
|
@ -30,6 +31,10 @@ type AverageCostPnlReport struct {
|
|||
CurrencyFees map[string]float64 `json:"currencyFees,omitempty"`
|
||||
}
|
||||
|
||||
func (report *AverageCostPnlReport) JSON() ([]byte, error) {
|
||||
return json.MarshalIndent(report, "", " ")
|
||||
}
|
||||
|
||||
func (report AverageCostPnlReport) Print() {
|
||||
log.Infof("TRADES SINCE: %v", report.StartTime)
|
||||
log.Infof("NUMBER OF TRADES: %d", report.NumTrades)
|
||||
|
|
Loading…
Reference in New Issue
Block a user