mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add start time and end time to the report struct
This commit is contained in:
parent
555e2581a0
commit
5b443f0aeb
|
@ -11,6 +11,8 @@ import (
|
|||
)
|
||||
|
||||
type Report struct {
|
||||
StartTime time.Time `json:"startTime"`
|
||||
EndTime time.Time `json:"endTime"`
|
||||
Symbol string `json:"symbol,omitempty"`
|
||||
LastPrice fixedpoint.Value `json:"lastPrice,omitempty"`
|
||||
StartPrice fixedpoint.Value `json:"startPrice,omitempty"`
|
||||
|
|
|
@ -150,13 +150,11 @@ var BacktestCmd = &cobra.Command{
|
|||
|
||||
// set default start time to the past 6 months
|
||||
// userConfig.Backtest.StartTime = now.AddDate(0, -6, 0).Format("2006-01-02")
|
||||
|
||||
if userConfig.Backtest.EndTime != nil {
|
||||
endTime = userConfig.Backtest.EndTime.Time()
|
||||
} else {
|
||||
endTime = now
|
||||
}
|
||||
_ = endTime
|
||||
|
||||
log.Infof("starting backtest with startTime %s", startTime.Format(time.ANSIC))
|
||||
|
||||
|
@ -468,6 +466,8 @@ var BacktestCmd = &cobra.Command{
|
|||
|
||||
if jsonOutputEnabled {
|
||||
result := backtest.Report{
|
||||
StartTime: startTime,
|
||||
EndTime: endTime,
|
||||
Symbol: symbol,
|
||||
LastPrice: lastPrice,
|
||||
StartPrice: startPrice,
|
||||
|
|
Loading…
Reference in New Issue
Block a user