ENVO HQ
Command Center
Thursday, April 2
0
Projects
0
Agents
βœ—
Gateway
0%
Live
10:12 PM
ENVO HQ
← Docs
concepts/indicator-audit-envo-v2_2

Indicator Audit β€” EnvoTrades Smart Signals V2.2

Updated: 2/25/2026, 9:58:32 AM
tradingviewpineauditsystems

Scope

Audit of the Pine Script you sent (indicator + alerts). Focus: correctness, non-repainting behavior, and backtestability.

Critical issues (fix first)

  1. Repainting / forward-looking HTF data
  • Your request.security(..., lookahead=barmerge.lookahead_on) is used everywhere.
  • That can leak future HTF bar information into the current LTF bar and make signals look better than they are.
  • Fix: use barmerge.lookahead_off and handle the β€œHTF bar just closed” logic explicitly.
  1. RSI divergence toggle bug
  • check_rsi_divergence() returns true when use_rsi_divergence is false.
  • That means the divergence filter is effectively bypassed, but the function name implies it should be a conditional filter.
  • Fix: if disabled, return true (so it doesn’t block) but the current function initializes result=false, then flips to true in the else at the very end. It’s confusing and risky.
  1. Spread filter is not a spread filter
  • estimated_spread = (high - low) / mintick is the current bar’s range, not broker spread.
  • This will block trades on large candles and allow trades on small candles regardless of actual spread.
  • Fix: either remove it or rename it to β€œmax candle range filter” to avoid false confidence.
  1. DST input unused
  • use_dst_adjustment is defined but not used.
  1. Pine version mismatch
  • Header says //@version=6 but TradingView stable Pine is v5 for most users. If you’re not on v6 beta, this won’t run.

Risk/ops notes

  • accountNumber is hard-coded in inputs. It’s not β€œsecret” like a password, but treat it as sensitive ops config.

Recommendations aligned to your goals (B consistency + C R:R)

  • Make the script strictly non-repainting (lookahead off, barstate.isconfirmed as you already do).
  • Add a signal frequency limiter (max signals/day/session) to improve consistency.
  • Add a cooldown (e.g., N bars after a signal) to reduce churn.
  • Convert to a strategy() version for honest backtests with your SL/TP logic.

Next steps

  1. Confirm markets/TFs to optimize first (pick 1–2): XAUUSD 5m? US30 5m? NQ 5m?
  2. Confirm sessions: your NY session input is 08:00–11:00 ET; is that intended vs 09:30–11:00?
  3. Decide: do you want this indicator to remain β€œsignals only”, or should we ship a paired Strategy script for backtesting?
Files are read from second-brain/brain/ on your machine.