Add test for simple moving average indicator
This commit is contained in:
parent
a530fad824
commit
c01e8fb859
10
test/sma_test.py
Normal file
10
test/sma_test.py
Normal file
@ -0,0 +1,10 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from indicators import sma
|
||||
from ohlc import ohlc
|
||||
|
||||
today = datetime.today()
|
||||
data = ohlc('SPY', start_date = today - timedelta(days = 365), end_date = today)
|
||||
|
||||
sma_values = sma(data, period = 10)
|
||||
print(sma_values)
|
Loading…
Reference in New Issue
Block a user