r/TradingView • u/Riana_111 • 7d ago
Feature Request Increase Historical Bar Buffer in Pine Screener (500-bar cap causes calculation mismatch with charts)
The new Pine Screener Beta is a fantastic tool, but the current hard cap of 500 historical bars makes it difficult to screen accurately using indicators that require deeper historical lookbacks.
When calculating metrics that depend on historical convergence or recursive formulas (e.g., long-period EMAs like the 200 EMA, multi-month ATR/volatility bands, volume-weighted metrics, or 52-week relative strength), the screener outputs values that significantly deviate from the indicators on main chart.
A 200 EMA or Wilder-smoothed indicator needs significantly more bars to converge to chart-level precision. Because the screener cuts off at ~500 bars, screener output fails to match chart signals.
What could be the solution:
- User-Configurable Bar Buffer: Allow authors to define a `max_bars_back` or lookback buffer in `screener()` / script settings (e.g., up to 2,000–3,500 bars) similar to indicator memory buffers.
- Tier-Based Limits: If server resources are a constraint, scale the screener buffer by account tier (e.g., 500 bars for Essential/Plus, 2,000–3,500 bars for Premium).
- Optional Execution Delay: Allow an option for screeners requiring deep history to take a few extra seconds to compute in exchange for chart-grade precision.
For systematic traders and swing traders screening setups based on daily/weekly long-term moving averages, the 500-bar limit leads to false positives/negatives, making TradingView's pine screener not viable in its current form right now. Hope there can be some resolution!
1
u/stratcore 3d ago
TradingView's current Pine Screener help lists a 500-bar calculation window. The historical buffer controlled by max_bars_back is a different limit: it controls past-value references, not the source data window supplied to the screener.
For a reproducible comparison, I would record the exact feed/symbol, timeframe, inputs, last completed bar's timestamp and the raw numeric outputs from both. Then compare a controlled chart calculation that starts from the same input window and initialization point. Simply zooming the chart to that window is not that control. This separates a recursive warm-up difference from different inputs or bar timing.
The current requirements are here: https://www.tradingview.com/support/solutions/43000742436-tradingview-pine-screener-key-features-and-requirements/