Moving Average Convergence Divergence Strategy
Moving Average Convergence Divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of a security’s price, this is how we’d use it in a strategy.
Creating the MACD Condition
1. Upon login in, click on the “Build a Strategy” button on the top right of your screen.
2. Click on the “Build new strategy” button.
3. At the “New Strategy” window, give your strategy a name, select the currency pair you want to trade in, and the candle period. In the example below, we have named our strategy “MACD Strategy”, chosen the EUR/USD currency pair and selected a 30 minute candle period.
4. Click “Create” when you are done.
5. You are now in the main strategy window.
6. Click on the “New Condition” button to start creating your algo conditions.
7. You are now in the “Algorithm Creator” window. You will be given a choice of 2 buttons, “Indicator” or “Number”. Click on the “Indicator” button.
8. You will see the statement line now saying “When EUR/USD” and a list of indicators shown.
9. Click on “Macd”, and you will be sent into the window to input your MACD parameters.
10. The standard MACD parameters are 12,26,9. So let’s use that for our example here. However, please do not find yourself constrained by defaults or “traditional” parameters.
11. You also need to select either the “VALUE”, “SIGNAL” or “HISTOGRAM” values (to be used as the parametric values upon which your comparison will be made. We use “VALUE” in this example.
12. Clicking on “Next” presents you with a selection of two buttons, “Comparison” or “Arithmetic”. Choose “Comparison” so that you can compare that “VALUE” you choose earlier with something.
13. You are now presented with nine choices of comparison operators. We select “Crosses from below to the above”.
14. You are then put back into a page where you can select either an “Indicator” or a “Number”. Select “Indicator” again, as you did in step 7 earlier.
15. In the indicators page, choose “Macd” again.
16. Put in the same parameters as in step 10, “12,26,9” (you can put in different values here if you want to, which would then alter the way the algorithm behaves, but a discussion on that is beyond the scope of this howto.)
17. In step 11, we selected “VALUE” as the value to be used, but here we will select “SIGNAL”.
18. Upon clicking next, you will be taken to the next page where you will be given three possible choices: “Arithmetic”, “Action” or “And/Or”. For now, choose “Action”.
19. You can now decide whether to do a “Buy” or a “Sell”. We choose “Buy”.
20. Click on the “Confirm” button to save the condition and return to the main strategy page.
And you have now created a MACD based strategy.
All our algorithm conditions start with a “When” statement. In other words, Our algorithms will have statements that say: When a condition is met, do this. In our context, we’re essentially saying, “When these set of conditions are met, BUY (or SELL) this currency pair”
Manage Money (Risk)
Now that you have created the condition for your strategy, you need to set the parameters for your risk. This is the money management section of your strategy.
There is a more detailed description of the fields on this page here, but for now, you can fill in the parameters as shown in the screenshot below:
Once the “Risk” parameters are filled, click on “Save” and you will be returned to the main strategy window again.
Backtesting The Strategy
With the money management a.k.a. “Risk” section done, you are now ready to test your algorithm.
1. Start by clicking on the “Back Test” button.
2. You will now be presented with the Backtest time period selection window.
3. Select the “Backtest over 10 years” checkbox and click “Confirm”.
4. After the backtest is completed, you will be presented with a summary of the results.
5. Clicking on the “Equity” tab will show you the equity chart, drawing a graph of your algorithm’s performance during the backtest.
6. The “History” tab will provide you with a list of results from the backtest, which you can also download by clicking on the “Download CSV” button – something that you might want to do if you want to further analyse the performance of your algorithm.
Running Your Strategy Live
Now that you have done the backtest, you may want to run a paper test, which is running your algo on live data but not actually executing the trades when the conditions are met.
Or, you can just bite the bullet and go live if you are already happy enough with your algo and its bactest results.
To do so, click on the “Live Trade” button on your main strategy page, and you are live!