Now we need to create the MACD indicator on which our system will be based. Right click on the Indicators Item and select New. This will bring up the New Indicator dialog box.
•Name for Code: Similar to parameters, this is the name you will use to access the value of the indicator from the scripting language. We will call our indicator "macdIndicator".
•Type: Select "MACD - MA Convergence/Divergence".
•Value: In this case we use the Close price of each bar record to calculate each moving average. You can select other values from the drop-down list to see how it affects the performance of your system when you are ready to expirement.
•Short MA Bars: Select the parameter we setup to hold the short moving average calculation length, which was shortMovingAverageBars
•Long MA Bars: Select the parameter we setup to hold the long moving average period length, which was longMovingAverageBars
•Plots: Check this box so the indicator will be plotted on the graph just below the price chart display. Enter the graph area display name, and select a color if you want a different color for the indicator line. Also check the "Display Value" option so you will be able to see the value of the indicator at each price bar location. Indicator value will be displayed in the data window section on the right side of the graph and it will change as you move you mouse cursor across the chart area.
•Offset Plot by One Day: Leave this option unchecked. If our system were trading on stops or limits and the indicator displayed over the price bars, this option would show the value at which the next price bar crossed the the indicator line.
•When you are finished creating our indicator, press OK.
We are going to add one more indicator so the display of the MACD below the price chart area will have a zero reference line displayed on the same MACD Indicator area. This new indicator will be named "ZeroLine" and it will the same zero value across the entire graph area.
Use the typed notations on the Edit Indicator dialog to create the indicator and then press OK when you are done.
MACD Indicator Graph Example:
With both indicators created, and once the rest of the tutorial is completed and you are ready to run a test, the chart in this next image will display how both indicators will appear in a chart area:
This completes this topic with the information we need to move on to the step in this tutorial.
To create new indicators, review the information here: Creating Indicators
Edit Time: 10/12/2018 7:34:36 PM
Topic ID#: 122