def execute(self): options = Command._parse_flags(['tickers', 'start_date', 'end_date', 'strategy']) market = load_market(options['start_date'], options['end_date'], options['tickers']) portfolio = Portfolio() simulation = Simulation(portfolio, market) trades = get_trades(options) simulation.run(trades) print(simulation)
def execute(self): options = Command._parse_flags( ['tickers', 'start_date', 'end_date', 'strategy']) market = load_market(options['start_date'], options['end_date'], options['tickers']) portfolio = Portfolio() simulation = Simulation(portfolio, market) trades = get_trades(options) simulation.run(trades) print(simulation)
def execute(self): options = Command._parse_flags(['tickers', 'start_date', 'end_date', 'model_dir']) market = load_market(options['start_date'], options['end_date'], options['tickers']) if len(market.stocks) != 1: raise Exception('expected 1 stock, found %d' % len(market.stocks)) stock = next(iter(market.stocks.values())) examples = stock.features_all() print('DEBUG: examples', examples) estimator = LinearRegressionEstimator(options['model_dir']) estimator.train(examples, 1000) print('trained model written to', options['model_dir'])
def execute(self): options = Command._parse_flags( ['tickers', 'start_date', 'end_date', 'model_dir']) market = load_market(options['start_date'], options['end_date'], options['tickers']) if len(market.stocks) != 1: raise Exception('expected 1 stock, found %d' % len(market.stocks)) stock = next(iter(market.stocks.values())) examples = stock.features_all() print('DEBUG: examples', examples) estimator = LinearRegressionEstimator(options['model_dir']) estimator.train(examples, 1000) print('trained model written to', options['model_dir'])
def execute(self): options = Command._parse_flags(['tickers', 'start_date', 'end_date']) market = load_market(options['start_date'], options['end_date'], options['tickers']) for stock in market.stocks.values(): print(stock)