MACD ATR Trading Guide
Last updated: July 22, 2026
The MACD / ATR is a quantitative technical analysis tool. MACD_ATR Optimized version: - Incremental calculation (updateLastOnly)
What does the indicator show?
- Market Structure & Momentum: Visualizes prevailing trend directions and key reversal zones.
- BUY / SELL Signals: Highlights confirmed entry and exit opportunities based on quantitative rules.
- Dynamic Boundaries: Provides adaptive levels for managing trade risk and reward expectations.
Key Settings
- Fast Length (
fastLen): Controls the calculation period and sensitivity for market detection. - Slow Length (
slowLen): Controls the calculation period and sensitivity for market detection. - Signal Length (
signalLen): Controls the calculation period and sensitivity for market detection. - ATR Length (
atrLen): Controls the calculation period and sensitivity for market detection. - Oscillator MA (
oscMa): Controls the calculation period and sensitivity for market detection. - Signal MA (
sigMa): Controls the calculation period and sensitivity for market detection. - MACD/ATR Line (
dif): Controls the calculation period and sensitivity for market detection. - Signal Line (
dea): Controls the calculation period and sensitivity for market detection. - Histogram Bull Up (
macdBullUp): Controls the calculation period and sensitivity for market detection. - Histogram Bull Down (
macdBullDown): Controls the calculation period and sensitivity for market detection. - Histogram Bear Down (
macdBearDown): Controls the calculation period and sensitivity for market detection. - Histogram Bear Up (
macdBearUp): Controls the calculation period and sensitivity for market detection. - Histogram (
macd): Controls the calculation period and sensitivity for market detection. - MACD/ATR (
dif): Controls the calculation period and sensitivity for market detection. - Signal (
dea): Controls the calculation period and sensitivity for market detection. - Bull Up (
_macdBullUp): Controls the calculation period and sensitivity for market detection. - Bull Down (
_macdBullDown): Controls the calculation period and sensitivity for market detection. - Bear Down (
_macdBearDown): Controls the calculation period and sensitivity for market detection. - Bear Up (
_macdBearUp): Controls the calculation period and sensitivity for market detection. - MACD/ATR Line (
dif): Controls the calculation period and sensitivity for market detection. - Signal Line (
dea): Controls the calculation period and sensitivity for market detection. - Histogram (
macd): Controls the calculation period and sensitivity for market detection. - Bull Cross (
bullCross): Controls the calculation period and sensitivity for market detection. - Bear Cross (
bearCross): Controls the calculation period and sensitivity for market detection.
How to use Strategy Parameters (Condition Source)
Within the Strategy Tester module, this indicator can be used both as a direct signal source and as a market-state filter.
1. Signal Events
bullCross- Bull Cross event signal.bearCross- Bear Cross event signal.
2. Filters and Trade Levels
fastLen- Fast Length value used for structural qualification or thresholds.slowLen- Slow Length value used for structural qualification or thresholds.signalLen- Signal Length value used for structural qualification or thresholds.atrLen- ATR Length value used for structural qualification or thresholds.oscMa- Oscillator MA value used for structural qualification or thresholds.sigMa- Signal MA value used for structural qualification or thresholds.macd- Histogram value used for structural qualification or thresholds.dif- MACD/ATR value used for structural qualification or thresholds.dea- Signal value used for structural qualification or thresholds._macdBullUp- Bull Up value used for structural qualification or thresholds._macdBullDown- Bull Down value used for structural qualification or thresholds._macdBearDown- Bear Down value used for structural qualification or thresholds._macdBearUp- Bear Up value used for structural qualification or thresholds.dif- MACD/ATR Line value used for structural qualification or thresholds.dea- Signal Line value used for structural qualification or thresholds.macd- Histogram value used for structural qualification or thresholds.
Strategy Example: Enter Long when buySignal is true and trendFilter == 1, ensuring trades align with dominant momentum.