From 06262f017266c08dc121068399f0f835fcef7bb1 Mon Sep 17 00:00:00 2001 From: c9s Date: Thu, 9 Dec 2021 12:14:30 +0800 Subject: [PATCH] check sync from time with start time instead of end time --- pkg/cmd/backtest.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cmd/backtest.go b/pkg/cmd/backtest.go index 22611d3d3..41eeb6dc2 100644 --- a/pkg/cmd/backtest.go +++ b/pkg/cmd/backtest.go @@ -180,7 +180,7 @@ var BacktestCmd = &cobra.Command{ // if we don't have klines before the start time endpoint, the back-test will fail. // because the last price will be missing. - if firstKLine != nil && syncFromTime.Before(firstKLine.EndTime) { + if firstKLine != nil && syncFromTime.Before(firstKLine.StartTime) { return fmt.Errorf("the sync-from-time you gave %s is earlier than the previous sync-start-time %s. "+ "re-syncing data from the earlier date before your first sync is not support,"+ "please clean up the kline table and restart a new sync",