Files
ML4T/manual_strategy/indicators.py

38 lines
764 B
Python

import datetime as dt
import TheoreticallyOptimalStrategy as tos
def author():
return "felixm"
def test_policy():
sd = dt.datetime(2008, 1, 1)
ed = dt.datetime(2009, 12, 31)
tos.testPolicy(symbol="JPM", sd=sd, ed=ed, sv=100000)
def normalize(timeseries):
return timeseries / timeseries.iloc[0]
def bollinger_band(prices):
pass
def main():
test_policy()
# sd = dt.datetime(2008, 1, 1)
# ed = dt.datetime(2009, 12, 31)
# prices = get_data(['JPM'], pd.date_range(sd, ed))
# prices['JPM'] = normalize(prices['JPM'])
# print(prices)
# plot_data(prices)
# prices_appl = get_data(['AAPL'], pd.date_range(sd, ed), 'High')
# prices['AAPL'] = prices_appl['AAPL']
if __name__ == "__main__":
main()