OPEN-SOURCE SCRIPT
Strong Engulfing

This indicator marks outside bars that both swept the previous
bar's extreme and closed away from it, near their own end.
How it works
A bar qualifies on the long side when all four conditions hold:
1. Its low trades below the previous bar's low.
2. It closes above the previous bar's body top.
3. Its high trades above the previous bar's high.
4. Its close lands in the top third of its own range,
measured as (high - close) / (high - low).
The short side applies the mirror of each condition.
Conditions 1 and 3 together mean the previous bar sits entirely
inside the marked bar. Condition 4 is expressed as a ratio of
the bar's own range rather than in points, so the threshold
carries the same meaning across symbols and timeframes.
What separates this from a plain engulfing
A standard engulfing pattern only compares bodies, so a bar can
qualify without ever trading below the previous low. Requiring
that sweep in condition 1 excludes bars that expanded upward
without first reaching below the previous bar's extreme. The
close-position filter in condition 4 further excludes outside
bars that gave most of their range back before the close.
Evaluation timing
All conditions are checked with barstate.isconfirmed, so marks
are placed on closed bars only and never appear intrabar and
then disappear.
Settings
- Long side / Short side: enable each direction independently.
- Arrows: show or hide the triangle markers, with a color for
each side.
- Paint the signal candle: recolors the body of the qualifying
bar. Border and wick keep the colors from the chart's own
candle settings, which Pine cannot override on the main
series.
The close-position threshold is fixed at one third and is not
exposed as an input, since it forms part of the pattern
definition rather than a tuning parameter.
Alerts
Two conditions are available, one per side, each firing on the
close of a qualifying bar.
This script is for chart analysis only and is not investment
advice.
bar's extreme and closed away from it, near their own end.
How it works
A bar qualifies on the long side when all four conditions hold:
1. Its low trades below the previous bar's low.
2. It closes above the previous bar's body top.
3. Its high trades above the previous bar's high.
4. Its close lands in the top third of its own range,
measured as (high - close) / (high - low).
The short side applies the mirror of each condition.
Conditions 1 and 3 together mean the previous bar sits entirely
inside the marked bar. Condition 4 is expressed as a ratio of
the bar's own range rather than in points, so the threshold
carries the same meaning across symbols and timeframes.
What separates this from a plain engulfing
A standard engulfing pattern only compares bodies, so a bar can
qualify without ever trading below the previous low. Requiring
that sweep in condition 1 excludes bars that expanded upward
without first reaching below the previous bar's extreme. The
close-position filter in condition 4 further excludes outside
bars that gave most of their range back before the close.
Evaluation timing
All conditions are checked with barstate.isconfirmed, so marks
are placed on closed bars only and never appear intrabar and
then disappear.
Settings
- Long side / Short side: enable each direction independently.
- Arrows: show or hide the triangle markers, with a color for
each side.
- Paint the signal candle: recolors the body of the qualifying
bar. Border and wick keep the colors from the chart's own
candle settings, which Pine cannot override on the main
series.
The close-position threshold is fixed at one third and is not
exposed as an input, since it forms part of the pattern
definition rather than a tuning parameter.
Alerts
Two conditions are available, one per side, each firing on the
close of a qualifying bar.
This script is for chart analysis only and is not investment
advice.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
