Here is a list of the chart scripts that have been added to EdgeRater in order to support the new MACD Trading Templates. You do not need to know any of this in order to successfully use the templates. The information is here for users who like to dig a little deeper and will help if you decide to write your own templates.

MD_MACD(FASTPERIOD, SLOWPERIOD, M)

The MACD script used to calculate and display the 2 line MACD. The lines are configured such that the MACD line is blue and the signal line (SIG) is red. This script can be added to a chart sub area and is also called from the other MACD divergence scripts.

MD_ZIGZAG(ZPCT)

The MD_ZIGZAG script calculates and displays a zigzag line that traces from peaks to troughs. The parameter ZPCT specifies how much of a % price change should be considered as noise threshold  and therefore not be included as part of the line. The ZigZag script will start to draw a line in a new direction once a one-bar pullback or rally is detected from the previous potential peak or trough. This gives an early warning as to a top or bottom but it may be invalidated after more bars are added to the chart on subsequent days. It is therefore important to know that this indicator cannot be used in backtesting. Once a new direction of the line reaches the ZPCT threshold level it will not be changed with future bars but it can be until that point.

MD_MACD_DIVTOP_VALS(ZPCT)/MD_MACD_DIVBOT_VALS(ZPCT)

These scripts calculate the values that are used to determine whether a potential MACD double top or bottom  divergence exists. These scripts can be added to a chart sub area for display of the values. They are also called from the MACD templates.

MD_EMACONF(FASTPERIOD,SLOWPERIOD)

This script outputs 2 EMA lines. The Fast line in blue and the slow line in red. It can be added to the main chart area.

MD_BARSSINCE_EMACROSS_UP(FASTPERIOD,SLOWPERIOD)

These scripts calculate the number of bars since the last EMA cross. The scripts can be added to a chart sub area. They are also called from the MACD templates.

MD_MACD_DIVTOP(ZPCT,PPCT)/MD_MACD_DIVBOT(ZPCT,PPCT)

These scripts calculate MACD divergence tops and bottoms based on the ZIGZAG indicator configured with the ZPCT parameter. An event is generated whenever the double top/bottom is detected and the price between the two tops/bottoms is within the price % specified by PPCT and the difference in MACD between these two points is less than 0 (tops) or greater than 0 (bottoms).

MD_BARSSINCE_MACD_DIVTOP(ZPCT,PPCT)/ MD_BARSSINCE_MACD_DIVTOP(ZPCT,PPCT)

These scripts calculate the number of bars since the last MD_MACD_DIVTOP/MD_MACD_DIVBOT event

MD_Peak/MD_Trough

These scans generate an event whenever a peak/trough is detected based on the ZIGZAG indicator configured with the ZPCT parameter.

MD_BARSSINCE_PEAK(ZPCT)/ MD_BARSSINCE_TROUGH(ZPCT)

These scripts calculate the number of bars since the last MD_Peak/MD_Trough event.