**AGet.maBands()**Advanced GET Studies

Returns the band series or values of theGET Moving Averagestudy.

The GET Moving Average allows you to add custom or optimized bands based on a proprietary algorithm.

__Syntax__AGet.maBands(Length,Offset,Exponential,Percent1,Percent2,Type,ReturnSeries[,Series | sym() | inv()][,BarIndex] )

__Parameters__Parameter:

*Description: Default:*

*Length*

*An integer which represents the number of periods to use for calculation.*

n/a

*Offset*

*An integer which determines the number of periods the Moving Average should be shifted forward (+ number) or backwards (- number).*

n/a

*Exponential*

*A boolean value. Exponential Moving Average is used when this parameter is True, Simple Moving Average is used when this parameter is False.*

n/a

*Percent1*

*A floating-point number which is used to adjust where, in relation to the price scale, the Moving Average is displayed. When both Band One and Band Two are set to 0 (the default setting), only one Moving Average is drawn at the price it was calculated. Increasing this number will shift the Moving Average up on the price scale, and decreasing this number will shift the Moving Average down the price scale.*

n/a

*Percent2*

*A floating-point number which is used to adjust where, in relation to the price scale, the Moving Average is displayed. When both Band One and Band Two are set to 0 (the default setting), only one Moving Average is drawn at the price it was calculated. Increasing this number will shift the Moving Average up on the price scale, and decreasing this number will shift the Moving Average down the price scale.*

n/a

*Type*

*Allows to choose what bands of the MA study should be added: custom or optimazed based on a proprietary algorithm. To choose use the follwing constants:*

MABANDS_ORIGINAL = 0

MABANDS_NORMAL = 1

MABANDS_AGGRESSIVE = 2

MABANDS_ORIGINAL = 0

MABANDS_NORMAL = 1

MABANDS_AGGRESSIVE = 2

n/a

*ReturnSeries*

*Allows to choose what series of the GET MA study should be returned. To choose use the follwing constants:*

MABANDS_UPPER = 0

MABANDS_LOWER = 1

MABANDS_ADJUST = 2

MABANDS_UPPER = 0

MABANDS_LOWER = 1

MABANDS_ADJUST = 2

n/a

*Series | sym() | inv()*

*[Optional] Series Object or function of sym() or inv() to determine symbol/interval source for the study.*

Base sym/int

*BarIndex*

*[Optional] Bar index of series to retrieve.*

n/a

__Return Value(s)__Returns a Series Object when

*nBarIndex*is

__not__specified. Series Object for the Adjust series consists of the set of constants shown below.

Returns a single value whennBarIndexis specified. The function returns a single value of the Adjust series from the set of constants shown below.

A set of constants for the Adjust series:

NONE = 0UPPER = 1LOWER = -1

__Notes__Only available in versions 11.8 or later.

__Code Example__Creating Series Example:

var bInit = false;var xSer1 = null;var xSer2 = null;setPriceStudy(true);function main(){ if(bInit == false){ xSer1 = getSeries(AGet.maBands(20, 0, false, 0, 0, MABANDS_NORMAL, MABANDS_UPPER)); xSer2 = getSeries(AGet.maBands(20, 0, false, 0, 0, MABANDS_NORMAL, MABANDS_LOWER)); bInit = true; }; return new Array (xSer1,xSer2);}

__See Also__Advanced GET Study Functions

AGet.ma()