OPEN-SOURCE SCRIPT

Dual ATR Adaptive MA Pro

424
# Dual ATR AMA Pro

**Dual ATR AMA Pro** is a volatility-adaptive trend and risk-orientation indicator based on ATR behavior. The indicator is designed to help traders read market direction, volatility conditions, pullback structure, and possible risk distances directly on the chart.

The main purpose of this tool is not to predict tops or bottoms. Instead, it is designed to help traders wait for confirmation after consolidation phases and trade in the direction of the confirmed market flow.

The indicator combines two ATR-adaptive moving averages, an optional trend regime heatmap, ATR-based bands, and a volatility label that displays current ATR, average ATR, calculated stop size, and a 1:2 take-profit reference.

---

## Core idea

Many moving averages use a fixed length. For example, an EMA 50 always reacts with the same smoothing speed, regardless of whether the market is calm or highly volatile.

Dual ATR AMA Pro uses ATR behavior to adapt the moving average dynamically. When volatility changes, the adaptive average changes its reaction speed.

The idea behind this is simple:

* In stronger movement phases, the adaptive line can react faster.
* In slower or unclear phases, the adaptive line can become smoother.
* The slower adaptive line can be used as a broader trend filter.
* The faster adaptive line can be used as a timing and pullback reference.

This makes the tool useful for traders who do not want to enter during the first impulse of a move, but prefer to wait until the market has confirmed direction after a consolidation.

---

## Main components

The indicator consists of four main parts:

1. **ATR Adaptive MA 1**
2. **ATR Adaptive MA 2**
3. **Trend regime heatmap**
4. **ATR risk label**

---

## ATR Adaptive MA 1

ATR Adaptive MA 1 is the faster line.

It is intended as a short-term timing line. It can help identify pullbacks, reaction points, and short-term changes in flow.

Typical use cases:

* Entry timing after pullbacks
* Visual short-term trend direction
* Dynamic support/resistance in trending phases
* Faster reaction after a new impulse

In a bullish environment, traders may watch whether price pulls back toward ATR MA 1 and then continues upward.

In a bearish environment, traders may watch whether price pulls back toward ATR MA 1 and then continues downward.

ATR MA 1 is usually more reactive and therefore more sensitive to short-term market noise.

---

## ATR Adaptive MA 2

ATR Adaptive MA 2 is the slower line.

It is intended as the broader directional filter. It reacts more slowly and is designed to provide a calmer view of the current market regime.

Typical use cases:

* Main trend direction
* Trade direction filter
* Heatmap basis
* Avoiding early entries during consolidation
* Confirming whether the market has shifted from bullish to bearish, or bearish to bullish

The slow ATR line is especially useful when the trader wants to avoid the first part of a move and only participate after the market has shown a clearer directional flow.

---

## Heatmap logic

The heatmap is used to visualize the current market regime.

The heatmap can be based on:

* ATR MA 1
* ATR MA 2
* Both lines together

The default idea is to use **ATR MA 2** as the heatmap basis because it is calmer and filters out many smaller fluctuations.

A bullish heatmap appears when the selected logic confirms bullish conditions.

A bearish heatmap appears when the selected logic confirms bearish conditions.

There is no neutral background color, so the chart does not get visually interrupted by a gray regime. If the condition is not clearly bullish or bearish, no background color is displayed.

This makes the heatmap useful as a directional filter rather than a direct entry signal.

---

## Suggested interpretation of the heatmap

A green heatmap does not automatically mean “buy now.”

A red heatmap does not automatically mean “sell now.”

Instead, the heatmap should be read as a market condition filter.

Example:

* Green heatmap = long setups may be preferred
* Red heatmap = short setups may be preferred
* No clear heatmap = avoid forcing trades

The indicator is designed to support a more defensive trading style. It helps the trader avoid trading directly inside uncertain transition zones.

---

## Trend protection

Each ATR adaptive line has its own optional trend protection setting.

Trend protection attempts to reduce unnecessary movement in unclear sideways phases and allows the line to react better when the market is actually moving with directional strength.

The practical idea:

* If the market is just moving sideways, the line becomes calmer.
* If the market starts moving with real directional flow, the line can respond more effectively.

This is useful for traders who want to wait for a confirmed movement instead of reacting to every small candle fluctuation.

In the default concept:

* ATR MA 1 can remain more reactive as a timing line.
* ATR MA 2 can use trend protection as a calmer directional filter.

---

## Normal ATR logic vs inverted ATR logic

The indicator includes an optional logic inversion.

In normal mode:

* Higher ATR can make the line react faster.
* Lower ATR can make the line smoother.

In inverted mode:

* Higher ATR can make the line slower.
* Lower ATR can make the line faster.

Normal logic is usually better for following active market movement.

Inverted logic can be useful if the trader wants more stability during volatile phases and does not want the line to react too aggressively.

The default approach is usually to keep inverted logic disabled unless a specific market or strategy requires it.

---

## ATR bands

The indicator can display an ATR band around ATR MA 1.

The band is calculated from ATR and a configurable multiplier.

The band can be used to understand whether price is still moving within a normal volatility area around the fast adaptive line or whether price is stretched away from it.

Possible uses:

* Visual volatility zone
* Pullback area
* Dynamic reaction area
* Context for overextension

The band should not be interpreted as a guaranteed reversal zone. It is a volatility reference.

---

## ATR risk label

The indicator includes an ATR label near the current price.

The label can show:

* Current ATR
* Average ATR over the last selected number of candles
* Stop size based on average ATR
* 1:2 take-profit reference based on the stop size

Example:

ATR 14: 3.880
ATR Ø 50: 4.221
Stop 2x ATR Ø: 8.442
TP 1:2: 16.884

This helps the trader estimate whether the current market volatility fits the planned trade.

For example, if the average ATR over 50 candles is 4.221 points and the stop multiplier is 2.0, the calculated stop reference is approximately 8.442 points.

The 1:2 take-profit reference is then twice the stop size.

This does not mean that the stop or take-profit should be used blindly. The values are intended as volatility-based references and should be combined with market structure, support/resistance, previous highs/lows, session levels, or other trading context.

---

## Example use case: trend continuation after consolidation

A trader may use the indicator in the following way:

1. The market reaches an important level, such as a previous daily high or daily low.
2. Price starts to consolidate.
3. The trader avoids entering during the unclear consolidation phase.
4. ATR MA 2 and the heatmap eventually confirm direction.
5. ATR MA 1 changes in the same direction.
6. A candle closes in the direction of the confirmed flow.
7. The trader looks for a possible setup in the direction of the trend.

This approach is designed for traders who prefer confirmation over early entries.

The goal is not to catch the exact top or bottom, but to avoid unnecessary risk during market transition phases.

---

## Example bullish condition

A possible bullish interpretation could be:

* Price is above ATR MA 2
* ATR MA 2 is rising
* Heatmap is bullish
* ATR MA 1 is rising
* Price pulls back and then continues upward
* Candle confirmation supports the direction

This may suggest that long setups are favored.

---

## Example bearish condition

A possible bearish interpretation could be:

* Price is below ATR MA 2
* ATR MA 2 is falling
* Heatmap is bearish
* ATR MA 1 is falling
* Price pulls back and then continues downward
* Candle confirmation supports the direction

This may suggest that short setups are favored.

---

## Defensive trading concept

The indicator is especially designed for traders who want to protect capital by avoiding unclear early movement.

Instead of trying to enter at the first impulse, the trader can wait for:

* Market structure confirmation
* Heatmap confirmation
* ATR MA 2 direction
* ATR MA 1 timing
* Candle confirmation
* Volatility-based risk reference

This can help reduce emotional entries in consolidation zones.

---

## Why two ATR adaptive averages?

Using only one adaptive average can be too noisy or too slow.

The two-line approach separates the job of each line:

**ATR MA 1:**
Short-term timing and pullback reference.

**ATR MA 2:**
Market regime and directional filter.

This separation makes the tool easier to use because the trader does not need one line to do everything.

---

## What this indicator is not

This indicator is not a guaranteed trading system.

It does not predict future price movement.

It does not provide financial advice.

It should not be used as a standalone buy or sell signal.

It is a visual decision-support tool that helps traders understand trend direction, volatility, possible risk distance, and market regime.

---

## Recommended use

The indicator works best when combined with:

* Market structure
* Previous highs and lows
* Daily highs and daily lows
* Support and resistance
* Supply and demand zones
* Session levels
* Candle confirmation
* Risk management rules

The strongest use case is not entering immediately when the heatmap changes, but waiting for a confirmed pullback or continuation setup in the direction of the selected regime.

---

## Practical trading concept

A possible workflow:

1. Identify the higher-timeframe or session context.
2. Mark important daily highs/lows or consolidation zones.
3. Wait until price leaves the consolidation area.
4. Use ATR MA 2 and heatmap as the directional filter.
5. Use ATR MA 1 for timing.
6. Use ATR average and stop calculation as risk reference.
7. Only take trades where the risk-to-reward structure makes sense.

---

## Risk label explanation

The ATR risk label is included to make volatility more practical.

Instead of guessing stop size, the trader can use the average ATR as a reference.

Example:

If ATR Ø 50 is 4.0 and the stop multiplier is 2.0, then the stop reference is 8.0 points.

If the trader wants a 1:2 setup, the take-profit reference is 16.0 points.

This helps answer an important question before taking a trade:

“Is the current market movement large enough to justify my stop and target?”

---

## Final note

Dual ATR AMA Pro is built for traders who prefer confirmation, structure, and volatility-adjusted risk planning.

The indicator is especially useful for avoiding trades inside uncertain consolidation phases and for waiting until the market shows a cleaner directional flow.

It is best used as a trend, volatility, and risk-orientation tool, not as an automatic signal generator.

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.