Bullish Bar Closing above 2 Bearish Bar and vice versa
Forums › ProRealTime English forum › ProBuilder support › Bullish Bar Closing above 2 Bearish Bar and vice versa
- This topic has 22 replies, 3 voices, and was last updated 4 years ago by robertogozzi.
-
-
07/21/2020 at 2:25 PM #139754
Many thanks Robert. However it is still missing some signals as enclosed.
Regards,
07/21/2020 at 3:29 PM #139771The bar you marked as MISSESD, because you asked “bullish bar should close above the highest high of the previous 2 bearish bars (they (bullish and/ or bearish) may not be consecutive and the last bearish bar’s high should be lower than the previous bearish bar’s high ignoring the inside bar in between is any)“.
Which isn’t. The last bearish bar’s HIGH was HIGHER than the previous one!
07/22/2020 at 8:40 AM #139800Hello Robert,
In that case the last bearish bar’s high when compared with the 3rd bearish bar (previous), it is low. Hence it should be considered for the signal. Similarly for the opposite.
Example for NEXTDC Ltd (ticker: NXT) the 17-Jul daily bar should be a signal as its close is higher than the high of the 3rd bearish bar as shown in the enclosed.
07/22/2020 at 11:40 AM #139821In that case the last bearish bar’s high when compared with the 3rd bearish bar (previous), it is low.
the last bearish bar’s high should be lower than the previous bearish bar’s high ignoring the inside bar in between is any
Which one of the two rules shall be applied?
07/22/2020 at 1:05 PM #139846This is the paradox dear. Market does not always print as per our codes. My only intention is to capture the entire move, as much as possible and that is why I tried it with if statements which is capable of capturing all the variations. You are also right, however it would be better, for the time being, to follow in addition to existing codes, “the last bearish bar’s high when compared with the 3rd bearish bar (previous), it is low. Hence it should be considered for the signal. Similarly for the opposite.”
07/23/2020 at 12:36 AM #139934There you go (not tested):
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970DEFPARAM CalculateOnLastBars = 1000Bullish = close > openBearish = close < openInsideBAR = (range < range[1]) AND (high <= high[1]) AND (low >= low[1])//// DOWN trend detection//Count1 = 0i = 0WHILE Count1 < 3 AND i < BarIndexi = i + 1IF Count1 = 0 THENIF Bullish[i] AND Not InsideBAR[i] THENCount1 = 1MyLO1 = low[i]ENDIFELSIF Count = 1 THENIF Bullish[i] AND Not InsideBAR[i] THENCount1 = 2ENDIFELSEIF Bullish[i] AND Not InsideBAR[i] THENCount2 = 3MyLO2 = low[i]d1 = MyLO1 > MyLO2MyLO2 = min(MyLO1,MyLO2)BreakENDIFENDIFWENDd2 = Bearishd3 = close < MyLO2Dcond = d1 AND d2 AND d3//// UP trend detection//Count2 = 0j = 0WHILE Count2 < 3 AND j < BarIndexj = j + 1IF Count2 = 0 THENIF Bearish[j] AND Not InsideBAR[j] THENCount2 = 1MyHI1 = high[j]ENDIFELSIF Count2 = 1 THENIF Bearish[j] AND Not InsideBAR[j] THENCount2 = 2ENDIFELSEIF Bearish[j] AND Not InsideBAR[j] THENCount2 = 3MyHI2 = high[j]u1 = MyHI1 < MyHI2MyHI2 = max(MyHI1,MyHI2)BreakENDIFENDIFWENDu2 = Bullishu3 = close > MyHI2Ucond = u1 AND u2 AND u3//Cond = 0IF Ucond THENCond = 1ELSIF Dcond THENCond = -1ENDIFRETURN Cond AS "Signal"07/23/2020 at 2:18 PM #139971Many thanks Robert, however it is missing many signals as enclosed.
07/23/2020 at 2:51 PM #139976You asked me that you no longer check the last two bearish bars, but the last one and the second previous one (the last one and the thirs one).
When you want to check the last bars + the third one use the last version, if you want to use the last 2 bars (in both cases ignoring Inside bars) the use the previous version.
-
AuthorPosts
Find exclusive trading pro-tools on