OPEN-SOURCE SCRIPT
RSI Strategy with Auto Tuner (PF)

# RSI Auto‑Tuner Strategy — How To Use
This document explains **how to use** the RSI Auto‑Tuner strategy. It intentionally avoids math and implementation details. Follow this as an operating guide.
---
## 1. What This Tool Is For
This strategy helps you:
* Discover **which RSI length works best** on a given ticker and timeframe
* Measure performance using **Profit Factor (PF)**
* Improve RSI performance on noisy markets by **transforming price first**
The auto‑tuner is a **research tool**, not a live trading signal generator.
---
## 2. Two Modes You Must Treat Differently
### Research Mode
Used to explore and discover parameters.
* Auto‑Tune: **ON**
* Parameters are allowed to change
* Results may look very good
* Overfitting risk is real
### Trading Mode
Used for forward testing or live trading.
* Auto‑Tune: **OFF**
* Parameters are fixed
* Behavior is stable and repeatable
* This is the only acceptable mode for live use
**Never trade live with Auto‑Tune enabled.**
---
## 3. Manual Mode (Trading Mode)
Use this after parameters are finalized.
Steps:
1. Set **Auto‑Tune = OFF**
2. Choose:
* Source (raw price or transformed price)
* RSI Length (manual, default 14)
* Oversold / Overbought levels
3. The strategy will:
* Enter long when RSI crosses up through Oversold
* Enter short when RSI crosses down through Overbought
* Flip positions on opposite signals
This mode is predictable and safe for forward testing.
---
## 4. Auto‑Tune Mode (Research Mode)
Use this to find optimal RSI lengths.
Steps:
1. Set **Auto‑Tune = ON**
2. Configure the search range:
* Minimum Length (default 5)
* Maximum Length (default 14)
* Step Size (default 1)
3. The strategy will:
* Internally simulate trades for each RSI length
* Track gross profit, gross loss, and trades
* Select the length with the highest Profit Factor
4. The best length is applied automatically
Auto‑Tune evaluates historical data only.
---
## 5. Using a Transform on Price (Critical)
RSI does **not** have to run on raw price.
You can significantly improve results by:
* Applying a **price transform** first
* Feeding the transformed series into the RSI Source input
Examples of transforms:
* Moving averages
* Low‑pass filters
* Butterworth filters
* Any smoother or denoiser
Why this works:
* Busy, wicky markets cause RSI to whipsaw
* Transforms remove micro‑noise
* RSI responds to structure instead of chaos
* Profit Factor often increases dramatically
Best practice:
* Auto‑tune on raw price
* Auto‑tune on transformed price
* Compare PF, trade count, and stability
---
## 6. Reading the Status Label
At the last bar, the on‑chart label shows:
* Whether Auto‑Tune is ON or OFF
* Whether candidates were built successfully
* Number of RSI lengths tested
* Best RSI length found
* Profit Factor and trade count
If Auto‑Tune is OFF, the label shows the manual length.
---
## 7. Recommended Workflow
1. Choose ticker and timeframe
2. Enable Auto‑Tune on **raw price**
3. Record best RSI length and PF
4. Enable Auto‑Tune on **transformed price**
5. Compare results
6. Lock parameters
7. Disable Auto‑Tune
8. Forward test
---
## 8. Warnings and Discipline
* High PF with few trades is unreliable
* Transforms can hide execution costs
* Always validate on a different period
* Auto‑Tune is a **lens**, not an edge
Treat this tool as a research microscope, not an autopilot.
This document explains **how to use** the RSI Auto‑Tuner strategy. It intentionally avoids math and implementation details. Follow this as an operating guide.
---
## 1. What This Tool Is For
This strategy helps you:
* Discover **which RSI length works best** on a given ticker and timeframe
* Measure performance using **Profit Factor (PF)**
* Improve RSI performance on noisy markets by **transforming price first**
The auto‑tuner is a **research tool**, not a live trading signal generator.
---
## 2. Two Modes You Must Treat Differently
### Research Mode
Used to explore and discover parameters.
* Auto‑Tune: **ON**
* Parameters are allowed to change
* Results may look very good
* Overfitting risk is real
### Trading Mode
Used for forward testing or live trading.
* Auto‑Tune: **OFF**
* Parameters are fixed
* Behavior is stable and repeatable
* This is the only acceptable mode for live use
**Never trade live with Auto‑Tune enabled.**
---
## 3. Manual Mode (Trading Mode)
Use this after parameters are finalized.
Steps:
1. Set **Auto‑Tune = OFF**
2. Choose:
* Source (raw price or transformed price)
* RSI Length (manual, default 14)
* Oversold / Overbought levels
3. The strategy will:
* Enter long when RSI crosses up through Oversold
* Enter short when RSI crosses down through Overbought
* Flip positions on opposite signals
This mode is predictable and safe for forward testing.
---
## 4. Auto‑Tune Mode (Research Mode)
Use this to find optimal RSI lengths.
Steps:
1. Set **Auto‑Tune = ON**
2. Configure the search range:
* Minimum Length (default 5)
* Maximum Length (default 14)
* Step Size (default 1)
3. The strategy will:
* Internally simulate trades for each RSI length
* Track gross profit, gross loss, and trades
* Select the length with the highest Profit Factor
4. The best length is applied automatically
Auto‑Tune evaluates historical data only.
---
## 5. Using a Transform on Price (Critical)
RSI does **not** have to run on raw price.
You can significantly improve results by:
* Applying a **price transform** first
* Feeding the transformed series into the RSI Source input
Examples of transforms:
* Moving averages
* Low‑pass filters
* Butterworth filters
* Any smoother or denoiser
Why this works:
* Busy, wicky markets cause RSI to whipsaw
* Transforms remove micro‑noise
* RSI responds to structure instead of chaos
* Profit Factor often increases dramatically
Best practice:
* Auto‑tune on raw price
* Auto‑tune on transformed price
* Compare PF, trade count, and stability
---
## 6. Reading the Status Label
At the last bar, the on‑chart label shows:
* Whether Auto‑Tune is ON or OFF
* Whether candidates were built successfully
* Number of RSI lengths tested
* Best RSI length found
* Profit Factor and trade count
If Auto‑Tune is OFF, the label shows the manual length.
---
## 7. Recommended Workflow
1. Choose ticker and timeframe
2. Enable Auto‑Tune on **raw price**
3. Record best RSI length and PF
4. Enable Auto‑Tune on **transformed price**
5. Compare results
6. Lock parameters
7. Disable Auto‑Tune
8. Forward test
---
## 8. Warnings and Discipline
* High PF with few trades is unreliable
* Transforms can hide execution costs
* Always validate on a different period
* Auto‑Tune is a **lens**, not an edge
Treat this tool as a research microscope, not an autopilot.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.