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,11 +81,13 @@ 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 {
|
||||||
|
for _,spec := range specs {
|
||||||
_, err := reporter.cron.AddJob(spec, reporter)
|
_, err := reporter.cron.AddJob(spec, reporter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return reporter
|
return reporter
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user