Hi,
I have absolutely zero knowledge about coding. Therefore I need some help which will take an experienced guy literally 3 minutes. Cristof wrote the code for the piercing pattern, which I attached.
It finds the piercing pattern, after it was confirmed by a third, a bullish candle.What I need is this code WITHOUT the candle that follows the piercing pattern. I would like to find the piercing pattern in “real time”, without having to wait for the third candle for confirmation.
As i mentioned, I assume it is pretty easy to adapt the existing code for somebody experienced, so I hope that you will find some time.
Thanks in advance
// Piercing pattern is a downtrend follow by a bullish candle
// that closes above 50% of the preceding bearish candle,
// that could indicate a reversal,
// this screener includes a fairly good confirmation of that pattern,
// it starts from a bullish candle, and it finds the pattern in the two previous candles
// @Cristofer (=
// V1
currentClose = Close
currentOpen = Open
// Bullish candle
c1 = currentOpen < currentClose
piercingHigh = High[1]
piercingClose = Close[1]
piercingOpen = Open[1]
piercingLow = Low[1]
// piercing is bullish
c2 = piercingClose > piercingOpen
bearishHigh = High[2]
bearishOpen = Open[2]
bearishClose = Close[2]
bearishLow = Low[2]
// is a bearish candle
c3 = bearishOpen > bearishClose
// lower high, lower low
c4 = bearishHigh > piercingHigh AND bearishLow > piercingLow
// piercing opens lower than bearish close
c5 = piercingOpen < bearishClose
// piercing closes above 50% level of the bearish candle
c6 = ((bearishOpen + bearishClose) / 2) < piercingClose AND piercingClose < bearishOpen
SCREENER[c1 AND c2 AND c3 AND c4 AND c5 AND c6]
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Thank you 🙂
This should do (not tested):
// Piercing pattern is a downtrend follow by a bullish candle
// that closes above 50% of the preceding bearish candle,
// that could indicate a reversal,
// this screener includes a fairly good confirmation of that pattern,
// it starts from a bullish candle, and it finds the pattern in the two previous candles
// @Cristofer (=
// V1
currentClose = Close
currentOpen = Open
// Bullish candle
c1 = 1 OR (currentOpen < currentClose)
piercingHigh = High[0]
piercingClose = Close[0]
piercingOpen = Open[0]
piercingLow = Low[0]
// piercing is bullish
c2 = piercingClose > piercingOpen
bearishHigh = High[1]
bearishOpen = Open[1]
bearishClose = Close[1]
bearishLow = Low[1]
// is a bearish candle
c3 = bearishOpen > bearishClose
// lower high, lower low
c4 = bearishHigh > piercingHigh AND bearishLow > piercingLow
// piercing opens lower than bearish close
c5 = piercingOpen < bearishClose
// piercing closes above 50% level of the bearish candle
c6 = ((bearishOpen + bearishClose) / 2) < piercingClose AND piercingClose < bearishOpen
SCREENER[c1 AND c2 AND c3 AND c4 AND c5 AND c6]
Roberto, thank you very much!!!