Settings RSI Length: Number of bars for RSI calculation. (Default: 14) RSI Source: Price source for RSI (close, open, high, low). Overbought / Oversold Levels: For visual reference only (70/30 by default). Take Profit %: Percentage gain at which the strategy will close the position. (Default: 5%) Stop Loss %: (Optional) Percentage drop at which the strategy will stop out. (Default: 0%, i.e., disabled.) Best Practices Choose an Appropriate Timeframe
Depending on your trading style (day trading vs. swing trading), divergences might appear more or less frequently. You may get more whipsaws on lower timeframes, so always backtest on multiple timeframes before going live. Adjust Pivots
The number of bars used to confirm a pivot (in the script it’s set around 2–5 bars) can significantly affect the sensitivity. You can tweak those settings if you want fewer or more frequent divergences. Combine with Other Tools
Divergences can be powerful signals, but they’re not foolproof. This script works best if combined with other confluences such as support/resistance lines, volume analysis, or higher-timeframe trends. Paper Trade & Backtest
Always test any new strategy in a demo environment or with TradingView’s backtesting to see its historical performance, then forward-test in live market conditions with minimal risk. Risk Management
Since markets can move quickly, consider using the optional stop-loss parameter or external stop management. The hidden divergence exit can help reduce drawdowns, but no exit strategy is perfect. In Summary If you’re looking to trade RSI divergences automatically, this strategy simplifies the process by drawing and extending RSI trendlines, confirming entries on their break, and exiting trades at a fixed profit target or upon detecting a hidden divergence in the opposite direction. Customize the RSI settings, take-profit percentage, and (optionally) a stop loss to fit your preferences. Always remember to backtest thoroughly and employ sound risk management.
Script de código aberto
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
For quick access on a chart, add this script to your favorites — learn more here.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.