Repainting in TradingView

Fact checked by
Mike Christensen, CFOA
January 9, 2025
Repainting indicators redraw past signals making backtests unreliable. Learn to identify and avoid these misleading tools.

Imagine an indicator showing a buy signal on your chart, only for that signal to vanish or relocate after the market moves against you. This phenomenon is known as repainting, and it's more prevalent than many traders realize. In this post, you'll learn what causes repainting, how to identify it, and strategies to avoid its pitfalls.

What Causes Repainting?

Understanding the technical reasons behind repainting can help you avoid costly mistakes. Repainting primarily occurs when indicators use unavailable data at the time of a signal. Common causes include:

Using Future Data

Indicators might utilize future data points unknowingly:

  • Calculating using the close price of the current bar before it closes
  • Referencing future bars in calculations
  • Incorrectly using higher timeframe data

Misusing Pine Script Functions

Certain Pine Script functions can introduce repainting:

  • Security Functions: Poor parameter configuration can cause issues; use historical offsets and appropriate lookahead settings.

Dynamic Indicator Calculations

Some indicators recalibrate their history based on new data:

  • Indicators with dynamic lengths or adaptive calculations
  • Machine learning models retraining on fresh data
  • Zigzag indicators that redraw with new highs/lows

It's crucial to verify your indicators don't repaint before connecting them to any automation platform. TradersPost can reliably execute your trading signals across brokers like Alpaca, TradeStation, Tradier, and Interactive Brokers, but like any execution platform, it will faithfully execute whatever signals it receives - whether from reliable or repainting indicators.

Identifying Repainting Indicators

Recognizing repainting before it impacts your trading is crucial. Here's how you can spot them:

Visual Cues on Charts

Indicators that change positions or disappear suggest repainting:

  • Signals that appear perfect in hindsight but shift or vanish with new data
  • Trend lines and support/resistance levels that redraw themselves

Numerical Adjustments

Be wary of indicators altering values on closed bars:

  • RSI or moving average values shifting retrospectively
  • Oscillator readings adjusting after-the-fact

Testing for Repainting

To ensure your indicators don't repaint, perform thorough testing:

Replay Mode Verification

  1. Open the indicator on your chart.
  2. Enter replay mode (Alt + Shift + R).
  3. Step through bars one by one.
  4. Observe any changes in values on closed bars.

Real-world Testing

  1. Apply the indicator to your chart.
  2. Take screenshots of all signals.
  3. Record exact values and positions.
  4. Compare after 24-48 hours for any discrepancies.

TradersPost enhances this process by allowing seamless testing and automation of strategies once they are verified as non-repainting.

The Impact of Repainting on Trading

Repainting can severely affect trading performance:

Misleading Backtests

False signals inflate backtest results:

  • False Confidence: High win rates that don't hold up in live trading
  • Poor Entries/Exits: Signals that looked ideal but proved otherwise

Psychological Effects

Repainting often leads to emotional challenges:

  • Frustration over inconsistent results
  • Self-Doubt questioning one's ability to execute trades effectively

By reducing manual errors through automated execution, TradersPost helps alleviate some psychological stress from traders.

Best Practices to Avoid Repainting Pitfalls

Here are strategies to ensure reliability:

Use Proven Indicators

Rely on standard indicators known for stability:

  • RSI, MACD, Moving Averages
  • Open-source indicators vetted by the community

Test Thoroughly Before Trusting an Indicator

  1. Conduct replay mode testing.
  2. Use small positions initially.
  3. Track performance meticulously.

Understanding Pine Script basics can also help you identify potential coding issues leading to repainting.

Advanced Detection Techniques

For more serious traders seeking deeper insights:

Automated Testing Scripts

Use scripts that log historical values and compare them over time.

Third-party Validators and Custom Development

Employ services and developers to verify code integrity, ensuring no hidden repainting logic exists.

TradersPost's integration capabilities allow advanced users to automate these processes efficiently across multiple platforms and brokers.

Conclusion

Repainting is a hidden trap in technical analysis but understanding its mechanics equips you to avoid it effectively. Key takeaways include always verifying indicators thoroughly, maintaining a skeptical mindset towards overly optimistic results, and focusing on simple yet reliable strategies over complex ones prone to error.

By leveraging TradersPost's automated solutions, you ensure precise trade execution across connected brokers like Alpaca and Interactive Brokers, minimizing the risks associated with unreliable indicators.

As you navigate the complexities of trading algorithms, remember that verifying your tools is invaluable. Share your experiences with repainting indicators in the comments below—your insights could help fellow traders steer clear of costly mistakes!

Ready to automate your trading? Try a free 7-day account:
Try it for free ->