Add test for R3 strategy

This commit is contained in:
moshferatu 2024-12-09 08:19:07 -08:00
parent e6b7cbab41
commit 11e4817f33

13
test/r3_test.py Normal file
View File

@ -0,0 +1,13 @@
from datetime import datetime, timedelta
from ohlc import ohlc
from strategies import r3
today = datetime.today()
data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today)
signals = r3(data)
result = data[['Date']].copy()
result['Signal'] = signals
print(result.tail(50))