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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.