October 2018
Beginner
362 pages
9h 32m
English
While utilizing algorithms to inform trading decisions is the definition of algorithmic trading, this is not necessarily automated trading. For that, we need to create an artificial trading agent that will execute our strategies for us:
class Trader(object): ''' An Artificial Trading Agent ''' def __init__(self, market, cash=100000000.0): ## Initialize all the variables we need for our trader self.cash = cash ## Our Cash Variable self.market = market ## self.codes = market.codes self.reward = 0 self.positions = [] self.action_times = 0 self.initial_cash = cash self.max_cash = cash * 3 self.total_rewards ...
Read now
Unlock full access