OPEN-SOURCE SCRIPT
Mean Reversion Trading V1

Overview
This is a simple mean reversion strategy that combines RSI, Keltner Channels, and MACD Histograms to predict reversals. Current parameters were optimized for NASDAQ 15M and performance varies depending on asset. The strategy can be optimized for specific asset and timeframe.
How it works
Long Entry (All must be true):
1. RSI < Lower Threshold
2. Close < Lower KC Band
3. MACD Histogram > 0 and rising
4. No open trades
Short Entry (All must be true):
1. RSI > Upper Threshold
2. Close > Upper KC Band
3. MACD Histogram < 0 and falling
4. No open trades
Long Exit:
1. Stop Loss: Average position size x ( 1 - SL percent)
2. Take Profit: Average position size x ( 1 + TP percent)
3. MACD Histogram crosses below zero
Short Exit:
1. Stop Loss: Average position size x ( 1 + SL percent)
2. Take Profit: Average position size x ( 1 - TP percent)
3. MACD Histogram crosses above zero
Settings and parameters are explained in the tooltips.
Important
Initial capital is set as 100,000 by default and 100 percent equity is used for trades
This is a simple mean reversion strategy that combines RSI, Keltner Channels, and MACD Histograms to predict reversals. Current parameters were optimized for NASDAQ 15M and performance varies depending on asset. The strategy can be optimized for specific asset and timeframe.
How it works
Long Entry (All must be true):
1. RSI < Lower Threshold
2. Close < Lower KC Band
3. MACD Histogram > 0 and rising
4. No open trades
Short Entry (All must be true):
1. RSI > Upper Threshold
2. Close > Upper KC Band
3. MACD Histogram < 0 and falling
4. No open trades
Long Exit:
1. Stop Loss: Average position size x ( 1 - SL percent)
2. Take Profit: Average position size x ( 1 + TP percent)
3. MACD Histogram crosses below zero
Short Exit:
1. Stop Loss: Average position size x ( 1 + SL percent)
2. Take Profit: Average position size x ( 1 - TP percent)
3. MACD Histogram crosses above zero
Settings and parameters are explained in the tooltips.
Important
Initial capital is set as 100,000 by default and 100 percent equity is used for trades
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.