Start to implement testPolicy
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
import pandas as pd
|
||||
import datetime as dt
|
||||
from util import get_data, plot_data
|
||||
from util import get_data
|
||||
from marketsim.marketsim import compute_portvals
|
||||
from optimize_something.optimization import calculate_stats
|
||||
|
||||
|
||||
def author():
|
||||
return "felixm"
|
||||
|
||||
|
||||
def main():
|
||||
start_date = dt.datetime(2008, 1, 1)
|
||||
end_date = dt.datetime(2009, 12, 31)
|
||||
prices = get_data(['JPM'], pd.date_range(start_date, end_date))
|
||||
print(prices)
|
||||
def testPolicy(symbol, sd, ed, sv):
|
||||
print(f"{symbol=} {sd} - {ed} {sv=}")
|
||||
# trade = date, shares (-2000, -1000, 0, 1000, 2000)
|
||||
prices = get_data([symbol], pd.date_range(sd, ed))
|
||||
print(prices.index)
|
||||
return
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user