The Expert Advisor opens a deal in the breakout direction — the breakout level should be set manually. It is possible to configure the EA to trade only Buy or only Sell:
Breakout is determined based on the Close prices of the first and second bar. Upward breakout condition:
//--- Buy if(iClose(1)>AppPrice && iClose(2)<=AppPrice)
Downward breakout condition:
//--- Sell if(iClose(1)<AppPrice && iClose(2)>=AppPrice)
The Expert Advisor calculates the lot value dynamically depending on the specified risk percent of free margin.
Translated from Russian by MetaQuotes Software Corp.
Original code: https://www.mql5.com/ru/code/17582
An ExpertAdvisor based on the T3MA-ALARM indicator.XCHV_HTF
The XCHV indicator with the timeframe selection option available in the input parameters.