OPEN-SOURCE SCRIPT
Price Channel Breakout Strategy — Long & Short

This strategy is a dual-direction Price Channel breakout system designed for high-volatility indices such as US30, NAS100, and XAUUSD.
It enters long when price breaks above the highest high of the past N bars, and enters short when price breaks below the lowest low.
A key feature is the use of fixed dollar-based take-profit and stop-loss, making the strategy adaptive across symbols with different tick values.
Core Logic
Long entry when price breaks the N-bar high
Short entry when price breaks the N-bar low
Dollar-based TP and SL (converted to ticks automatically)
Suitable for trending and breakout-friendly markets
Backtest Notes (US30 Example)
Sharpe Ratio: 2.7
Profit Factor: 2.111
Total Return (12-month backtest): +46.89%
Max Drawdown: 0.26%
Trades: 3,666
This strategy performs well in sustained volatility environments and is particularly effective for intraday momentum bursts on US30.
It enters long when price breaks above the highest high of the past N bars, and enters short when price breaks below the lowest low.
A key feature is the use of fixed dollar-based take-profit and stop-loss, making the strategy adaptive across symbols with different tick values.
Core Logic
Long entry when price breaks the N-bar high
Short entry when price breaks the N-bar low
Dollar-based TP and SL (converted to ticks automatically)
Suitable for trending and breakout-friendly markets
Backtest Notes (US30 Example)
Sharpe Ratio: 2.7
Profit Factor: 2.111
Total Return (12-month backtest): +46.89%
Max Drawdown: 0.26%
Trades: 3,666
This strategy performs well in sustained volatility environments and is particularly effective for intraday momentum bursts on US30.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.