OPEN-SOURCE SCRIPT
已更新 Volatility Breakout System [Fixed Risk]

[Description]
This is a trend-following breakout strategy designed to capture volatility expansion while filtering out low-momentum "chop." It is built on the philosophy that significant price moves are often preceded by a breakout of volatility bands (Keltner Channels) accompanied by Volume and Trend Strength (ADX).
Strategy Logic:
Volatility Breakout: The primary trigger is a candle closing outside the Keltner Channels. This indicates price is moving faster than the average range.
Trend Filter: Trades are only taken in the direction of the 200 EMA.
Momentum Filter (ADX): The ADX filter ensures we only enter when the trend strength is above a specific threshold (Default: 20). This prevents the strategy from buying tops or selling bottoms in ranging markets.
Volume Confirmation: A breakout without volume is often a fake-out. This script requires volume to be higher than the moving average.
Risk Management (Automated):
Stop Loss: Based on ATR (Average True Range) to adapt to current market volatility.
Trailing Stop: Once the trade moves in favor, a trailing stop is activated to lock in profits.
Breakeven: If price moves X% in favor, the Stop Loss is automatically moved to the entry price to protect capital.
Cooldown: Includes a safety mechanism to prevent over-trading immediately after a signal.
Backtesting Notes:
This script is set up with use_bar_magnifier=true. For accurate results, use this on higher timeframes (1H, 4H) or ensure you have a Premium account for intrabar inspection.
Inputs:
You can toggle the "Compounding" feature to test fixed cash vs. % equity growth.
Webhooks are fully configurable for alert automation.
This is a trend-following breakout strategy designed to capture volatility expansion while filtering out low-momentum "chop." It is built on the philosophy that significant price moves are often preceded by a breakout of volatility bands (Keltner Channels) accompanied by Volume and Trend Strength (ADX).
Strategy Logic:
Volatility Breakout: The primary trigger is a candle closing outside the Keltner Channels. This indicates price is moving faster than the average range.
Trend Filter: Trades are only taken in the direction of the 200 EMA.
Momentum Filter (ADX): The ADX filter ensures we only enter when the trend strength is above a specific threshold (Default: 20). This prevents the strategy from buying tops or selling bottoms in ranging markets.
Volume Confirmation: A breakout without volume is often a fake-out. This script requires volume to be higher than the moving average.
Risk Management (Automated):
Stop Loss: Based on ATR (Average True Range) to adapt to current market volatility.
Trailing Stop: Once the trade moves in favor, a trailing stop is activated to lock in profits.
Breakeven: If price moves X% in favor, the Stop Loss is automatically moved to the entry price to protect capital.
Cooldown: Includes a safety mechanism to prevent over-trading immediately after a signal.
Backtesting Notes:
This script is set up with use_bar_magnifier=true. For accurate results, use this on higher timeframes (1H, 4H) or ensure you have a Premium account for intrabar inspection.
Inputs:
You can toggle the "Compounding" feature to test fixed cash vs. % equity growth.
Webhooks are fully configurable for alert automation.
版本注释
[Description]This is a trend-following breakout strategy designed to capture volatility expansion while filtering out low-momentum "chop." It is built on the philosophy that significant price moves are often preceded by a breakout of volatility bands (Keltner Channels) accompanied by Volume and Trend Strength (ADX).
Strategy Logic:
Volatility Breakout: The primary trigger is a candle closing outside the Keltner Channels. This indicates price is moving faster than the average range.
Trend Filter: Trades are only taken in the direction of the 200 EMA.
Momentum Filter (ADX): The ADX filter ensures we only enter when the trend strength is above a specific threshold (Default: 20). This prevents the strategy from buying tops or selling bottoms in ranging markets.
Volume Confirmation: A breakout without volume is often a fake-out. This script requires volume to be higher than the moving average.
Risk Management (Automated):
Stop Loss: Based on ATR (Average True Range) to adapt to current market volatility.
Trailing Stop: Once the trade moves in favor, a trailing stop is activated to lock in profits.
Breakeven: If price moves X% in favor, the Stop Loss is automatically moved to the entry price to protect capital.
Cooldown: Includes a safety mechanism to prevent over-trading immediately after a signal.
Backtesting Notes:
For accurate results, use this on higher timeframes (1H, 4H) or ensure you have a Premium account for intrabar inspection and bar magnifier on.
Inputs:
You can toggle the "Compounding" feature to test fixed cash vs. % equity growth.
Webhooks are fully configurable for alert automation.
版本注释
How to set up Separate Long/Short Alerts:I have updated the script to support two ways of creating alerts.
Option 1: The "One Alarm" Method (Easiest)
1.Click "Add Alert" on the chart.
2.Select the Strategy name in the Condition box.
3.Select "Order Fills Only" (Important!).
4.In the message box, type: {{strategy.order.alert_message}}
The script will automatically send the correct "Long" or "Short" message based on what is typed in the Strategy Settings inputs.
Option 2: The "Separate Alarms" Method
If your bot requires 4 separate webhooks:
1.Click "Add Alert".
2.In the Condition box, select the Strategy Name.
3.Change "Order Fills Only" to the specific alert name (e.g., "EXECUTE: Long Entry").
4.Paste your specific Long Entry Webhook message.
5.Repeat this 4 times (for Long Entry, Long Exit, Short Entry, Short Exit).
版本注释
How to set this up for your Bank/Bot:Add the script to your chart.
Click the "Alert" (Clock) icon on the right sidebar.
Click "Create Alert".
In the "Condition" dropdown, select the name of this script.
Crucial Step: In the next dropdown, DO NOT select "Order Fills Only". Instead, you will now see these options:
EXECUTE: Long Entry
EXECUTE: Long Exit
EXECUTE: Short Entry
EXECUTE: Short Exit
Select "EXECUTE: Long Entry".
Paste your Webhook URL and your JSON Message for buying.
Click Create.
Repeat steps 2-8 for "Long Exit", "Short Entry", and "Short Exit".
This method gives you 4 completely separate alerts that you can control individually.
版本注释
Update: Added Live Visual Dashboards & MTF Trend ScannerDescription:
I have updated the script to include two visual dashboards to assist with manual confirmation of trades.
Changes in this version:
Added Indicator Panel: Shows live RSI, ADX, and DMI values in the bottom-right corner.
Added Trend Dashboard: Shows the EMA trend bias (Bullish/Bearish) for timeframes ranging from 1M to Monthly in the bottom-left corner.
Stability Fixes: Improved the code to prevent tables from disappearing and fixed calculation errors on assets with limited historical data.
Strategy logic remains unchanged.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。