mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 00:05:15 +00:00
add multiple spec support
This commit is contained in:
parent
9c751f377a
commit
6b0f2b80d7
|
@ -83,7 +83,8 @@ var runCmd = &cobra.Command{
|
||||||
}
|
}
|
||||||
|
|
||||||
trader.ReportPnL(notifier).
|
trader.ReportPnL(notifier).
|
||||||
AverageCostBySymbols("BTCUSDT", "BNBUSDT").Of("max", "binance")
|
AverageCostBySymbols("BTCUSDT", "BNBUSDT").
|
||||||
|
Of("max", "binance").When("@daily", "@hourly")
|
||||||
|
|
||||||
err = trader.Run(ctx)
|
err = trader.Run(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -81,10 +81,12 @@ func (reporter *AverageCostPnLReporter) Of(sessions ...string) *AverageCostPnLRe
|
||||||
return reporter
|
return reporter
|
||||||
}
|
}
|
||||||
|
|
||||||
func (reporter *AverageCostPnLReporter) When(spec string) *AverageCostPnLReporter {
|
func (reporter *AverageCostPnLReporter) When(specs ...string) *AverageCostPnLReporter {
|
||||||
_, err := reporter.cron.AddJob(spec, reporter)
|
for _,spec := range specs {
|
||||||
if err != nil {
|
_, err := reporter.cron.AddJob(spec, reporter)
|
||||||
panic(err)
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return reporter
|
return reporter
|
||||||
|
|
Loading…
Reference in New Issue
Block a user