Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 5 Expert Advisor | Candle shadow percent

MetaTrader Experts, Indicators, Scripts and Libraries

The Expert Advisor is based on the indicator with the same name Candle shadow percent. Lot is calculated based on the risk value as a percentage of free margin.

Attention: in this Expert Advisor, it is assumed that the Candle shadow percent indicator is located in the \Indicators\MyInd\Candels\ folder, which is clear from OnInit()

   m_money.Percent(Risk);
//--- create handle of the custom indicator
   handle_iCustom=iCustom(m_symbol.Name(),Period(),"MyInd\\Candels\\Candle shadow percent",
                          __1__,

You will need to edit the path to the Candle shadow percent indicator in OnInit, if it is located in another folder.

The Expert Advisor only performs actions at the moment of a new emergence, and it does not work inside the bar. 

Position opening conditions:

  • if the value of the "Candle shadow percent" indicator on the bar indexed 1 in the 0 buffer ("BufferTop") is not equal to zero, i.e. an there is an arrow on this bar, Sell will be opened
  • if the value of the "Candle shadow percent" indicator on the bar indexed 1 in the 1 buffer ("BufferLow") is not equal to zero, i.e. an there is an arrow on this bar, Buy will be opened

Recommendations for debugging: first adjust parameters only for the upper shadow, then only for the lower shadow.

17940

Best MetaTrader Indicators + Profitable Expert Advisors