r/pinescript

Image 1 — Engulfing + RVOL in Pine v6: breakout/retest entries and what the volume grades actually showed
Image 2 — Engulfing + RVOL in Pine v6: breakout/retest entries and what the volume grades actually showed
Image 3 — Engulfing + RVOL in Pine v6: breakout/retest entries and what the volume grades actually showed
Image 4 — Engulfing + RVOL in Pine v6: breakout/retest entries and what the volume grades actually showed
▲ 36 r/pinescript+1 crossposts

Engulfing + RVOL in Pine v6: breakout/retest entries and what the volume grades actually showed

A trader asked for an engulfing strategy with volume confirmation and two ways to enter: a break of the previous candle’s high/low, or a retest of its range.

This as a free, open-source tool. You can find the script and the full testing write-up here:

Built it as a Pine v6 strategy. Here’s how it works:

  • Aggressive — default: entry one tick beyond the previous candle’s high/low. If the signal candle has already closed beyond that level, entry is at the next bar’s open.
  • Retest: a limit order halfway into the previous candle’s range.
  • Both: enables both entries and splits the setup’s risk budget equally between them.
  • Risk: stop beyond both candles, a 2R target, and default risk of 0.5% per setup.
  • Volume grading: Low / Medium / High, using relative volume against the previous 20 bars.

The interesting part was testing what those volume labels actually meant.

The request originally described low-, medium-, and high-probability setups. But the tests didn’t support treating those RVOL grades as win probabilities.

On OANDA:XAUUSD 4H, the 2025–26 development period was profitable, while a separate 2023–24 period lost with the same settings and trading-cost assumptions. The earlier period lost even before overnight financing. High-volume shorts were its biggest losing group.

That’s why the panel says “Volume strength only · Probability untested.” The grade describes the signal candle’s volume; these results don’t establish that a higher grade gives a better trade.

Retest entries also failed the research criteria I used, so they’re available as an option but disabled by default.

For those who have built similar strategies in Pine: how would you test whether RVOL adds predictive value to an engulfing setup? I’m particularly interested in comparisons against an unfiltered baseline, and how you handle the smaller samples after splitting trades by direction and volume grade.

Screenshot note: numbers beside the order marks are position sizes in oz, not profit. Some adjacent order labels overlap in the native TradingView chart.

u/Dependent-Ad6636 — 13 days ago