OPEN-SOURCE SCRIPT
RSI Mean Reversion

This is classic Mean Reversion Strategy. I use this on commodities.
This strategy trades mean reversion signals based on the Relative Strength Index (RSI). It is designed for volatile, mean-reverting instruments where price tends to snap back after reaching extreme levels.
How it works:
The strategy enters a long position when RSI crosses back above the oversold level, signalling that the selling pressure is fading and price is beginning to recover. It enters a short position when RSI crosses back below the overbought level, signalling that buying pressure is weakening and price is starting to pull back. Positions are reversed — a long is closed when a short signal fires and vice versa.
Key feature: Signals trigger when RSI re-enters the normal channel from an extreme zone, not when it first enters the extreme zone. This provides confirmation that the reversal has begun rather than catching a falling knife.
Recommended usage: This strategy works best on volatile instruments that exhibit mean-reverting behaviour, such as Natural Gas futures on the 4-hour timeframe. A short RSI period (3-5) with oversold levels around 30-40 and overbought levels around 70-80 is a good starting point. Optimise the parameters for your specific instrument using backtesting.
Settings: RSI period, oversold level, overbought level, trade direction (Long Only / Short Only / Both), and bar confirmation toggle are all configurable from the settings panel. Alerts are built in for both buy and sell signals.
This strategy trades mean reversion signals based on the Relative Strength Index (RSI). It is designed for volatile, mean-reverting instruments where price tends to snap back after reaching extreme levels.
How it works:
The strategy enters a long position when RSI crosses back above the oversold level, signalling that the selling pressure is fading and price is beginning to recover. It enters a short position when RSI crosses back below the overbought level, signalling that buying pressure is weakening and price is starting to pull back. Positions are reversed — a long is closed when a short signal fires and vice versa.
Key feature: Signals trigger when RSI re-enters the normal channel from an extreme zone, not when it first enters the extreme zone. This provides confirmation that the reversal has begun rather than catching a falling knife.
Recommended usage: This strategy works best on volatile instruments that exhibit mean-reverting behaviour, such as Natural Gas futures on the 4-hour timeframe. A short RSI period (3-5) with oversold levels around 30-40 and overbought levels around 70-80 is a good starting point. Optimise the parameters for your specific instrument using backtesting.
Settings: RSI period, oversold level, overbought level, trade direction (Long Only / Short Only / Both), and bar confirmation toggle are all configurable from the settings panel. Alerts are built in for both buy and sell signals.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。