bool CCandlePattern::CheckPatternPiercingLine() { //--- Piercing Line if((Close(1)-Open(1)>AvgBody(1)) && // long white (Open(2)-Close(2)>AvgBody(1)) && // long black (Close(2)>Close(1)) && // close inside previous body<<< should be "(Close(1)>Close(2)", i think>>>
(Close(1)<Open(2)) && (MidOpenClose(2)<CloseAvg(2)) && // downtrend (Open(1)<Low(2))) // close inside previous body return(true); //--- return(false); }
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
bool CCandlePattern::CheckPatternPiercingLine()
{
//--- Piercing Line
if((Close(1)-Open(1)>AvgBody(1)) && // long white
(Open(2)-Close(2)>AvgBody(1)) && // long black
(Close(2)>Close(1)) && // close inside previous body <<< should be "(Close(1)>Close(2)", i think>>>
(Close(1)<Open(2)) &&
(MidOpenClose(2)<CloseAvg(2)) && // downtrend
(Open(1)<Low(2))) // close inside previous body
return(true);
//---
return(false);
}
there are logical errors in the CheckPatternMorningDoji() and CheckPatternEveningDoji() methods in the lines:
(AvgBody(2)<AvgBody(1)*0.1) && // body of the second doji candle (less than a tenth of the average body size)
и
(AvgBody(2)<AvgBody(1)*0.1) && // body of the second doji candle (less than a tenth of the average candle body size)
respectively.
Should be:
(MathAbs(Close(2)-Open(2))<AvgBody(1)*0.1) && // the body of the second doji candle (less than a tenth of the average body size)
и
(MathAbs(Close(2)-Open(2))<AvgBody(1)*0.1) && // body of the second doji candlestick (less than a tenth of the average candlestick body)
the same error has also appeared in "Class for working with candlestick patterns" https://www.mql5.com/en/code/291.
This isnt working on my computer how do i go about it? I try to compile and find 38 errors