For the complete documentation index, see llms.txt. This page is also available as Markdown.

MACD

MACD calculates the difference between two moving averages, the signal line and the histogram. In the ISignal constructor, you can choose one of the four signal conditions and use it for entry or exit.

Fill in the period

Add the MACD to the block you want. The instrument is out of the question. Select The TF and Candle Type, then fill in the periods of fast, slow and signal moving averages.

Each period is set to an integer between 2 and 50 bars. The default values of the new card are 12, 26 and 9, respectively. It's the basic interface settings, not the recommendation.

Select Calculation in the Bar Closing or Intersection (secondly). In the second case, the bar is checked. Its meanings may change before closing.

Select the condition

The following directions are shown when the Reverse is turned off.

Intersection of MACD and signal line

A long signal is generated when the MACD moves down to or above the signal line. Short when MACD moves from above to below the line. The previous value must be strictly on the other side.

Cross-referencing of MACD and zero

Long signal: the previous MACD value was below zero, current is zero or higher. Short: the previous one was above zero, the current one is zero or lower.

By the growth of the histogram

The long signal appears at the beginning of the site, where the histogram is undeniable and its value increases. Short at the beginning of the plot where the histogram is negative and its value decreases or remains the same. No new signal is generated to continue the same route.

By reducing the histogram

The long signal appears at the beginning of the site where the histogram is negative, but its value increases to zero. Short at the beginning of the plot where the histogram is non-negative and its value decreases or remains the same. Continuing the same state doesn't create a new signal.

For the conditions of the histogram, three consecutive values are compared: current and two previous ones. Focus on the sign and change of value; the color of the column in another chart may indicate a different setting.

Check the entry or exit

The reverse switch changes the direction of the signals in places. The signal must be in line with the task. In the reverse-free exit block, the short signal is used to close the long, the long to close the short.

To exit, select the action in the When the signal is received field. The deviation mode depends on the configuration and type of robot and does not guarantee profitable execution.

Keep the card and check the conditions of the task according to The ISignal instructions. The MACD filter is set by a separate card. The presence of a signal does not confirm the acceptance and execution of an order on the exchange.