From 9304b42ff22ec24fe08c65c95d0424f49324b29b Mon Sep 17 00:00:00 2001 From: Bemhreth Date: Wed, 26 Jan 2022 15:07:35 +0300 Subject: [PATCH] INDEXING --- freq_data_cleaner.py | 8 ++++---- user_data/strategies/util.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/freq_data_cleaner.py b/freq_data_cleaner.py index 9844dda1d..09d76f81a 100644 --- a/freq_data_cleaner.py +++ b/freq_data_cleaner.py @@ -3,7 +3,7 @@ import datetime import time import os import sys -from user_data.strategies.util import BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH, BACKTEST_YEAR, BACKTEST_MONTH +from user_data.strategies.util import BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH, BACKTEST_YEAR, BACKTEST_MONTH_INDEX def clean_json(): print("clean_json: json_path = " + BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH) @@ -17,7 +17,7 @@ def clean_json(): date = datetime.datetime.strptime(str(date), "%Y-%m-%d %H:%M:%S") year = date.year month = date.month - if year == int(BACKTEST_YEAR) and month == int(BACKTEST_MONTH): + if year == int(BACKTEST_YEAR) and month == int(BACKTEST_MONTH_INDEX): list.append(datas) json_object = json.dumps(list) file.close() @@ -31,10 +31,10 @@ def write_to_json(json_object): if len(sys.argv) < 4: exit("""Incorrect number of arguments. - python3 freq_data_cleaner.py [json_file] [month] [year] + python3 freq_data_cleaner.py [json_file] [month index] [year] """) else: BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH = sys.argv[1] - BACKTEST_MONTH = sys.argv[2] + BACKTEST_MONTH_INDEX = sys.argv[2] BACKTEST_YEAR = sys.argv[3] clean_json() \ No newline at end of file diff --git a/user_data/strategies/util.py b/user_data/strategies/util.py index 52532a841..01506c750 100644 --- a/user_data/strategies/util.py +++ b/user_data/strategies/util.py @@ -2,7 +2,7 @@ import subprocess BACKTEST_DOWNLOADED_JSON_DATA_FILE_PATH = "" BACKTEST_YEAR = 2020 -BACKTEST_MONTH = 10 +BACKTEST_MONTH_INDEX = 9 IS_BACKTEST = False WORKSPACE_PATH = "workspace2" if IS_BACKTEST else "workspace" EXECUTION_PATH = "/root/" + WORKSPACE_PATH + "/execution/"