@@ -98,9 +98,11 @@ def prepare_data(
98
98
TimeFrame .from_string (self .timeframe ).amount_of_minutes
99
99
)
100
100
)
101
- self .backtest_data_start_date = backtest_data_start_date
102
- self .backtest_data_index_date = backtest_data_start_date
103
- self .backtest_data_end_date = backtest_end_date
101
+ self .backtest_data_start_date = backtest_data_start_date \
102
+ .replace (microsecond = 0 )
103
+ self .backtest_data_index_date = backtest_data_start_date \
104
+ .replace (microsecond = 0 )
105
+ self .backtest_data_end_date = backtest_end_date .replace (microsecond = 0 )
104
106
105
107
# Creating the backtest data directory and file
106
108
self .backtest_data_directory = os .path .join (
@@ -112,7 +114,7 @@ def prepare_data(
112
114
os .mkdir (self .backtest_data_directory )
113
115
114
116
file_path = self ._create_file_path ()
115
- print ( self . _data_source_exists ( file_path ))
117
+
116
118
if not self ._data_source_exists (file_path ):
117
119
if not os .path .isfile (file_path ):
118
120
try :
@@ -165,7 +167,9 @@ def get_data(self, backtest_index_date, **kwargs):
165
167
from_timestamp = backtest_index_date - timedelta (
166
168
minutes = self .total_minutes_timeframe
167
169
)
168
- self .backtest_data_index_date = backtest_index_date
170
+ self .backtest_data_index_date = backtest_index_date \
171
+ .replace (microsecond = 0 )
172
+ from_timestamp = from_timestamp .replace (microsecond = 0 )
169
173
170
174
if from_timestamp < self .backtest_data_start_date :
171
175
raise OperationalException (
0 commit comments