This course provides a detailed walkthrough on using the MachineTrader backtester to test and refine trading algorithms using historical data. The backtester enables users to simulate algorithm performance and make necessary adjustments for improved trading results.
The tutorial begins with downloading prewritten code from a shared drive and importing it into a Node-RED workflow. The process involves setting up a database table to store price data, using Polygon as the data source, and ensuring that historical stock prices are properly fetched and recorded. The example focuses on Apple’s stock, though the process can be applied to any ticker symbol by modifying a single variable.
The next step involves structuring the table to store minute-by-minute trading data, creating 390 rows corresponding to each trading minute in a day. The data is then retrieved from Polygon via an HTTP request, storing price points in an array.
The trading engine is then engaged to simulate trades based on price data using a Bollinger Bands-based Z-score strategy. Trades occur when the Z-score crosses set thresholds, with the algorithm buying when the stock is oversold and selling when it is overbought. The tutorial explores optimizing the strategy by adjusting the Z-score threshold, testing multiple scenarios, and comparing profitability.
Finally, the data is exported to Excel for analysis, where trade performance, price movement, and Z-score behavior are visualized using charts. The course emphasizes the importance of data analysis in algorithmic trading, highlighting the iterative nature of backtesting for refining profitable strategies.
Click here to sign up for the course: Learn to Backtest with Machinetrader.