An Expert Advisor opens position using two MACD indicators. It reverts the position in the case of loss. It uses a martingale with the limited number of doublings. The doublings can be disabled.
Input parameters:

Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/186
iCrossClose
The indicator allows to perform any arithmetic action with prices of two symbols and plot result on any other chart. It allows to calculate crosses (using multiplication and division), spread (subtract) or just to plot the other symbol's data on the chart.
Price Channel
There is a Price Channel indicator, but I don't like it, because it fills all the space between the upper and lower boundaries. This version of Price Channel looks like in MetaTrader 4.
ytg_Percent_Lot
The script calculates the number of lots to trade using the specified percentage of risk funds.
MedianPriceChart
It plots the bar-averaged price charts (median price).