Add test for TPS strategy
This commit is contained in:
parent
be4f58371d
commit
a879c0cf3e
13
test/tps_test.py
Normal file
13
test/tps_test.py
Normal file
@ -0,0 +1,13 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from ohlc import ohlc
|
||||
from strategies import tps
|
||||
|
||||
today = datetime.today()
|
||||
data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today)
|
||||
|
||||
signals = tps(data)
|
||||
|
||||
result = data[['Date']].copy()
|
||||
result['Signal'] = signals
|
||||
print(result.tail(50))
|
Loading…
Reference in New Issue
Block a user