OPEN-SOURCE SCRIPT
RCI Strategy [PineIndicators]

RCI Strategy [PineIndicators]
This strategy leverages the Rank Correlation Index (RCI) — a statistical oscillator that measures the relationship between time and price rank — combined with a configurable moving average filter. It offers clean, rule-based entries and exits, and visually enhanced trade tracking via labeled markers and boxes on the chart.
The RCI Strategy is well-suited for momentum traders looking to capture directional shifts with confirmation through RCI smoothing.
Core Logic
1. Rank Correlation Index (RCI)
2. RCI Smoothing via Moving Average
Trade Entry Logic
Visual Features
RCI Panel Display
Trade Labels on Chart
Trade Visualization Boxes
Customization Parameters
Use Cases
Conclusion
The RCI Strategy [PineIndicators] is a non-repainting, rule-based trading model that combines rank correlation momentum with smoothed trend logic. Its clean visual markers, labeled trades, and flexible MA filters make it a valuable tool for discretionary and systematic traders alike.
This strategy leverages the Rank Correlation Index (RCI) — a statistical oscillator that measures the relationship between time and price rank — combined with a configurable moving average filter. It offers clean, rule-based entries and exits, and visually enhanced trade tracking via labeled markers and boxes on the chart.
The RCI Strategy is well-suited for momentum traders looking to capture directional shifts with confirmation through RCI smoothing.
Core Logic
1. Rank Correlation Index (RCI)
- Measures how closely price changes correlate with time rankings.
- Values range between -100 and +100.
- Thresholds at ±80 help identify potential reversals or extremes.
2. RCI Smoothing via Moving Average
- A moving average (MA) is applied to the RCI to smooth out fluctuations.
- Supported MA types:
SMA
EMA
SMMA (RMA)
WMA
VWMA - Users can disable the smoothing by selecting "None".
Trade Entry Logic
- Long Entry: RCI crosses above the selected moving average.
- Short Entry: RCI crosses below the moving average.
- Entries are restricted by trade direction settings:
- Long Only
- Short Only
- Long & Short
- Long Only
Visual Features
RCI Panel Display
- Plots RCI line and its moving average in a separate pane.
- Horizontal guide lines at 0, +80, and -80 help visualize signal zones.
Trade Labels on Chart
- Buy Label: Plotted when a long entry is executed.
- Close Label: Plotted when any position is closed.
- Triangle markers for visual emphasis on direction change.
Trade Visualization Boxes
- A colored box is drawn between entry and exit prices.
- Green = profitable trade; Red = losing trade.
- Two horizontal lines connect entry and exit prices for reference.
Customization Parameters
- RCI Source: Select input price for the RCI (default: close).
- RCI Length: Set sensitivity of the oscillator.
- MA Type and Length: Choose and configure the smoothing filter.
- Trade Direction Mode: Define whether to allow Long, Short, or both.
Use Cases
- Swing traders who want to trade directional reversals with statistical backing.
- Traders seeking a clean and visual strategy based on rank momentum.
- Environments where both trend and range dynamics occur.
Conclusion
The RCI Strategy [PineIndicators] is a non-repainting, rule-based trading model that combines rank correlation momentum with smoothed trend logic. Its clean visual markers, labeled trades, and flexible MA filters make it a valuable tool for discretionary and systematic traders alike.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。