The Expert Advisor doesn't generate the deals independently, but is a "helper" designed to control positions' state. This Expert Advisor is a kind of a simplified variation of the Expert Advisor described in the article about processing of the events, with the difference that the OnTradeTransaction() function is used and there is a processing of triggering of Stop Loss and Take Profit.
It should be considered that the Expert Advisor can send email in correct corresponding configurations. If sending mail to the terminal is prohibited, the Expert Advisor will output alerts. There are a few important moments:
Set up:
Parameters:
Here are the results in the journal (output language parameter was changing at the same time):

MetaQuotes Ltd tarafından Rusçadan çevrilmiştir.
Orijinal kod: https://www.mql5.com/ru/code/1512
BollingerBands©
The indicator to determine the trend reversals on the basis of Bollinger Bands
RAVI_FX_Fisher
The unnormalized oscillator using Fisher Transform
Ma_Distance_From_Price
A semaphore signal indicator for the moments when the trend force measured by the deviation of the price from the Moving Average is higher than a fixed limit
Divergence
The indicator displays the situation when the direction of price movement and technical indicators does not coincide