Hello,
Few days ago I found a great candlestick patterns indicator, but I have a really stupid problem with it and I don't know how to fix it. The problem is that it shows some patterns with 1 candle delay. For example:
The "Morning Star Doji" pattern appears with 1 bar delay - not immediately after candle close. The shift parameter is responsible for that, but when I change it from shift=2 to shift=1 it moves the signal with arrows and text by 1 candle to the right from the original place. I want to leave it on it's original place and I want the signal to appear right after candle close - not with 1 bar delay. How to fix that?
Below you can see a code for the "Doji" pattern. There is no problem with it - signal appears immediately after candle close without any delays.
Please help, because I have no idea how to make it work. I've seen similar indicators which are working without any problems, but for some reason it's not working in my indicator...
Thanks in advance :-)
Few days ago I found a great candlestick patterns indicator, but I have a really stupid problem with it and I don't know how to fix it. The problem is that it shows some patterns with 1 candle delay. For example:
Inserted Code
// Check for Morning Star Doji if (Display_Morning_Stars_MDS == true) { if ( (L1<L2||L1<L) && C>O && ((L1<=L2)&&(L1<=L3)&&(L1<=L4)&&(L1<=L5)&&(L1<=L6)&&(L1<=L7)&&(L1<=L8)) || ((BodyLow2<(BodyLow3+3*point))&&(L2<=L3)&&(L2<=L4)&&(L2<=L5)&&(L2<=L6)&&(L2<=L7)&&(L2<=L8)&&(L2<=L9)) && (C2<O2) && (O1<=(C2+3*point)) && (O>=(C1-3*point)) && (C1<=(C2+3*point)) ) { if ( (C>(C2+BL903*Star/100)) && (BL902==0 || BL902==1*point || BL902<=CL1/Doji) ) { ObjectCreate(GetName("MDS",shift), OBJ_TEXT, 0, Time[shift2], Low[shift2] - 0.7*Range*gap); ObjectSetText(GetName("MDS",shift), "MDS", Text, "Times New Roman", Color_MDS); CumOffset = CumOffset+IncOffset; upArrow[shift2] = Low[shift2] - 0.3*Range*gap; } if (Show_MDS_Alert) { if (shift == 0 && Show_Alert == true) { pattern="Morning Star Doji"; setalert = 1; } } } }
The "Morning Star Doji" pattern appears with 1 bar delay - not immediately after candle close. The shift parameter is responsible for that, but when I change it from shift=2 to shift=1 it moves the signal with arrows and text by 1 candle to the right from the original place. I want to leave it on it's original place and I want the signal to appear right after candle close - not with 1 bar delay. How to fix that?
Below you can see a code for the "Doji" pattern. There is no problem with it - signal appears immediately after candle close without any delays.
Inserted Code
// Check for Bullish Doji if (Display_Doji_D == true) { if ( (L<=BodyLow2 && L<=BodyLow3 && L<=BodyLow4 && L<=BodyLow5 && L<=BodyLow6 && L<=BodyLow7 && L<=BodyLow8 && L<=BodyLow9 && L<=BodyLow10 && H<=H1||L<=L1 && H<=H2||L<=L2) || (L1<=BodyLow3 && L1<=BodyLow4 && L1<=BodyLow5 && L1<=BodyLow6 && L1<=BodyLow7 && L1<=BodyLow8 && L1<=BodyLow9 && L1<=BodyLow10 && L1<=BodyLow11 && H1<=H2||L1<=L2 && H1>=H||L1>=L)) { if (BL90==0 || BL90==1*point || BL90<=CL/Doji && UW>CL/10 && LW>CL/10) { ObjectCreate(GetName("D",shift), OBJ_TEXT, 0, Time[shift1], Low[shift1] - 1*Range*gap); ObjectSetText(GetName("D",shift), "D", Text, "Times New Roman", Colorl_D); CumOffset = CumOffset+IncOffset; upArrow[shift1] = Low[shift1] - 0.3*Range*gap; } if (Show_D_Alert) { if (setalert == 0 && Show_Alert == true) { pattern = "Doji"; setalert = 1; } } } } if (Display_Doji_D == true) { if ((BL90==0 || BL90==1*point || BL90<=CL/Doji) && UW<=CL/11) { ObjectCreate(GetName("dD",shift), OBJ_TEXT, 0, Time[shift1], Low[shift1] - 1*Range*gap); ObjectSetText(GetName("dD",shift), "dD", Text, "Times New Roman", Colorl_D); CumOffset = CumOffset+IncOffset; upArrow[shift1] = Low[shift1] - 0.3*Range*gap; } if (Show_D_Alert) { if (setalert == 0 && Show_Alert == true) { pattern = "Doji"; setalert = 1; } } }
Please help, because I have no idea how to make it work. I've seen similar indicators which are working without any problems, but for some reason it's not working in my indicator...
Thanks in advance :-)
Trade or not to trade - that is the question...