OPEN-SOURCE SCRIPT
Strategy [High-Low Cloud Trend] (v6, perf-safe)

Description
High-Low Cloud Trend Strategy (Performance-Safe Edition)
Version 6 • RezzoRedPriest (based on the original logic by rottor29)
How it works
Dynamic range ― The script tracks the highest high / lowest low over a look-back of N bars (len). When price tags one extreme, a “pivot” flips to the opposite extreme, forming the core of the cloud.
Trend filter ― If the candle closes above the pivot, trend = bullish; below it, trend = bearish. The optional “Trade only with trend” switch forces longs in bullish mode and shorts in bearish mode.
Signals
Cloud Retest – price pulls back to the inner edge (band1) and rejects it.
Cloud Cross – price breaks through the outer edge (band).
Mean Reversion – spikes beyond the inner edge and snap back (optional).
Execution model – trades are processed once per bar (process_orders_on_close = true), capped at maxTradesPerDay.
Performance guardrails
Only the most-recent visBars bars are calculated and painted.
Object limits: max_labels_count = 400, max_lines_count = 30.
Inputs
Group Name Purpose
Display Drawings: show last N bars Hard cap for calculations & drawings (default = 500).
Display Show markers / labels Toggle all arrows / diamonds.
Display Show cloud fill & background Toggle the colored cloud & background.
Strategy Look-back period (len) Width of the cloud; larger = smoother trend.
Strategy Enable trading Completely turn trade logic on/off.
Strategy Take cloud-retest / cross / mean-reversion signals Select which setups feed the engine.
Strategy Trade only with trend Filter counter-trend signals.
Risk Max trades per day Hard daily cap.
Recommended use
Works on any timeframe; common sweet spots are 5 m & 15 m for liquid futures / FX.
Increase len for higher timeframes (e.g. 55–100 on 1 H) to avoid noise.
If your chart still lags, either:
Lower Drawings: show last N bars, or
Turn Show cloud fill off – the fill is the heaviest operation.
Disclaimer
This script is for educational purposes only and does not constitute financial advice. Always test on demo data first and use proper risk management.
High-Low Cloud Trend Strategy (Performance-Safe Edition)
Version 6 • RezzoRedPriest (based on the original logic by rottor29)
How it works
Dynamic range ― The script tracks the highest high / lowest low over a look-back of N bars (len). When price tags one extreme, a “pivot” flips to the opposite extreme, forming the core of the cloud.
Trend filter ― If the candle closes above the pivot, trend = bullish; below it, trend = bearish. The optional “Trade only with trend” switch forces longs in bullish mode and shorts in bearish mode.
Signals
Cloud Retest – price pulls back to the inner edge (band1) and rejects it.
Cloud Cross – price breaks through the outer edge (band).
Mean Reversion – spikes beyond the inner edge and snap back (optional).
Execution model – trades are processed once per bar (process_orders_on_close = true), capped at maxTradesPerDay.
Performance guardrails
Only the most-recent visBars bars are calculated and painted.
Object limits: max_labels_count = 400, max_lines_count = 30.
Inputs
Group Name Purpose
Display Drawings: show last N bars Hard cap for calculations & drawings (default = 500).
Display Show markers / labels Toggle all arrows / diamonds.
Display Show cloud fill & background Toggle the colored cloud & background.
Strategy Look-back period (len) Width of the cloud; larger = smoother trend.
Strategy Enable trading Completely turn trade logic on/off.
Strategy Take cloud-retest / cross / mean-reversion signals Select which setups feed the engine.
Strategy Trade only with trend Filter counter-trend signals.
Risk Max trades per day Hard daily cap.
Recommended use
Works on any timeframe; common sweet spots are 5 m & 15 m for liquid futures / FX.
Increase len for higher timeframes (e.g. 55–100 on 1 H) to avoid noise.
If your chart still lags, either:
Lower Drawings: show last N bars, or
Turn Show cloud fill off – the fill is the heaviest operation.
Disclaimer
This script is for educational purposes only and does not constitute financial advice. Always test on demo data first and use proper risk management.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.