@@ -88,6 +88,9 @@ def get_data(self, **kwargs):
88
88
end_date = kwargs .get ("end_date" )
89
89
backtest_index_date = kwargs .get ("backtest_index_date" )
90
90
91
+ if "window_size" in kwargs :
92
+ self .window_size = kwargs ["window_size" ]
93
+
91
94
if start_date is None \
92
95
and end_date is None \
93
96
and backtest_index_date is None :
@@ -97,11 +100,27 @@ def get_data(self, **kwargs):
97
100
98
101
if backtest_index_date is not None :
99
102
end_date = backtest_index_date
103
+
104
+ if self .window_size is None :
105
+ raise OperationalException (
106
+ "Either end_date or window_size "
107
+ "should be passed as a "
108
+ "parameter for CCXTOHLCVMarketDataSource"
109
+ )
110
+
100
111
start_date = self .create_start_date (
101
112
end_date , self .timeframe , self .window_size
102
113
)
103
114
else :
104
115
if start_date is None :
116
+
117
+ if self .window_size is None :
118
+ raise OperationalException (
119
+ "Either end_date or window_size "
120
+ "should be passed as a "
121
+ "parameter for CCXTOHLCVMarketDataSource"
122
+ )
123
+
105
124
start_date = self .create_start_date (
106
125
end_date , self .timeframe , self .window_size
107
126
)
@@ -111,20 +130,6 @@ def get_data(self, **kwargs):
111
130
start_date , self .timeframe , self .window_size
112
131
)
113
132
114
- # # Check if start or end date are out of range with
115
- # # the dates of the datasource.
116
- # if self._start_date_data_source > start_date:
117
- # raise OperationalException(
118
- # f"Given start date {start_date} is before the start date "
119
- # f"of the data source {self._start_date_data_source}"
120
- # )
121
- #
122
- # if self._end_date_data_source < end_date:
123
- # raise OperationalException(
124
- # f"End date {end_date} is after the end date "
125
- # f"of the data source {self._end_date_data_source}"
126
- # )
127
-
128
133
df = polars .read_csv (
129
134
self .csv_file_path , columns = self ._columns , separator = ","
130
135
)
0 commit comments