April 2019
Intermediate to advanced
426 pages
11h 13m
English
Let's start our trend-following trading system by instantiating the TrendFollowingTrader class and running it using the following code:
trader = TrendFollowingTrader(
broker,
resample_interval='60s',
symbol='EUR_USD',
units=1,
mean_periods=5,
long_mean_periods=10,
buy_threshold=1.000010,
sell_threshold=0.99990,
)
trader.run()
The first parameter, broker, is the same object created for our broker in the previous section. Again, we are resampling our time series prices at one-minute intervals, and we are interested in trading the EUR/USD currency pair, entering into a position of at most one unit at any given time. With a mean_periods value of 5, we are interested in taking the most recent five resampled ...
Read now
Unlock full access