mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Ensure testdata generation works for 1M data
This commit is contained in:
parent
34bce4d251
commit
c017366086
|
@ -87,11 +87,13 @@ def get_args(args):
|
|||
|
||||
def generate_test_data(timeframe: str, size: int, start: str = '2020-07-05'):
|
||||
np.random.seed(42)
|
||||
tf_mins = timeframe_to_minutes(timeframe)
|
||||
|
||||
base = np.random.normal(20, 2, size=size)
|
||||
|
||||
date = pd.date_range(start, periods=size, freq=f'{tf_mins}min', tz='UTC')
|
||||
if timeframe == '1M':
|
||||
date = pd.date_range(start, periods=size, freq='1MS', tz='UTC')
|
||||
else:
|
||||
tf_mins = timeframe_to_minutes(timeframe)
|
||||
date = pd.date_range(start, periods=size, freq=f'{tf_mins}min', tz='UTC')
|
||||
df = pd.DataFrame({
|
||||
'date': date,
|
||||
'open': base,
|
||||
|
|
Loading…
Reference in New Issue
Block a user