diff --git a/scripts/config.json b/scripts/config.json index 0747697..06095b8 100644 --- a/scripts/config.json +++ b/scripts/config.json @@ -1,6 +1,7 @@ { - "initial_cash": 20000000, - "start_date": "2023-05-16", - "end_date": "2024-05-30", - "ticker": "NVDA" + "initial_cash": 200, + "start_date": "2023-10-16", + "end_date": "2024-06-16", + "ticker": "TSLA", + "indicator": "RSI" } \ No newline at end of file diff --git a/scripts/indicators.py b/scripts/indicators.py index 3b70ec0..bfbf380 100644 --- a/scripts/indicators.py +++ b/scripts/indicators.py @@ -185,21 +185,21 @@ def run_backtest(config): } } # Save the results to a JSON file - with open(f'results/backtest_results_{ticker}_{start_date}_to_{end_date}_{indicator}.json', 'w') as f: + with open(f'scripts/results/backtest_results_{ticker}_{start_date}_to_{end_date}_{indicator}.json', 'w') as f: json.dump(backtest_results, f, indent=4) # Print results print(json.dumps(backtest_results, indent=4)) if __name__ == '__main__': - with open('config.json', 'r') as f: + with open('scripts/config.json', 'r') as f: config = json.load(f) - initial_cash, start_date, end_date, ticker, indicator = get_user_input() - config['initial_cash'] = initial_cash - config['start_date'] = start_date - config['end_date'] = end_date - config['ticker'] = ticker - config['indicator'] = indicator + # initial_cash, start_date, end_date, ticker, indicator = get_user_input() + # config['initial_cash'] = initial_cash + # config['start_date'] = start_date + # config['end_date'] = end_date + # config['ticker'] = ticker + # config['indicator'] = indicator run_backtest(config) \ No newline at end of file