Join our fan page
Candle shadow percent - expert for MetaTrader 5
- Views:
- 5845
- Rating:
- Published:
- 2017.05.29 13:50
- Updated:
- 2018.02.27 12:48
- Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
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.
Translated from Russian by MetaQuotes Ltd.
Original code: https://www.mql5.com/ru/code/17940
The indicator finds candlesticks with a minimum or maximum shadow size. Limitation on the size of the candlestick body.
Candle ShadowThe indicator finds candlesticks without an upper or lower shadow. The indicator style is DRAW_ARROW.
The StrangeIndicator indicator with the timeframe selection option available in its input parameters.
CloseAllPositionsThe script closes all open positions on the current account.