mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-24 15:55:14 +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).
|
||||
AverageCostBySymbols("BTCUSDT", "BNBUSDT").Of("max", "binance")
|
||||
AverageCostBySymbols("BTCUSDT", "BNBUSDT").
|
||||
Of("max", "binance").When("@daily", "@hourly")
|
||||
|
||||
err = trader.Run(ctx)
|
||||
if err != nil {
|
||||
|
|
|
@ -81,10 +81,12 @@ func (reporter *AverageCostPnLReporter) Of(sessions ...string) *AverageCostPnLRe
|
|||
return reporter
|
||||
}
|
||||
|
||||
func (reporter *AverageCostPnLReporter) When(spec string) *AverageCostPnLReporter {
|
||||
_, err := reporter.cron.AddJob(spec, reporter)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
func (reporter *AverageCostPnLReporter) When(specs ...string) *AverageCostPnLReporter {
|
||||
for _,spec := range specs {
|
||||
_, err := reporter.cron.AddJob(spec, reporter)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
return reporter
|
||||
|
|
Loading…
Reference in New Issue
Block a user