strategies/test/connors_rsi_test.py

13 lines
316 B
Python
Raw Normal View History

2025-01-08 18:51:14 +00:00
from datetime import datetime, timedelta
from ohlc import ohlc
from strategies import connors_rsi
today = datetime.today()
data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today)
signals = connors_rsi(data)
result = data[['Date']].copy()
result['Signal'] = signals
print(result.tail(50))