Add test for 5-Period RSI strategy

This commit is contained in:
moshferatu 2025-01-06 10:47:55 -08:00
parent 5e5cbdfbd9
commit c37b9b8b69

13
test/five_period_rsi.py Normal file
View File

@ -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))