strategies/test/five_period_rsi.py

13 lines
324 B
Python
Raw Normal View History

2025-01-06 18:47:55 +00:00
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))