PROTECTED SOURCE SCRIPT

Moving Average / ATR Breakout Signal [ARTech]

61
Moving Average / ATR Breakout Signal [ARTech]

This indicator generates trend-following signals based on price breaking above or below a user-defined Moving Average (MA). It supports various MA types and lengths, while offering optional filters like ATR bands and breakout thresholds to enhance signal quality. The tool is designed to help traders detect momentum shifts with configurable confirmation logic and offers visual enhancements to help traders better interpret market conditions at a glance.

Key Features:

• Multi-Type Moving Average Support: Choose from various Moving Average types including EMA, SMA, Hull MA, VWMA, RMA, TEMA, and more — fully customizable with source and length options.

• Flexible Signal Logic: Signals are generated when price breaks above or below the selected MA. You can define the number of confirmation candles and choose between wick-based or close-based break logic.

• ATR-Based Filtering: Enable ATR filtering to create dynamic upper and lower breakout bands around the MA. This helps reduce noise and validate true breakouts with volatility-adjusted thresholds.

• Breakout Threshold Filtering: Add an optional breakout condition where the price must first move a minimum percentage away from the previous signal level before a new opposite signal is allowed. Prevents choppy back-to-back signals.

• Visual Enhancements: Color-coded backgrounds highlight long and short zones, adapting dynamically to signal context. Optional MA slope coloring further supports trend visualization.

• Signal Alerts: Customizable alerts for long and short signals, including user-defined messages, to keep you notified in real-time.

Why use this indicator?

Helps you identify clear trend shifts by focusing on price action relative to a customizable moving average.
Improves signal reliability with optional ATR filtering and breakout confirmation, reducing false signals.
Flexible MA types and lengths let you tailor the indicator to your trading style.
Suitable for traders of all levels looking for a straightforward, yet powerful trend-following tool.

How to Use

███████ Alerts ███████

• Custom Alerts: To enable Custom Alerts, you need to activate the fx alert() function call option in TradingView’s alert creation dialog. Then, select the desired alert type (Long or Short) from the indicator's settings under the "Alerts" section, you can customize messages and enable notifications for Long and Short signals.

Using Custom Alerts allows you to set up one alert that covers both Long and Short signals, simplifying your alert management.

• Long and Short Alerts: To create Long or Short alerts, open the alert dialog, select this indicator as the condition, then choose “Long” or “Short” from the list and click Create.

You need to set up two separate alerts: one for Long signals and one for Short signals.

███████ Moving Average ███████

This is the core component of the signal system. You can customize:

Moving Average Type:
Choose from SMA, EMA, WMA, Hull MA, VWMA, RMA, or TEMA

Length: Adjust the length to suit your strategy.

Source: Select which price data (e.g., Close, Open, HL2) is used to calculate the MA.

Show Slope Color: Colors the MA line based on its direction: upward slopes are shown in the selected "Up" color, while downward slopes use the "Down" color. This helps you visually confirm trend direction at a glance.

Show Background Color: When enabled, highlights the area between the MA and price to enhance signal zones:
– If ATR filter is on, the space between ATR bands is shaded.
– If ATR filter is off, the area between the MA line and bar closes is colored.
This helps emphasize potential breakout or trend-following zones visually.

███████ Break Options ███████

Confirm Candles: Defines the number of consecutive candles that must break the selected level to confirm a signal.
– If ATR filter is enabled, this level is the ATR bands.
– If ATR is disabled, the Moving Average line is used.
This helps filter out noise and avoid premature signals.

Break Type: Specifies how the candle must break the level:
– Close: The candle must close beyond the level.
– Wick: A wick touching or exceeding the level is enough.
Choose based on how strict you want the breakout condition to be.

███████ Filters ███████

This section provides optional filters to improve signal accuracy:

ATR
When enabled, breakout confirmation requires the price to cross above the upper breakout line or below the lower breakout line by a specified percentage from the last signal price.

• Multiplier: Adjusts the width of ATR bands by multiplying the ATR value.

• Length: Sets the period for ATR calculation.

• Smoothing: Selects the smoothing method applied to the ATR (RMA, SMA, EMA, WMA).

• Upper and Lower Line Colors: Customize the colors of the ATR bands.

Breakout Filter
When enabled, breakout confirmation requires the price to cross above the upper breakout line or below the lower breakout line by a specified percentage from the last signal price.

• Threshold (%): Defines the minimum percentage price movement required to validate a breakout.

• Show Breakout Levels: Toggle to display or hide breakout threshold area on the chart.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。