TMA Centered Bands (TMACB)
Page contents
Triangular Weighting Rather than using simple or exponential moving averages, TMA applies triangular weighting to price data. This means the center point receives maximum weight, while bars further away (both past and future from the center) receive progressively less weight. This creates an exceptionally smooth moving average that responds naturally to price trends while filtering out market noise more effectively than traditional moving averages.
Non-Repainting Design The indicator calculates its values at a position HalfLength bars ago, using only data that was available at that historical point. When displayed on a chart, the current bar shows the TMA value that was calculated HalfLength bars in the past, shifted forward. This guarantees that values never change once calculated, making it perfect for backtesting and automated trading systems where reliability is critical.
Volatility-Adaptive Bands By incorporating ATR-based bands around the centered TMA, the indicator automatically expands during volatile market conditions and contracts during quiet periods. This dynamic adjustment helps traders identify meaningful breakouts versus normal price fluctuations, as the bands represent statistically significant price movements relative to current market volatility.
Parameters
HalfLength (default: 12, range: 1-500) Determines both the smoothing period and the centering offset. A HalfLength of 12 means the TMA uses 25 bars total (12 before center + center bar + 12 after center) and displays values with a 12-bar lag. Smaller values make the indicator more responsive but less smooth; larger values provide smoother signals with more lag.
AtrPeriod (default: 100, range: 1-1000) The lookback period for Average True Range calculation. Longer periods provide more stable volatility measurements that change slowly, while shorter periods make bands more reactive to recent volatility spikes. The default 100-period setting offers a good balance for medium-term trend following.
AtrMultiplier (default: 2.0, range: 0.1-10.0) Controls the width of the bands by multiplying the ATR value. Higher multipliers create wider bands that are touched less frequently, suitable for identifying major trend changes. Lower multipliers create tighter bands for more frequent trading signals.
Preset Parameter Sets
The indicator includes four optimized parameter combinations:
- Standard: HalfLength=12, AtrPeriod=100, AtrMultiplier=2.0 (balanced for most markets)
- Slower: HalfLength=24, AtrPeriod=100, AtrMultiplier=2.0 (smoother, less frequent signals)
- Tighter: HalfLength=12, AtrPeriod=50, AtrMultiplier=1.5 (more responsive to recent volatility)
- Wider: HalfLength=12, AtrPeriod=100, AtrMultiplier=2.5 (fewer false breakouts)
How to Use
Trend Identification
- Price above Upper band: Strong uptrend
- Price between Middle and Upper: Uptrend
- Price near Middle: Neutral/consolidation
- Price between Lower and Middle: Downtrend
- Price below Lower band: Strong downtrend
Entry Signals
- Long entries when price crosses above Middle line from below
- Short entries when price crosses below Middle line from above
- Breakout longs when price closes above Upper band
- Breakout shorts when price closes below Lower band
Exit Signals
- Exit longs when price crosses below Middle or touches Lower band
- Exit shorts when price crosses above Middle or touches Upper band
Support/Resistance The Upper and Lower bands act as dynamic support and resistance levels. Bounces off these bands in the direction of the trend often provide low-risk entry opportunities.
Implementation Notes
The indicator requires a minimum of 2 × HalfLength + AtrPeriod + 10 bars before producing valid values. With default settings (HalfLength=12, AtrPeriod=100), this means at least 134 bars of historical data are needed.
The price calculation uses a weighted average of High, Low, and Close (with Close counted twice): (High + Low + Close + Close) / 4, which helps smooth out intrabar volatility while remaining sensitive to closing prices.
TMA Centered Bands - Custom Trading Blocks
This package contains 8 ready-to-use condition blocks designed for systematic strategy building with the TMA Centered Bands indicator. These blocks encapsulate common trading patterns and can be directly used in StrategyQuant's strategy builder.
1. Band Penetration Blocks
HighAboveTMAU (Opposite: LowBelowTMAD)
- Logic:
High[1] > TMAUpper[1] - Description: Detects when price high breaks above the upper band, signaling strong bullish momentum or potential overbought conditions
- Use Case: Long entry on breakout, or short exit signal
LowBelowTMAD (Opposite: HighAboveTMAU)
- Logic:
Low[1] < TMALower[1] - Description: Detects when price low breaks below the lower band, signaling strong bearish momentum or potential oversold conditions
- Use Case: Short entry on breakdown, or long exit signal
2. Mean Reversion (Recovery) Blocks
HighAboveTMAD (Opposite: LowBelowTMAU)
- Logic:
Low[2] < TMALower[2] AND High[1] > TMALower[1] - Description: Price touched/broke below the lower band (TMAD) 2 bars ago and has now recovered back above it, showing rejection of lower prices and potential bullish reversal
- Use Case: Long entry after successful test of support at lower band - "coming back from down band"
LowBelowTMAU (Opposite: HighAboveTMAD)
- Logic:
High[2] > TMAUpper[2] AND Low[1] < TMAUpper[1] - Description: Price touched/broke above the upper band (TMAU) 2 bars ago and has now pulled back below it, showing rejection of higher prices and potential bearish reversal
- Use Case: Short entry after failed breakout at upper band - "coming back from up band"
3. Trend Direction Blocks
TMACIsRising (Opposite: TMACIsFalling)
- Logic:
TMAMiddle[0] > TMAMiddle[1] - Description: The center line (Middle band/TMAC) is rising, confirming upward trend momentum
- Use Case: Filter for long-only strategies, trend confirmation, avoid counter-trend shorts
TMACIsFalling (Opposite: TMACIsRising)
- Logic:
TMAMiddle[0] < TMAMiddle[1] - Description: The center line (Middle band/TMAC) is falling, confirming downward trend momentum
- Use Case: Filter for short-only strategies, trend confirmation, avoid counter-trend longs
4. Advanced Rebound Signals (High-Probability Reversals)
TMACReboundUP ▲ (Opposite: TMACReboundDown)
- Logic:
Close[2] < Open[2] AND // Previous bar was bearish candle Close[1] > Open[1] // Current bar is bullish (reversal confirmation)
- Description: Bullish reversal pattern - price pushed below the middle line with bearish momentum, then reversed with bullish candle showing buyers stepping in
- Use Case: Long entry when price shows exhaustion and reversal after testing middle line support
- Caution: Avoid if
pastTMAC - TMAC > TMAangle × point (strong downtrend angle = risky long)
TMACReboundDown ▼ (Opposite: TMACReboundUP)
- Logic:
Close[2] > Open[2] AND // Previous bar was bullish candle Close[1] < Open[1] // Current bar is bearish (reversal confirmation)
- Description: Bearish reversal pattern - price pushed above the middle line with bullish momentum, then reversed with bearish candle showing sellers stepping in
- Use Case: Short entry when price shows exhaustion and reversal after testing middle line resistance
- Caution: Avoid if
TMAC - pastTMAC > TMAangle × point (strong uptrend angle = risky short)
Strategy Template Examples
1. Trend-Following Breakout Strategy
Long Exit: LowBelowTMAU OR TMACIsFalling Short Entry: LowBelowTMAD AND TMACIsFalling Short Exit: HighAboveTMAD OR TMACIsRising
2. Mean Reversion Strategy
Long Exit: HighAboveTMAU Short Entry: LowBelowTMAU AND TMACIsFalling Short Exit: LowBelowTMAD
3. Rebound Strategy (Recommended)
LongEntry: TMACReboundUP AND TMACIsRising Long Exit: TMACReboundDown OR TMACIsFalling Short Entry: TMACReboundDown AND TMACIsFalling Short Exit: TMACReboundUP OR TMACIsRising
Parameters
All blocks share these customizable parameters:
- Chart: Select data series (default: primary chart)
- HT_Per (HalfLength): 10-220, step 10
- ATR_Per (ATR Period): 10-120, step 10 (default: 100)
- ATR_Mult (ATR Multiplier): 0.5-3.0, step 0.5 (default: 2.0)
These blocks leverage StrategyQuant's opposite block system, making it easy to create symmetrical long/short strategies with proper negation logic.
Indicator Availability
This indicator is implemented for StrategyQuant X and can be used across all supported trading platforms including MT4, MT5, TradeStation, and MultiCharts.
Using Custom Blocks for Conditions
You can easily define your own conditions in StrategyQuant X using Custom Blocks. This allows you to set up parameters such as periods or thresholds to fine-tune the indicator to your strategy. For more detailed information, refer to the following resources:
Importing Custom Indicators into SQX
To import custom indicators into StrategyQuant X, follow the step-by-step instructions provided here:
Excellent ! thank you Ivan