From c37b9b8b69802cd6aacb05f3a22ef78a178328cc Mon Sep 17 00:00:00 2001 From: moshferatu Date: Mon, 6 Jan 2025 10:47:55 -0800 Subject: [PATCH] Add test for 5-Period RSI strategy --- test/five_period_rsi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 test/five_period_rsi.py diff --git a/test/five_period_rsi.py b/test/five_period_rsi.py new file mode 100644 index 0000000..e739faf --- /dev/null +++ b/test/five_period_rsi.py @@ -0,0 +1,13 @@ +from datetime import datetime, timedelta + +from ohlc import ohlc +from strategies import five_period_rsi + +today = datetime.today() +data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today) + +signals = five_period_rsi(data) + +result = data[['Date']].copy() +result['Signal'] = signals +print(result.tail(50)) \ No newline at end of file