Indicators
HomeIndicatorsAgenaScriptRelease Notes
  • 📒AgenaTrader Indicators Introduction
  • STANDARD INDICATORS
    • Accumulation/Distribution (ADL)
    • Adaptive Price Zone (APZ)
    • Aroon
    • Aroon Oscillator
    • Average Directional Index (ADX)
    • Average Directional Movement Rating (ADXR)
    • Average True Range (ATR)
    • BBBreakOutSpeed
    • Balance of Power (BOP)
    • Bollinger Bands
    • Bollinger Percent B (%b)
    • Bollinger Band Width (BBWidth)
    • Bollinger MTF (MultiTimeFrame)
    • BuySellPressure
    • BuySellVolume
    • CandleStickPattern
    • ChaikinMoneyFlow (CMF)
    • Chaikin Oscillator
    • ChaikinVolatility (CVL)
    • Chande Momentum Oscillator (CMO)
    • Climactic Distance
    • Commodity Channel Index (CCI)
    • Directional Movement (DM)
    • Donchian Channel
    • Directional Movement Index (DMI)
    • Double Stochastics (DSS)
    • Dynamic Momentum Index (DMIndex)
    • Ease of Movement (EOM)
    • Fisher Transform
    • Forecast Oscillator (FOSC)
    • HighestHighIndex()
    • HighestHighPrice()
    • IchimokuCloud
    • Keltner Channel
    • KeyReversalUp
    • KeyReversalDown
    • KeyReversalUpAtSMA
    • KeyReversalDownAtSMA
    • KeyReversalUpAtEMA
    • KeyReversalDownAtEMA
    • Linear Regression
    • LinRegIntercept
    • LinRegSlope
    • LowestLowIndex()
    • LowestLowPrice()
    • MACD
    • MAEnvelopes
    • Momentum (MOM)
    • Money Flow Index (MFI)
    • Moving Averages
      • DEMA - Double Exponential Moving Average
      • EMA - Exponential Moving Average
      • EMA MTF (MultiTimeFrame)
      • HMA - Hull Moving Average
      • KAMA - Kaufman's Adaptive Moving Average
      • MAMA - Mesa Adaptive Moving Average
      • SMA - Simple Moving Average
      • GapSMA - Gap Simple Moving Average
      • SMA MTF (MultiTimeFrame)
      • SMMA - Smoothed Moving Average
      • TEMA - Triple Exponential Moving Average
      • TMA - Triangular Moving Average
      • TRIX - Triple Exponential Moving Average
      • T3 - Triple Exponential Moving Average
      • VMA - Variable Moving Average
      • VWMA - Volume Weighted Moving Average
      • WMA - Weighted Moving Average
      • ZLEMA - Zero Lag Exponential Moving Average
    • nBarsUp
    • nBarsDown
    • OnBalanceVolume (OBV)
    • OutsideBars
    • Parabolic SAR
    • Percentage Price Oscillator (PPO)
    • PercentEnvelopes
    • Pivot Points
    • Polarized Fractal Efficiency (PFE)
    • Price Oscillator
    • Rainbow
    • Range
    • Range Indicator (RIND)
    • Rate of Change (ROC)
    • Relative Performance
    • Relative Spread Strength (RSS)
    • Relative Strength Index (RSI)
    • Relative Strength Levy (RSL)
    • Relative Volatility Index (RVI)
    • R-Squared
    • Standard Error (StdError)
    • Stochastics
    • Stochastics Fast
    • Stochastics RSI (StochRSI)
    • Summation (SUM)
    • SuperTrend
    • SupportResistanceAreas
    • Swing
    • Time-Series-Forecast (TSF)
    • Constant Lines
    • CurrentDayOHL
    • Daily Performance
    • DailyQuoteMoves
    • DayLines
    • GetDayBar
    • Info
    • Maximum (MAX)
    • Minimum (MIN)
    • PriceLine
    • PriorDayOHLC
    • PriorDayOHLCext
    • SessionBreakLines
    • ShowBidAsk
    • TickCounter
    • True Strength Index (TSI)
    • Ultimate Oscillator
    • Volume (VOL)
    • Volume Moving Average (VOLMA)
    • Volume Profile
    • Volume Rate of Change (VROC)
    • VolumeUpDown
    • Williams %R
    • ZigZag
  • PREMIUM INDICATORS
    • COT AddOn
      • COTLargeTraderActivity
      • COTStockDummy
      • COTReportLegacy
      • COTReportDisaggregated
      • COTOpenInterestLegacy
      • COTOpenInterestDisaggregated
      • COTCommercialIndex
      • COTAggregatedIndexPositionDisaggregated
    • DowTheory AddOn
      • DayLinesAdv
      • InsideBarsMT
      • MarketPhases
      • MarketPhases Pro
      • MTFBoxes
      • OutsideBars
      • P123
      • P123Pro
      • ReversalBars
    • Darvas AddOn
      • Darvas Boxes
    • Relative Currency Strength (RCS)
    • Volume AddOn
      • KlingerVolumeOscillator
      • Volume Oscillator
      • VolumeArea
      • VolumeGraph
      • VolumeKeltnerChannels
      • VolumeRiseFall
      • VolumeSentimentLong
      • VolumeSentimentShort
      • VolumeSessionPro
      • VolumeTickSpeed
      • VolumeUDR
      • Volume Zones
      • VolumeZoneOscillator
      • WyckoffWave
Powered by GitBook
On this page
Edit on GitLab
  1. STANDARD INDICATORS

MAEnvelopes

Description

These Moving Average Envelopes are percentage-based envelopes placed above and below a moving average. The moving average forms the base for this indicator, and can be a either simple or exponential moving average. Each MA envelope is set the same percentage above or below the moving average, thereby creating parallel bands that follow price action. Moving Average Envelopes can be used as a trend-following indicator with a moving average as the base. But this indicator is not limited to just trend following: the envelopes can also be used for spotting overbought and oversold levels when the trend is relatively flat.

Indicators based on channels, bands and envelopes are intended to encompass most price action, which is why moves above or below the envelopes deserve attention. Trends often start with sharp moves in one direction – a surge above the upper envelope shows extraordinary strength, while a dive below the lower envelope exhibits extraordinary weakness. Strong moves such as these can signal the end of one trend and the start of another.

With a moving average as the foundation, Moving Average Envelopes are a trend-following indicator. As with moving averages, the envelopes lag price action. The direction of the moving average dictates the direction of the channel, so generally, when the channel moves lower, a downtrend exists, and when the channel goes higher, an uptrend is present. When the channel moves sideways, this signifies that the trend is flat.

Occasionally, it happens that a strong trend does not establish itself after an envelope break, and prices move into a trading range. Trading ranges such as these are characterized by a relatively flat moving average. These envelopes can then be used to spot overbought and oversold levels. A move above the upper envelope shows an overbought situation; a move below the lower envelope signals an oversold situation.

Usage

MAEnvelopes(double envelopePercentage, MAEnvelopesMAType maType, int period)
MAEnvelopes(IDataSeries inSeries, double envelopePercentage, MAEnvelopesMAType maType, int period)

//For the upper band
MAEnvelopes(double envelopePercentage, MAEnvelopesMAType maType, int period).Upper[int barsAgo]
MAEnvelopes(IDataSeries inSeries, double envelopePercentage, MAEnvelopesMAType maType, int period).Upper[int barsAgo]

//For the middle band
MAEnvelopes(double envelopePercentage, MAEnvelopesMAType maType, int period).Middle[int barsAgo]
MAEnvelopes(IDataSeries inSeries, double envelopePercentage, MAEnvelopesMAType maType, int period).Middle[int barsAgo]

//For the lower band
MAEnvelopes(double envelopePercentage, MAEnvelopesMAType maType, int period).Lower[int barsAgo]
MAEnvelopes(IDataSeries inSeries, double envelopePercentage, MAEnvelopesMAType maType, int period).Lower[int barsAgo]

Return value

double

When using this method with an index (e.g. MAEnvelopes(14,SMA,1.5)[int barsAgo] ), the value of the indicator will be issued for the referenced bar.

Parameters

v Input data series for the indicator

period Number of bars included in the calculations

envelopePercentage Distance of the upper and lower bands from the middle line in percent

maType Type of moving average used, possible choices are: - EMA - HMA - SMA (default) - TMA - TEMA - WMA

Visualization

Usage

//Value output for the upper band
Print("Upper band of the MA Envelope: " + MAEnvelopes(1.5, MAEnvelopesMAType.SMA, 14).Upper[0]);

//Value output for the middle band
Print("Middle band of the MA Envelope: " + MAEnvelopes(1.5, MAEnvelopesMAType.SMA, 14).Middle[0]);

//Value output for the lower band
Print("Lower band of the MA Envelope: " + MAEnvelopes(1.5, MAEnvelopesMAType.SMA, 14).Lower[0]);

Last updated 3 years ago

MAEnvelopes