# AgenaTrader Indicators Introduction

{% content-ref url="/pages/ySe3twNv6DilqmpwI0CZ" %}
[STANDARD INDICATORS](/standard-indicators/accumulation-distribution-adl)
{% endcontent-ref %}

{% content-ref url="/pages/vge6qt99H5luAZ1sxe2r" %}
[PREMIUM INDICATORS](/premium-indicators/cot-addon)
{% endcontent-ref %}


# Accumulation/Distribution (ADL)

#### Description <a href="#description" id="description"></a>

The Accumulation Distribution LevelLine (ADL) indicator was developed by Marc Chaikin. The ADL is a volume indicator that represents the money flow. The ADL is an improvement of the On-Balance Volume Indicator created by Joe Granville, which was actually one of the very first volume indicators.

#### Interpretation <a href="#interpretation" id="interpretation"></a>

There are two interpretations of the ADL:

Confirmation of a trend or

1. The depiction of *divergence*

If the ADL is rising in an uptrend, then money is flowing in the direction of the rising prices, thus the uptrend is confirmed. If the ADL is falling in a downward trend, money is being taken out of the stock, thus confirming the downtrend.

#### Further information <a href="#further-information" id="further-information"></a>

[vtadwiki.vtad.de](http://vtadwiki.vtad.de/index.php/Accumulation_Distribution_Linie)

#### Usage <a href="#usage" id="usage"></a>

```
ADL()
ADL(IDataSeries inSeries)
ADL()[int barsAgo]
ADL(IDataSeries inSeries)[int barsAgo]
```

#### Return value <a href="#return-value" id="return-value"></a>

**double**

When using the method with an index (e.g. ADL()\[int barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameter <a href="#parameter" id="parameter"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization" id="visualization"></a>

![Accumulation/Distribution (ADL)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ADL.jpg)

#### Example <a href="#example" id="example"></a>

```csharp
//Testing the direction of the ADL
if (IsSerieRising(ADL()) {
Print("The ADL indicator is rising.");
}
```


# Adaptive Price Zone (APZ)

#### Description <a href="#description_1" id="description_1"></a>

This is a technical indicator developed by Lee Leibfarth in 2006. The Adaptive Price Zone is a volatility-based indicator shown as a set of bands laid over a price chart. The APZ, which is particularly useful in non-trending, choppy markets, was developed with the aim of helping traders to find potential turning points in the markets. The APZ is based on a short-term, double-smoothed EMA that reacts rapidly to price changes with reduced lag. It works in the following way: the bands create a channel that envelopes the average price and tracks price changes. If the price crosses over the upper band of the zone, this creates an opportunity for the trader to trade a reversal. For the lower band, the reverse is true.

#### Interpretation <a href="#interpretation_1" id="interpretation_1"></a>

The bigger the price movement, the greater the distance between the upper and lower band will be. The smaller the price movement, the smaller the distance between the bands. More widely spaced bands will indicate increased instability and volatility, whereas closely tuned bands will display reduced volatility. If the price action breaks through the upper or lower band then the APZ will tend to return to its statistical average. This will lead to trading opportunities where the market may try to compensate for imbalances. If the price overshoots the bands for example, as mentioned in the description, then this will present you with a trading opportunity in the opposite direction.

#### Further information <a href="#further-information_1" id="further-information_1"></a>

<http://www.investopedia.com/articles/trading/10/adaptive-price-zone-indicator-explained.asp>

#### Usage <a href="#usage_1" id="usage_1"></a>

```csharp
APZ(double barPct, int period)
APZ(IDataSeries inSeries, double barPct, int period)
//Upper Band
APZ(double barPct, int period).Upper[int barsAgo]
APZ(IDataSeries inSeries, double barPct, int period).Upper[int barsAgo]
//Lower Band
APZ(double barPct, int period).Lower[int barsAgo]
APZ(IDataSeries inSeries, double barPct, int period).Lower[int barsAgo]
```

#### Return value <a href="#return-value_1" id="return-value_1"></a>

**double**

When using the method with an index (e.g. **APZ**(2, 20)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters" id="parameters"></a>

barPct Standard deviation

inSeries Input data series for the indicator

period Number of bars included in the calculation

#### Visualization <a href="#visualization_1" id="visualization_1"></a>

![Adaptive Price Zone (APZ)](https://agenatrader.github.io/AgenaIndicator-documentation/media/APZ.jpg)

#### Example <a href="#example_1" id="example_1"></a>

```csharp
//Output for the current values for the upper and lower band of a 20-period APZ
Print("Value for the upper APZ band : " + APZ(2, 20).Upper[0]);
Print("Value for the lower APZ band: " + APZ(2, 20).Lower[0]);
```


# Aroon

#### Description <a href="#description_2" id="description_2"></a>

Aroon, an indicator system that determines whether or not a stock is trending and how strong this trend is, was developed by Tushar Chande in 1995. Its name is derived from the Sanskrit “dawn’s early light”. Chande used this name to signify the indicators’ purpose of revealing the start of a new trend. These indicators measure the number of periods since the last time the price recorded an x-day high or low. There are two distinct indicators: the Aroon-Up and Aroon-Down, whereby a 50-day Aroon-Up measures the number of days since a 50-day high, and a 50-day Aroon-Down measures the days since a 50-day low. This makes the Aroon indicators significantly different from the usual momentum oscillators, which concentrate on price in relation to time. What makes Aroon indicators unique is that they focus on time in relation to price. Aroon indicators can be used to detect emerging trends, identify consolidations, anticipate reversals and define correction periods.

#### Interpretation <a href="#interpretation_2" id="interpretation_2"></a>

The Aroon indicators fluctuate above/below a centerline (50) and are bound between 0 and 100. These three levels are important for interpretation. At its most basic, the bulls have the edge when Aroon-Up is above 50 and Aroon-Down is below 50. This indicates a greater propensity for new x-day highs than lows. The converse is true for a downtrend. The bears have the edge when Aroon-Up is below 50 and Aroon-Down is above 50.

A surge to 100 indicates that a trend may be emerging. This can be confirmed with a decline in the other Aroon indicator. For example, a move to 100 in Aroon-Up combined with a decline below 30 in Aroon-Down shows upside strength. Consistently high readings mean prices are regularly hitting new highs or new lows for the specified period. Prices are moving consistently higher when Aroon-Up remains in the 70-100 range for an extended period. Conversely, consistently low readings indicate that prices are seldom hitting new highs or lows. Prices are NOT moving lower when Aroon-Down remains in the 0-30 range for an extended period. This does not mean prices are moving higher though. For that we need to check Aroon-Up.

#### Further information <a href="#further-information_2" id="further-information_2"></a>

<http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:aroon>

#### Usage <a href="#usage_2" id="usage_2"></a>

```csharp
Aroon(int period)
Aroon(IDataSeries inSeries, int period)
//For the upper value
Aroon(int period).Up[int barsAgo]
Aroon(IDataSeries inSeries, int period).Up[int barsAgo]
//For the lower value
Aroon(int period).Down[int barsAgo]
Aroon(IDataSeries inSeries, int period).Down[int barsAgo]
```

#### Return value <a href="#return-value_2" id="return-value_2"></a>

**double**

When using this method with an index (e.g. **Aroon**(20)\[**int** barsAgo] ) the value of the indicator will be displayed for the last referenced bar.

#### Parameters <a href="#parameters_1" id="parameters_1"></a>

inSeries Input data series for the indicator

period Number of bars taken into consideration when calculating the values

#### Visualization <a href="#visualization_2" id="visualization_2"></a>

![Aroon](https://agenatrader.github.io/AgenaIndicator-documentation/media/aroon.jpg)

#### Example <a href="#example_2" id="example_2"></a>

```csharp
//Output of the current up or down values for the 20 period Aroon
Print("Current value for Aroon Up is : " + Aroon(20).Up[0]);
Print("Current value for Aroon Down is: " + Aroon(20).Down[0]);
```


# Aroon Oscillator

#### Description <a href="#description_3" id="description_3"></a>

This oscillator is calculated by subtracting the Aroon-Down from the Aroon-Up. Usually, these two indicators are plotted next to each other for easy comparison, but traders can also view the difference between the two indicators using the Aroon oscillator, which can fluctuate between -100 and +100, with zero as the middle line. When the oscillator is positive, this indicates a bullish trend bias, whilst when the oscillator is negative, this shows a bearish trend bias. Chartists also have the option to extend the bull-bear threshold to spot stronger signals.

#### Interpretation <a href="#interpretation_3" id="interpretation_3"></a>

The Aroon Oscillator is ideally used as a trend filter and trend strength indicator. It is used analogously to the ADX Indicator.

#### Usage <a href="#usage_3" id="usage_3"></a>

```csharp
AroonOscillator(int period)
AroonOscillator(IDataSeries inSeries, int period)
AroonOscillator(int period)[int barsAgo]
AroonOscillator(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_3" id="return-value_3"></a>

**double**

When using this method with an index such as (**AroonOcsillator**(20)\[**int** barsAgo] ), the value of the indicator will be outputted for the bar that was referenced.

#### Parameters <a href="#parameters_2" id="parameters_2"></a>

inSeries Input data series for the indicator

period Number of bars taken into consideration for the calculations

#### Visualization <a href="#visualization_3" id="visualization_3"></a>

![Aroon Oscillator](https://agenatrader.github.io/AgenaIndicator-documentation/media/ArronOscillator.jpg)

#### Example <a href="#example_3" id="example_3"></a>

```csharp
//Output for the current value for a 20 period Aroon Oscillator
Print("Value for the oscillator is: " + AroonOscillator(20)[0]);
```


# Average Directional Index (ADX)

#### Description <a href="#description_4" id="description_4"></a>

The ADX is part of a group of directional movement indicators that make up a trading system developed by Welles Wilder: the Average Directional Index, Minus Directional Indicator (-DI) and Plus Directional Indicator (+DI). Wilder designed ADX with daily prices and commodities in mind; however, these indicators can also be applied to stocks. The Average Directional Index measures the trend strength without taking trend direction into account, while the -DI and +DI complement the ADX by defining the trend direction. When used together, traders can find out both the direction and the strength of the trend.

Wilder talks about the Directional Movement indicators in his 1978 book, New Concepts in Technical Trading Systems, which also features details of Average True Range (ATR), the Parabolic SAR system and the RSI. Although he developed them before the computer age, Wilder’s indicators are extremely detailed in their calculation and are still equally effective today.

#### Interpretation <a href="#interpretation_4" id="interpretation_4"></a>

The Average Directional Index (ADX) is used to measure the strength or weakness of a trend, not the actual direction. Directional movement is defined by +DI and -DI. In general, the bulls have the edge when +DI is greater than -DI, while the bears have the edge when -DI is greater. Crosses of these directional indicators can be combined with ADX for a complete trading system.

It should be kept in mind that Wilder was a commodity and currency trader. The examples in his books are based on these instruments, not stocks. This does not mean his indicators cannot be used with stocks. Some stocks have price characteristics similar to commodities, which tend to be more volatile with short and strong trends. Stocks with low volatility may not generate signals based on Wilder's parameters. Chartists will likely need to adjust the indicator settings or the signal parameters according to the characteristics of the security.

#### Further information <a href="#further-information_3" id="further-information_3"></a>

<http://de.wikipedia.org/wiki/Average_Directional_Movement_Index>

#### Usage <a href="#usage_4" id="usage_4"></a>

```csharp
ADX(int period)
ADX(IDataSeries inSeries, int period)
ADX(int period)[int barsAgo]
ADX(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_4" id="return-value_4"></a>

**double**

When using this method with an index (e.g. **ADX**(20)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_3" id="parameters_3"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculation

#### Visualization <a href="#visualization_4" id="visualization_4"></a>

#### Example <a href="#example_4" id="example_4"></a>

```csharp
//Output of the current value of a 20 period ADX
Print("Value of the ADX: " + ADX(20)[0]);
```


# Average Directional Movement Rating (ADXR)

#### Description <a href="#description_5" id="description_5"></a>

The ADXR is the ADX indicator plus the ADX from n days ago divided by 2. Written as an equation, it looks like this: (current ADX + ADX n days ago) / 2.

#### Interpretation <a href="#interpretation_5" id="interpretation_5"></a>

The oscillator moves along a guiding line that typically has a value of 20. When the ADXR rises above 20, a trend exists. If the ADXR is below 20, no trend exists and the market is moving sideways. Welles Wilder recommends buying into the market at a value of 25 and higher, and holding the position as long as the value remains above 20.

#### Usage <a href="#usage_5" id="usage_5"></a>

```csharp
ADXR(int interval, int period)
ADXR(IDataSeries inSeries, int interval, int period)
ADXR(int interval, int period)[int barsAgo]
ADXR(IDataSeries inSeries, int interval, int period)[int barsAgo]
```

#### Return value <a href="#return-value_5" id="return-value_5"></a>

**double**

When using this method with an index (e.g. **ADXR**(10, 14)\[**int** barsAgo]), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_4" id="parameters_4"></a>

inSeries Input data series for the indicator

interval Interval between the first ADX value and the current ADX value

period Number of bars included in the calculation

#### Visualization <a href="#visualization_5" id="visualization_5"></a>

![Average Directional Movement Rating (ADXR)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ADXR.jpg)

#### Example <a href="#example_5" id="example_5"></a>

```csharp
//Output of the current value of the ADXR
Print("Value of the ADXR: " + ADXR(10, 14)[0]);
```


# Average True Range (ATR)

#### Description & Interpretation <a href="#description-interpretation" id="description-interpretation"></a>

The Average True Range (ATR), which was developed by J. Welles Wilder, is an indicator that measures volatility. As is true for most of his indicators, Wilder designed the ATR with commodities and daily prices in mind. Commodities are often more volatile than stocks, and frequently experience gaps and limit moves, which happen when a commodity opens up or down its maximum allowed move for the session. A volatility formula that was based on the high-low range only would be unable to capture volatility from gap or limit moves. Wilder, therefore, developed the Average True Range to capture this "missing" volatility. Keep in mind that ATR does not provide an indication of price direction, but merely volatility.

The ATR is featured in Wilder’s 1978 book, New Concepts in Technical Trading Systems, which also goes into detail about the Parabolic SAR, RSI and the Directional Movement Concept (ADX). Despite having been developed before the computer age, Wilder's indicators are equally functional today and remain extremely popular.

The starting point for Wilder was a concept called **True Range (TR)**, which is defined as the greatest of the following: - Method 1: current high minus the current low - Method 2: current high minus the previous close (absolute value) - Method 3: current Low minus the previous close (absolute value)

Absolute values are used for ensuring positive numbers, since Wilder was interested in measuring the distance between two points, not the direction. If the current period's high is above the prior period's high and the low is below the prior period's low, then the current period's high-low range will be used as the True Range. This is an outside day that would use method 1 to calculate the TR, and is quite straightforward. Methods 2 and 3 are used whenever there is a gap or inside day. A gap occurs when the previous close is greater than the current high (indicating a potential gap down or limit move) or the previous close is lower than the current low (indicating a potential gap up or limit move). The image below shows examples of when methods 2 and 3 are appropriate.

#### Further information <a href="#further-information_4" id="further-information_4"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Average_True_Range>

#### Usage <a href="#usage_6" id="usage_6"></a>

```csharp
ATR(int period)
ATR(IDataSeries inSeries, int period)
ATR(int period)[int barsAgo]
ATR(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_6" id="return-value_6"></a>

**double**

When using this method with an index (e.g. **ATR**(14)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_5" id="parameters_5"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculation

#### Visualization <a href="#visualization_6" id="visualization_6"></a>

![Average True Range (ATR)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ATR.jpg)

#### Example <a href="#example_6" id="example_6"></a>

```csharp
//Output of the current value of a 14 period ATR
Print("The current ATR value is: " + ATR(14)[0]);
```


# BBBreakOutSpeed

#### Description <a href="#description_6" id="description_6"></a>

Shows the change in the width of the Bollinger Bands in comparison to the width of the Bollinger Bands of the previous bar. Negative (red) means that the Bollinger Bands are drawing together. (Larger than SignalSize -> Short, characterized by a more intense red) Positive (green) means that the Bollinger Bands are diverging. (Larger than SignalSize -> Long, characterized by a more intense green)

#### Usage <a href="#usage_7" id="usage_7"></a>

```csharp
BBBreakOutSpeed(double bandsDeviation, int bandsPeriod, int signalsize)
BBBreakOutSpeed(IDataSeries inSeries, double bandsDeviation, int bandsPeriod, int signalsize)
BBBreakOutSpeed(double bandsDeviation, int bandsPeriod, int signalsize)[int barsAgo]
BBBreakOutSpeed(IDataSeries inSeries, double bandsDeviation, int bandsPeriod, int signalsize)[int barsAgo]
```

#### Return value <a href="#return-value_7" id="return-value_7"></a>

**double**

When using this method with an index (e.g. **BBBreakOutSpeed**(5)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_6" id="parameters_6"></a>

inSeries Input data series for the indicator

bandsDeviation Standard deviation for the Bollinger Bands

bandsPeriod Periods for the Bollinger Bands

signalsize The minimum height of the bar in order for it to produce a signal (long, short)

#### Visualization <a href="#visualization_7" id="visualization_7"></a>

![BBBreakOutSpeed](https://agenatrader.github.io/AgenaIndicator-documentation/media/BBBreakOutSpeed.jpg)

#### Example <a href="#example_7" id="example_7"></a>

```csharp
//If the width between the Bollinger Bands (standard deviation 2, period 20) has significantly (value > 15) increased in comparison to the previous period, a long position is opened.

if(BBBreakOutSpeed(2, 20, 15).BandWidthEntrySignalBuffer[0] != 0)
{
    OpenLong("BBBreakOutSpeedLong");
}
//If the width between the Bollinger Bands (standard deviation 2, period 20) has significantly (value > 15) decreased in comparison to the previous period, a short position is opened.

if(BBBreakOutSpeed(2, 20, 15).BandWidthExitSignalBuffer[0] != 0)
{
    OpenShort("BBBreakOutSpeedShort");
}
```


# Balance of Power (BOP)

#### Description <a href="#description_7" id="description_7"></a>

The developer of the Balance of Power indicator was Igor Livshin, who came up with the BOP in August 2001. The BOP indicator represents the strength of the buyers (bulls) vs. the sellers (bears), and oscillates between -100 and 100. The calculation of the BOP = (close - open) / (high - low).

#### Interpretation <a href="#interpretation_6" id="interpretation_6"></a>

A directional change of the BOP can be interpreted as a warning signal and will generally be followed by a price change.

#### Usage <a href="#usage_8" id="usage_8"></a>

```csharp
BOP(int smooth)
BOP(IDataSeries inSeries, int smooth)
BOP(int smooth)[int barsAgo]
BOP(IDataSeries inSeries, int smooth)[int barsAgo]
```

#### Return value <a href="#return-value_8" id="return-value_8"></a>

**double**

When using this method with an index (e.g. **BOP**(5)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_7" id="parameters_7"></a>

inSeries Input data series for the indicator

smooth Settings for the smoothing

#### Visualization <a href="#visualization_8" id="visualization_8"></a>

![Balance of Power (BOP)](https://agenatrader.github.io/AgenaIndicator-documentation/media/BOP.jpg)

#### Example <a href="#example_8" id="example_8"></a>

```csharp
//Output of the value for the BOP with a smoothing of 5 periods
Print("The Balance of Power value is: " + BOP(5));
```


# Bollinger Bands

#### Description & Interpretation <a href="#description-interpretation_1" id="description-interpretation_1"></a>

Bollinger Bands®, which were developed by John Bollinger, are volatility bands that are placed above and below a moving average. The volatility is based on the standard deviation, which fluctuates as volatility increases and decreases. An increase in volatility causes the bands to automatically widen, and a decrease in volatility causes them to automatically narrow. The Bollinger Bands’ dynamic nature means that they can also be used on different securities with the standard settings. When it comes to signals, Bollinger Bands can be used to identify M-Tops and W-Bottoms, or for determining a trend’s strength.

**Bollinger Bands are made up of a middle band with two outer bands.** The middle band is a simple moving average that is normally set to 20 periods. The reason a simple moving average is used is that the standard deviation formula also uses a simple moving average. The look-back period for the standard deviation is the same as for the simple moving average. The outer bands are generally set 2 standard deviations above and below the middle band, but settings can be adjusted to suit the characteristics of specific securities or trading styles. Bollinger recommends making small, incremental adjustments to the standard deviation multiplier. Changing the number of periods for the moving average also has an effect on the number of periods used to calculate the standard deviation, which is why only small adjustments are required for the standard deviation multiplier. An increase in the moving average period would also automatically increase the number of periods used for calculating the standard deviation, as well as warranting an increase in the standard deviation multiplier. With a 20-day SMA and 20-day Standard Deviation, the standard deviation multiplier is set at 2. Bollinger recommends increasing the standard deviation multiplier to 2.1 for a 50-period SMA and decreasing the standard deviation multiplier to 1.9 for a 10-period SMA. **Bollinger Bands reflect direction with the 20-period SMA and volatility with the upper/lower bands**. This means that they can be used to determine whether prices are relatively high or low. Bollinger maintains that the bands should contain 88-89% of price action, rendering a move outside the bands very significant. Technically, prices are relatively high when above the upper band and relatively low when below the lower band. However, relatively high should not be seen as bearish or as a sell signal. Likewise, relatively low should not be regarded as bullish or as a buy signal, since prices are high or low for a reason. As with other indicators, Bollinger Bands are not designed to be used as a stand-alone tool. Traders should combine Bollinger Bands with basic trend analysis and other indicators to confirm a trend.

The calculation is performed in the following manner:

Upper band = middle band + 2 standard deviations Middle band = average of 20 periods Lower band = middle period – 2 standard deviations

More information can be found here: [*BollingerMTF*](/standard-indicators/bollinger-mtf-multitimeframe), [*Bollinger Percent %B*](/standard-indicators/bollinger-percent-b-b), [*Bollinger Bands Width*](/standard-indicators/bollinger-band-width-bbwidth)

#### Further information <a href="#further-information_5" id="further-information_5"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Bollinger_B%C3%A4nder>

Book "Technische Indikatoren - simplified" by Oliver Paesler (German only)

#### Usage <a href="#usage_9" id="usage_9"></a>

```csharp
Bollinger(double numStdDev, int period)
Bollinger(IDataSeries inSeries, double numStdDev, int period)
//For the upper band
Bollinger(double numStdDev, int period).Upper[int barsAgo]
Bollinger(IDataSeries inSeries, double numStdDev, int period).Upper[int barsAgo]
//For the lower band
Bollinger(double numStdDev, int period).Lower[int barsAgo]
Bollinger(IDataSeries inSeries, double numStdDev, int period).Lower[int barsAgo]
```

#### Return value <a href="#return-value_9" id="return-value_9"></a>

**double**

When using this method with an index (e.g. **Bollinger**(2, 20)\[**int** barsAgo] ), the value of the indicator will be displayed for the referenced bar.

#### Parameters <a href="#parameters_8" id="parameters_8"></a>

inSeries Input data series for the indicator

numStdDev Standard deviation

period Number of bars included in the calculation

#### Visualization <a href="#visualization_9" id="visualization_9"></a>

![Bollinger Bands](https://agenatrader.github.io/AgenaIndicator-documentation/media/BollingerBands.jpg)

#### Example <a href="#example_9" id="example_9"></a>

```csharp
//Output of the value for the upper Bollinger Band
Print("Value of the upper band: " + Bollinger(2, 20).Upper[0]);
//Middle band
Print("Value of the middle band: " + Bollinger(2, 20)[0]);
//Lower band
Print("Value of the lower band: " + Bollinger(2, 20).Lower[0]);
```


# Bollinger Percent B (%b)

#### Description <a href="#description_8" id="description_8"></a>

Bollinger %b is an important indicator that is derived from John Bollinger's original Bollinger Bands indicator. %b represents the location of the most recent close price in relation to the Bollinger Bands as well as to what degree it is above or below any of the bands. The Bollinger Percent B equation can be constructed in the following way: Percent B = ((Close - Bollinger Lower Band) / (Bollinger Upper Band - Bollinger Lower Band)) \* 100. If the close price is the same as the upper Bollinger Band, %b will be 100 (percent). If the close price is the same as the lower Bollinger Band, %b will be 0.0 (percent). A %b value of 50 indicates that the close price is equal to the middle Bollinger Band. What is more, readings above 100 and below 0 show that the close price is outside of the Bollinger Bands by a corresponding percentage of the Bollinger Bandwidth. A %b value of 125 means that the close price is above the upper Bollinger Band by 25% of the Bandwidth, while a %b value of -25 means that the close price is below the lower Bollinger Band by 25% of the Bandwidth.

See [*Bollinger Bands*](/standard-indicators/bollinger-bands), [*BBWidth*](/standard-indicators/bollinger-band-width-bbwidth)

**An additional application: normalizing indicators**

Bollinger bands, and therefore the %b indicator, can be applied not only to the prices of stocks, futures etc., but also to time series with fundamental data, volume data and other indicators. This is particularly interesting when you need to know whether a value is relatively high or low – in this case, the %b indicator offers you a different perspective. If you wish to find out whether the volume of a stock is exceedingly high or low, you can simply apply it to the volume data. John Bollinger regards the application of the %b onto other indicators as one of the most important aspects of the indicator. If you wish to normalize an indicator with %b, it is important to first calculate the indicator (e.g. the RSI) with the help of the %b for the calculation of the indicator instead of the price data. The application of the %b essentially works in the same way as the application of Bollinger bands onto the indicator itself. The intersection points between the bands and the indicators will therefore be 1 and 0. In principle, the relative position of the original indicator is displayed in relation to its upper and lower bands. This means that the boundaries of the original indicator will be removed. John Bollinger himself wrote: “You’re defining a high or low point on a relative basis, this may allow you to gain a deeper insight and understanding not provided by traditional indicators and guidelines.” John Bollinger provides several parameters for the %b calculation, such as 40-day periods and a factor of 2.0 for a 9-day RSI, and a 50-day period with a factor of 2.1 for the calculation of %b.

(Sources: Oliver Paesler: "Technische Indikatoren - simplified" and John Bollinger: "Bollinger Bänder")

(Source: *tradesignalonline*)

#### Further information <a href="#further-information_6" id="further-information_6"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Bollinger_B%C3%A4nder>

Book "Technische Indikatoren - simplified" by Oliver Paesler (German only)

#### Usage <a href="#usage_10" id="usage_10"></a>

```csharp
BollingerPercentB(int period, double numStdDev)
BollingerPercentB(IDataSeries inSeries, int period, double numStdDev)
BollingerPercentB(int period, double numStdDev) [int barsAgo]
BollingerPercentB(IDataSeries inSeries, int period, double numStdDev)[int barsAgo]
```

#### Return value <a href="#return-value_10" id="return-value_10"></a>

**double**

When using this method with an index (e.g. **BollingerPercentB**(20, 2)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_9" id="parameters_9"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculation

numStdDev Standard deviation

#### Visualization <a href="#visualization_10" id="visualization_10"></a>

![Bollinger Percent B (%b)](https://agenatrader.github.io/AgenaIndicator-documentation/media/BollingerPercentB.jpg)

#### Example <a href="#example_10" id="example_10"></a>

```csharp
//Output for the value of Bollinger %B
Print("Value of the Bollinger Percent B is: " + BollingerPercentB(20, 2)[0]);
```


# Bollinger Band Width (BBWidth)

#### Description <a href="#description_9" id="description_9"></a>

This indicator is derived from Bollinger Bands. John Bollinger refers to Bollinger Band Width as one of two indicators that one can derive from Bollinger Bands; the other indicator is %B. The Band Width measures the percentage difference between the upper and the lower band. It decreases as Bollinger Bands narrow, and increases as they widen. Since Bollinger Bands are based on the standard deviation, falling Band Width reflects decreasing volatility and rising Band Width reflects the opposite.

#### Interpretation <a href="#interpretation_7" id="interpretation_7"></a>

John Bollinger uses the Band Width to recognize rising and falling trends. Most trends have their origins within sideway market movements that generally have a low volatility. If a breakout is accompanied by a sudden rise in the Band Width, this means that there is definite support for the move.

#### Further information <a href="#further-information_7" id="further-information_7"></a>

VTAD: [*http://vtadwiki.vtad.de/index.php/Bollinger\_B%C3%A4nder*](http://vtadwiki.vtad.de/index.php/Bollinger_B%C3%A4nder)

Book "Technische Indikatoren - simplified" by Oliver Paesler (German only)

#### Usage <a href="#usage_11" id="usage_11"></a>

```csharp
BBWidth(double numStdDev, int period)
BBWidth(IDataSeries inSeries, double numStdDev, int period)
BBWidth(double numStdDev, int period)[int barsAgo]
BBWidth(IDataSeries inSeries, double numStdDev, int period)[int barsAgo]

//For the value of the upper Band Width
BBWidth(double numStdDev, int period).BandWidth
BBWidth(IDataSeries inSeries, double numStdDev, int period).BandWidth
BBWidth(double numStdDev, int period).BandWidth[int barsAgo]
BBWidth(IDataSeries inSeries, double numStdDev, int period).BandWidth[int barsAgo]

//For the value of the trigger line (threshold)
BBWidth(double numStdDev, int period).Threshold
BBWidth(IDataSeries inSeries, double numStdDev, int period).Threshold
BBWidth(double numStdDev, int period).Threshold[int barsAgo]
BBWidth(IDataSeries inSeries, double numStdDev, int period).Threshold[int barsAgo]
```

#### Return value <a href="#return-value_11" id="return-value_11"></a>

**double**

When using the method with an index (e.g. **BBWidth**(2, 20)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_10" id="parameters_10"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculation

numStdDev Standard deviation

#### Visualization <a href="#visualization_11" id="visualization_11"></a>

![Bollinger Band Width (BBWidth)](https://agenatrader.github.io/AgenaIndicator-documentation/media/BBWidth.jpg)

#### Example <a href="#example_11" id="example_11"></a>

```csharp
//Output for the values of Bollinger Band Width
Print("The value of the Bollinger Band Width is: " + BBWidth(2, 20).BandWidth[0]);
//Output for the values for the signal line
Print("The value of the signal line is: " + BBWidth(2, 20).Threshold[0]);
```


# Bollinger MTF (MultiTimeFrame)

#### Description <a href="#description_10" id="description_10"></a>

The Bollinger MTF is the multi-timeframe version of the Bollinger Bands, and its main use is in intraday trading. Multi-timeframe means that the indicator is calculated in a separate timeframe than that which is displayed in the chart. With the standard Bollinger band indicator, displaying an hourly Bollinger band in a 5-minute timeframe would not be possible – this is the point at which the MTF becomes useful. BollingerMTF can only be used for display in the chart and cannot be applied/implemented in AgenaScript.

#### Visualization <a href="#visualization_12" id="visualization_12"></a>

The image shows a 5-minute chart with a 60-minute Bollinger band

![Bollinger MTF (MultiTimeFrame)](https://agenatrader.github.io/AgenaIndicator-documentation/media/BollingerMTF.jpg)


# BuySellPressure

#### Description <a href="#description_11" id="description_11"></a>

The BuySellPressure indicator displays the buy or sell pressure for the current bar. Furthermore, these trades are classified as "buy" or “sell”. For this classification, a "buy" is assumed any time the transaction has occurred at or above the ask. Inside trades are not taken into account.

**Caution: This is a real-time indicator. It will only work on and with real-time data and cannot therefore be used for historical information.**

**When the properties dialog for the indicator is open and changes are made, then the indicator must be reloaded. Doing so will delete all previously accumulated data.**

See [*BuySellVolume*](/standard-indicators/buysellvolume).

#### Usage <a href="#usage_12" id="usage_12"></a>

```csharp
BuySellPressure()
BuySellPressure(IDataSeries inSeries)

//For the values of buy pressure
BuySellPressure().BuyPressure[int barsAgo]
BuySellPressure(IDataSeries inSeries).BuyPressure[int barsAgo]

//For the values of sell Pressure
BuySellPressure().SellPressure[int barsAgo]
BuySellPressure(IDataSeries inSeries).SellPressure[int barsAgo]
```

#### Return value <a href="#return-value_12" id="return-value_12"></a>

**double**

When using this method with an index (e.g. **BuySellPressure**().BuyPressure\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

**Caution:** **If BuySellPressure is used with EoD data, the value 50 will always be outputted.** - BuySellPressure().SellPressure\[0] = 50 - BuySellPressure().SellPressure\[0] = 50

#### Parameters <a href="#parameters_11" id="parameters_11"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization_13" id="visualization_13"></a>

![BuySellPressure](https://agenatrader.github.io/AgenaIndicator-documentation/media/BuySellPressure.jpg)

#### Example <a href="#example_12" id="example_12"></a>

```csharp
protected override void OnInit()
{
  BuySellPressure().CalculateOnClosedBar = false;
}

protected override void OnCalculate()
{
  if (Close[0] > DonchianChannel(20).Upper[5])
  {
    if (IsHistoricalMode || BuySellPressure().BuyPressure[0] > 70)
    OpenLong();
  }
}
```


# BuySellVolume

#### Description <a href="#description_12" id="description_12"></a>

This indicator shows us the current buy or sell pressure based on the volume. For this, trades are classified as "buy" or "sell", whereby for the classification, a "buy" is assumed any time the transaction is executed at or above the ask. A transaction at or below the bid is considered a "sell".

**Caution: This is a real-time indicator and will not work with historical data.**

Similar conditions as with the [*BuySellPressure*](/standard-indicators/buysellpressure) apply.

#### Usage <a href="#usage_13" id="usage_13"></a>

```csharp
BuySellVolume BuySellVolume()
BuySellVolume BuySellVolume(IDataSeries inSeries)
```

#### Return value <a href="#return-value_13" id="return-value_13"></a>

**double**

When using this method with an index (e.g. **BuySellVolume**().BuyVolume\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameter <a href="#parameter_1" id="parameter_1"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization_14" id="visualization_14"></a>

![BuySellVolume](https://agenatrader.github.io/AgenaIndicator-documentation/media/image15.png)

#### Example <a href="#example_13" id="example_13"></a>

```csharp
//Output for the BuySellVolume
Print("The BuySellVolume is: " + BuySellVolume()[0]);
```


# CandleStickPattern

#### Description <a href="#description_13" id="description_13"></a>

The CandleStickPattern indicator looks for specific candlestick formations.

#### Further information <a href="#further-information_8" id="further-information_8"></a>

Explanations of the formations and their interpretations can be found here: <http://en.wikipedia.org/wiki/Candlestick_pattern>

#### Usage <a href="#usage_14" id="usage_14"></a>

```csharp
CandleStickPattern(CandleStickPattern pattern, int trendStrength)
CandleStickPattern(IDataSeries input, CandleStickPattern pattern, int trendStrength)
CandleStickPattern(CandleStickPattern pattern, int trendStrength)[int barsAgo]
CandleStickPattern(IDataSeries input, CandleStickPattern pattern, int trendStrength)[int barsAgo]
```

#### Return value <a href="#return-value_14" id="return-value_14"></a>

**double**

0 – Pattern not existent 1 – Pattern existent

When using this method with an index (e.g. **CandleStickPattern**(...)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_12" id="parameters_12"></a>

|               |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| InSeries      | Input data series for the indicator                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| pattern       | <p>Possible values are:<br>CandleStickPattern.BearishBeltHold,<br>CandleStickPattern.BearishEngulfing,<br>CandleStickPattern.BearishHarami,<br>CandleStickPattern.BearishHaramiCross,<br>CandleStickPattern.BullishBeltHold,<br>CandleStickPattern.BullishEngulfing,<br>CandleStickPattern.BullishHarami,<br>CandleStickPattern.BullishHaramiCross,<br>CandleStickPattern.DarkCloudCover,<br>CandleStickPattern.Doji,<br>CandleStickPattern.DownsideTasukiGap,<br>CandleStickPattern.EveningStar,<br>CandleStickPattern.FallingThreeMethods,<br>CandleStickPattern.Hammer,<br>CandleStickPattern.HangingMan,<br>CandleStickPattern.InvertedHammer,<br>CandleStickPattern.MorningStart,<br>CandleStickPattern.PiercingLine,<br>CandleStickPattern.RisingThreeMethods,<br>CandleStickPattern.ShootingStar,<br>CandleStickPattern.StickSandwich,<br>CandleStickPattern.ThreeBlackCrows,<br>CandleStickPattern.ThreeWhiteSoldiers,<br>CandleStickPattern.UpsideGapTwoCrows,<br>CandleStickPattern.UpsideTasukiGap</p> |
| trendStrength | Signifies the number of bars to the left and right of the swing high or swing low that are used to identify a trend. The value 0 turns off the search, meaning that the only thing searched for is chart patterns.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

#### Visualization <a href="#visualization_15" id="visualization_15"></a>

![CandleStickPattern](https://agenatrader.github.io/AgenaIndicator-documentation/media/CandleStickPattern.jpg)

#### Example <a href="#example_14" id="example_14"></a>

```csharp
if (CandelStickPattern(CandleStickPattern.ShootingStar, 5)[0] == 1)
Print("Pattern ShootingStar found!");
```


# ChaikinMoneyFlow (CMF)

#### Description <a href="#description_14" id="description_14"></a>

Marc Chaikin was the one to develop the Chaikin Money Flow Index, which is a volume indicator that tries to find an answer to the following question: Where is the money flowing into? Into the stock = accumulation, and out of the stock = distribution. Clearly, this applies not only to stocks/shares but also to other instruments. With this, Chaikin attempts to expand on and improve the On-Balance Volume that was developed by Granville. Using the CMF, the position of the closing price within the trading range is placed in relation to the volume. What this essentially means is that the trading volume is multiplied by the price. The trading volume displays the amount of money that has “flowed” into the stock or has been “removed” from the stock; the indicator simply displays whether it has been accumulated (buying pressure) or removed (distribution).

#### Interpretation <a href="#interpretation_8" id="interpretation_8"></a>

The CMF oscillates around the zero line and is shown in a separate window with an open scale. Should the CMF be located above the zero line, then it can be interpreted as accumulation. If higher highs are being created, then the buying pressure is increasing. The reverse is true for the selling pressure. The Chaikin Money Flow should always be used in combination with other methods of technical analysis.

#### Further information <a href="#further-information_9" id="further-information_9"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Chaikin_Money_Flow>

#### Usage <a href="#usage_15" id="usage_15"></a>

```csharp
ChaikinMoneyFlow(int period)
ChaikinMoneyFlow(IDataSeries inSeries, int period)
ChaikinMoneyFlow(int period)[int barsAgo]
ChaikinMoneyFlow(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_15" id="return-value_15"></a>

**double**

When using this method with an index (e.g. **ChaikinMoneyFlow**(21)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_13" id="parameters_13"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculation

#### Visualization <a href="#visualization_16" id="visualization_16"></a>

![ChaikinMoneyFlow (CMF)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ChaikinMoneyFlow.jpg)

#### Example <a href="#example_15" id="example_15"></a>

```csharp
//Output for the Money Flow value
Print("The Chaikin Money Flow value is: " + ChaikinMoneyFlow(21)[0]);
```


# Chaikin Oscillator

#### Description <a href="#description_15" id="description_15"></a>

The Chaikin Oscillator is a volume indicator that lets the trader know whether new highs are also accompanied by new volumes. This oscillator is a simple MACD that is applied to the accumulation/distribution line. Hereby, the difference between a 3-day exponential moving average and a 10-day exponential smoothed average for the accumulation/distribution line is calculated.

#### Interpretation <a href="#interpretation_9" id="interpretation_9"></a>

The interpretation of the Chaikin Oscillator is similar to the principle of the accumulation/distribution. All an oscillator does is show the changes in liquidity for the instrument.

#### Usage <a href="#usage_16" id="usage_16"></a>

```csharp
ChaikinOscillator(int fast, int slow)
ChaikinOscillator(IDataSeries inSeries, int fast, int slow)
ChaikinOscillator(int fast, int slow)[int barsAgo]
ChaikinOscillator(IDataSeries inSeries, int fast, int slow)[int barsAgo]
```

#### Return value <a href="#return-value_16" id="return-value_16"></a>

**double**

When using this method with an index (e.g. **ChaikinOscillator**(3, 10)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_14" id="parameters_14"></a>

inSeries Input data series for the indicator

fast Number of bars included in the calculation for the fast EMA

slow Number of bars included in the calculation for the slow EMA

#### Visualization <a href="#visualization_17" id="visualization_17"></a>

![Chaikin Oscillator](https://agenatrader.github.io/AgenaIndicator-documentation/media/ChaikinOscillator.jpg)

#### Example <a href="#example_16" id="example_16"></a>

```csharp
//Output for the oscillator for the fast and slow values of 3 and 10
Print("The Chaikin Oscillator value is: " + ChaikinOscillator(3, 10)[0]);
```


# ChaikinVolatility (CVL)

#### Description <a href="#description_16" id="description_16"></a>

The Chaikin Volatility Indicator is one of a few indicators that are designed to try and measure price movement fluctuations. Chaikin takes the daily price range (daily high minus daily low) as the fundamental measure of volatility. With this indicator, a widening range is, by implication, associated with a higher volatility.

#### Interpretation <a href="#interpretation_10" id="interpretation_10"></a>

The indicator oscillates around the zero line and fluctuates between a scale of +100 to -100. It can be used on a daily chart as well as on a weekly or monthly chart. All values above the zero line represent rising volatility, and the gradient of the rise implies the seriousness of potential floors forming. The Chaikin Volatility is not specifically used to define exact signals, but is considered as more of an assisting tool in the trading system.

#### Usage <a href="#usage_17" id="usage_17"></a>

```csharp
ChaikinVolatility(int fast, int slow)
ChaikinVolatility(IDataSeries inSeries, int fast, int slow)
ChaikinVolatility(int fast, int slow)[int barsAgo]
ChaikinVolatility(IDataSeries inSeries, int fast, int slow)[int barsAgo]
```

#### Return value <a href="#return-value_17" id="return-value_17"></a>

**double**

When using this method with an index (e.g. **ChaikinVolatility**(14)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameters <a href="#parameters_15" id="parameters_15"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_18" id="visualization_18"></a>

![ChaikinVolatility (CVL)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ChaikinVolatility.jpg)

#### Example <a href="#example_17" id="example_17"></a>

```csharp
//Chaikin output for a period of 14
Print("The value of the Chaikin Volatility is: " + ChaikinVolatility(14)[0]);
```


# Chande Momentum Oscillator (CMO)

#### Description <a href="#description_17" id="description_17"></a>

The CMO is one of several indicators created by the technical analyst Tushar Chande; it is a technical momentum indicator. This indicator arises from calculating the difference between the total of all recent gains and the total of all recent losses, and then dividing this result by the total of all price movement over the given period. This oscillator shares similarities with other momentum indicators such as the Relative Strength Index and the Stochastic Oscillator, because it is also range-bound (+100 and -100).

#### Interpretation <a href="#interpretation_11" id="interpretation_11"></a>

**The security is deemed overbought when the momentum oscillator is above +50 and oversold when it is below -50. Many technical traders add a nine-period moving average to this oscillator to act as a signal line. Bullish signals are generated when the oscillator crosses above the signal, and bearish signals are generated when the oscillator crosses down through the signal.**

#### Further information <a href="#further-information_10" id="further-information_10"></a>

<http://www.boersenwissen.de/content/content_bin/cont_bin18.html>

#### Usage <a href="#usage_18" id="usage_18"></a>

```csharp
CMO(int period)
CMO(IDataSeries inSeries, int period)
CMO(int period)[int barsAgo]
CMO(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_18" id="return-value_18"></a>

**double**

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

#### Parameters <a href="#parameters_16" id="parameters_16"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_19" id="visualization_19"></a>

![Chande Momentum Oscillator (CMO)](https://agenatrader.github.io/AgenaIndicator-documentation/media/CMO.jpg)

#### Example <a href="#example_18" id="example_18"></a>

```csharp
//Output for the value of the Chande Momentum Oscillator
Print("The current value for the Chande Momentum Oscillator is: " + CMO(14)[0]);
```


# Climactic Distance

#### Description <a href="#description_18" id="description_18"></a>

The Climactic Distance indicator was invented and developed by Gilbert Kreuzthaler, CEO of Include IT GmbH and founder of AgenaTrader.com. This indicator is used in the Location Point Trading system. It calculates the median course of the current and historical candle at a distance to the simple moving average (SMA) of the last 20 periods. Additionally, it also measures the average course deviation within the last 80 periods. If the median course exceeds the top or bottom course deviation, the market is deemed climactic, and this influences the trading decisions made in Location Point Trading.

#### Calcualtion <a href="#calcualtion" id="calcualtion"></a>

Black line in the middle: SMA 20 Green moving line: Median Kurs Red upper and lower line: Average course deviation oft he last 80 periods.

#### More information <a href="#more-information" id="more-information"></a>

<https://www.facebook.com/Location-Point-Trading-344217482287592/?fref=ts>

#### Usage <a href="#usage_19" id="usage_19"></a>

```csharp
ClimacticDistance(int sMAPeriod, int thresholdPercent)
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent)
ClimacticDistance(int period, int tresholdPercent, Color climacticColor)
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent, Color climacticColor)
//Upper band
ClimacticDistance(int sMAPeriod, int thresholdPercent).Upper[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent).Upper[int barsAgo]
ClimacticDistance(int period, int tresholdPercent, Color climacticColor).Upper[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent, Color climacticColor).Upper[int barsAgo]
//Lower band
ClimacticDistance(int sMAPeriod, int thresholdPercent).Lower[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent).Lower[int barsAgo]
ClimacticDistance(int period, int tresholdPercent, Color climacticColor).Lower[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent, Color climacticColor).Lower[int barsAgo]

//MovingAverage
ClimacticDistance(int sMAPeriod, int thresholdPercent).MovingAverage[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent).MovingAverage[int barsAgo]
ClimacticDistance(int period, int tresholdPercent, Color climacticColor).MovingAverage[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent, Color climacticColor).MovingAverage[int barsAgo]
//Distance
ClimacticDistance(int sMAPeriod, int thresholdPercent).Distance[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent).Distance[int barsAgo]
ClimacticDistance(int period, int tresholdPercent, Color climacticColor).Distance[int barsAgo]
ClimacticDistance(IDataSeries InSeries, int sMAPeriod, int thresholdPercent, Color climacticColor).Distance[int barsAgo]
```

#### Return value <a href="#return-value_19" id="return-value_19"></a>

**double**

#### Parameters <a href="#parameters_17" id="parameters_17"></a>

Int

#### Visualization <a href="#visualization_20" id="visualization_20"></a>

![Climactic Distance](https://agenatrader.github.io/AgenaIndicator-documentation/media/ClimacticDistance.jpg)

#### Example <a href="#example_19" id="example_19"></a>

```csharp
//Output of the value for the Upper climactic distance line
Print(“Value of the upper band: “ + ClimacticDistnance(20, 80).Upper[0]);
//Output of the value for the Lower climactic distance line
Print(“Value of the upper band: “ + ClimacticDistnance(20, 80).Lower[0]);
//Output of the value for the Distance climactic distance line
Print(“Value of the upper band: “ + ClimacticDistnance(20, 80).Distance[0]);
//Output of the value for the Moving Average climactic distance line
Print(“Value of the upper band: “ + ClimacticDistnance(20, 80).MovingAverage[0]);
```


# Commodity Channel Index (CCI)

#### Description <a href="#description_19" id="description_19"></a>

The Commodity Channel Index (CCI), which was created by Donald Lambert and actually featured in Commodities magazine in 1980, is a versatile indicator that can be used for identifying a new trend or as a warning of extreme conditions. Lambert originally developed the CCI as a means to identify cyclical turns in commodities – however, the indicator can also successfully be applied to ETFs, indices, stocks and various other securities. In general, what CCI does is to measure the current price level relative to an average price level over a specified period of time. When prices are well above their average, CCI is relatively high. When prices are far below their average, CCI is relatively low. This is how CCI can be used for identifying overbought and oversold levels.

#### Interpretation <a href="#interpretation_12" id="interpretation_12"></a>

CCI measures the difference between a securitys price change and its average price change. High positive readings indicate that prices are well above their average, which is a show of strength. Low negative readings indicate that prices are well below their average, which is a show of weakness.

The Commodity Channel Index (CCI) can be used as either a coincident or leading indicator. As a coincident indicator, surges above +100 reflect strong price action that can signal the start of an uptrend. Plunges below -100 reflect weak price action that can signal the start of a downtrend.

As a *leading indicator*, *momentum oscillators*, chartists can look for overbought or oversold conditions that may foreshadow a mean reversion. Similarly, bullish and bearish divergences can be used to detect early momentum shifts and anticipate trend reversals.

#### Further information <a href="#further-information_11" id="further-information_11"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Commodity_Channel_Index>

#### Usage <a href="#usage_20" id="usage_20"></a>

```csharp
CCI(int period)
CCI(IDataSeries inSeries, int period)
CCI(int period)[int barsAgo]
CCI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_20" id="return-value_20"></a>

**double**

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

#### Parameters <a href="#parameters_18" id="parameters_18"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_21" id="visualization_21"></a>

![Commodity Channel Index (CCI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/CCI.jpg)

#### Example <a href="#example_20" id="example_20"></a>

```csharp
//Output for the CCI value calculated using 14 periods
Print("The value of the Commodity Channel Index is: " + CCI(14));
```


# Directional Movement (DM)

#### Description <a href="#description_29" id="description_29"></a>

The Directional Movement indicator is almost identical to the ADX, with the only difference that the +DM and -DM values are also calculated. These values are then later on used for the DMI.

#### Interpretation <a href="#interpretation_14" id="interpretation_14"></a>

The Directional Movement indicator is positive when the difference between the highs is at its largest.

#### Further information <a href="#further-information_13" id="further-information_13"></a>

See: Directional Movement Index ([*DMI*](/standard-indicators/directional-movement-index-dmi))

#### Usage <a href="#usage_30" id="usage_30"></a>

```csharp
DM(int period)
DM(IDataSeries inSeries, int period)
DM(int period)[int barsAgo]
DM(IDataSeries inSeries, int period)[int barsAgo]
//For the value of +DM
DM(int period).DiPlus[int barsAgo]
DM(IDataSeries inSeries, int period).DiPlus[int barsAgo]
//For the value of -DM
DM(int period).DiMinus[int barsAgo]
DM(IDataSeries inSeries, int period).DiMinus[int barsAgo]
```

#### Return value <a href="#return-value_30" id="return-value_30"></a>

**double**

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

#### Parameters <a href="#parameters_27" id="parameters_27"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_31" id="visualization_31"></a>

![Directional Movement (DM)](https://agenatrader.github.io/AgenaIndicator-documentation/media/DM.jpg)

#### Example <a href="#example_30" id="example_30"></a>

```csharp
//Output of the DM values
Print("The current +DM value is: " + DM(14).DiPlus[0]);
Print("The current –DM value is: " + DM(14).DiMinus[0]);
```


# Donchian Channel

#### Description <a href="#description_30" id="description_30"></a>

The Donchian channel can also be called the “4-week-rule”; this is how it works: when the current price reaches a peak above the high of the past 4 weeks, a new long position is opened. If a short position is open simultaneously, it is closed. This works vice versa with shorts. The Donchian channel trading system is a purely trend-following system based on the concept “buy when it is strong, sell when it is weak”. The famous “Turtles” also employed this breakout system. This indicator displays the highs and lows of the last n days as lines above and below the price development. 20 days represent 4 weeks.

#### Further information <a href="#further-information_14" id="further-information_14"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Donchian_Channel>

#### Usage <a href="#usage_31" id="usage_31"></a>

```csharp
DonchianChannel(int period)
DonchianChannel(IDataSeries inSeries, int period)

//Upper band
DonchianChannel(int period).Upper[int barsAgo]
DonchianChannel(IDataSeries inSeries, int period).Upper[int barsAgo]

//Middle band
DonchianChannel(int period)[int barsAgo]
DonchianChannel(IDataSeries inSeries, int period)[int barsAgo]

//Lower band
DonchianChannel(int period).Lower[int barsAgo]
DonchianChannel(IDataSeries inSeries, int period).Lower[int barsAgo]
```

#### Return value <a href="#return-value_31" id="return-value_31"></a>

**double**

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

#### Parameters <a href="#parameters_28" id="parameters_28"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_32" id="visualization_32"></a>

![Donchian Channel](https://agenatrader.github.io/AgenaIndicator-documentation/media/DonchianChannel.jpg)

#### Example <a href="#example_31" id="example_31"></a>

```csharp
//Output for the values of the Donchian Channel
Print("The upper band is at: " + DonchianChannel(14).Upper[0]);
Print("The middle band is at: " + DonchianChannel(14)[0]);
Print("The lower band is at: " + DonchianChannel(14).Lower[0]);
```


# Directional Movement Index (DMI)

#### Description <a href="#description_31" id="description_31"></a>

Welles Wilder Jr. developed the Directional Movement concept in 1978. His concept includes the following components:

Directional Movement Index (DMI)

Average Directional Movement Index ([*ADX*](/standard-indicators/average-directional-index-adx))

True Range (TR)

The Directional Movement Index comes before the Average Directional Movement Index. The DMI shows the strengths of the trend-favoring price movements in percentages. Its standard application is the smoothed ADX.

#### Interpretation <a href="#interpretation_15" id="interpretation_15"></a>

The DMI shows the strength of the trend, but not the trend direction. This means that it is particularly suited as a filter for trading systems employing the Parabolic SAR, for example, in order to filter out sideways phases. When the DMI rises (especially above 25), a trend is displayed; anything below that is recognized as a sideways phase. The +DI and the –DI point towards a trend. An uptrend is classified when the +DI is above the –DI. The further apart they drift, the stronger the trend.

#### Further information <a href="#further-information_15" id="further-information_15"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/DMI_-_Directional_Movement_Index>

#### Usage <a href="#usage_32" id="usage_32"></a>

```csharp
DMI(int period)
DMI(IDataSeries inSeries, int period)
DMI(int period)[int barsAgo]
DMI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_32" id="return-value_32"></a>

**double**

When using this method with an index (e.g. **DMI**(20)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_29" id="parameters_29"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_33" id="visualization_33"></a>

![Directional Movement Index (DMI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/DMI.jpg)

#### Example <a href="#example_32" id="example_32"></a>

```csharp
//Output for the DMI
Print("The current DMI value is: " + DMI(20)[0]);
```


# Double Stochastics (DSS)

#### Description <a href="#description_32" id="description_32"></a>

William Blau was the developer of the Double Smoothed Stochastic (DSS), which is a double-smoothed stochastic indicator. After a while, it was improved upon by Walter Bressert as a variation of the double-smoothed stochastic. Smaller changes in the price movements cause this indicator to react more sensitively, and it also produces more signals than the one Blau developed. The Bressert version therefore also illustrates extreme zones more clearly than the Blau version.

Regardless of the various calculation methods used, the DSS always stays within a scale of 0 to 100. The extreme zones in the developed stochastics are the same as for the original stochastics. The upper extreme area is marked at 80, and the lower extreme zone at 20 - these values cannot be changed. For many applications, it is wise to include an additional middle line at 50, and to adapt this to the circumstances as needed.

#### Interpretation <a href="#interpretation_16" id="interpretation_16"></a>

Values above 80 are seen as overbought, and below 20 as oversold. In addition, signals are produced by the signal line’s behavior and movements into and out of the extreme zones.

#### Usage <a href="#usage_33" id="usage_33"></a>

```csharp
DoubleStochastics(int period)
DoubleStochastics(int period)[int barsAgo]
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1)
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1)
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1)[int barsAgo]
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1)[int barsAgo]
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2)
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2)
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2)[int barsAgo]
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2)[int barsAgo]

//For the value of %K
DoubleStochastics(int period).K[int barsAgo]
DoubleStochastics(IDataSeries inSeries, int period).K[int barsAgo]
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1).K[int barsAgo]
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1).K[int barsAgo]
DoubleStochastics(int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2).K[int barsAgo]
DoubleStochastics(IDataSeries inSeries, int period, DoubleStochasticsMode mode, int EMA-Period1, int EMA-Period2).K[int barsAgo]
```

#### Return value <a href="#return-value_33" id="return-value_33"></a>

**double**

When using this method with an index (e.g. **DoubleStochastics**(...)\[**int** barsAgo] or **DoubleStochastics**(...).K\[**int** barsAgo]), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_30" id="parameters_30"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations (default: 10)

mode Method of calculation, possible inSeries are Blau, Blau2, Bressert

EMA-Period1 Periods for the EMA

EMA-Period2 Periods for the second EMA

#### Visualization <a href="#visualization_34" id="visualization_34"></a>

![Double Stochastics (DSS)](https://agenatrader.github.io/AgenaIndicator-documentation/media/DSS.jpg)

#### Example <a href="#example_33" id="example_33"></a>

```csharp
//Output for %K
Print("The value of the DSS Bressert %K is: " + DoubleStochastics(10, DoubleStochasticsMode.Bressert, 2)[0]);
```


# Dynamic Momentum Index (DMIndex)

#### Description <a href="#description_33" id="description_33"></a>

The Dynamic Momentum Index, which was developed by Tushar Chande, is a specific variant of the Relative Strength Index. Chande changed the Dynamic Momentum Index in such a way that, based on various factors, the period settings automatically adjust themselves, which he achieved by coupling it to the RSI in order for a volatility component to be present. The definition of this volatility component is based on a 5-day standard deviation of the closing prices. This, in turn, is then compared to the 10-day average of a 5-day standard deviation.

#### Interpretation <a href="#interpretation_17" id="interpretation_17"></a>

If the Dynamic Momentum Index is showing the overbought area, one speculates on falling prices; if the Dynamic Momentum Index is showing the oversold area, the speculation is on rising prices. Trading in this way makes sense if other indicators such as absCMO are showing a trendless phase, so the point is to trade against the trend. During a strong trend phase, it is recommended to trade in the trend direction; in the phase of an upward trend, one should wait for an oversold situation until a buy signal occurs.

#### Further and more concise information <a href="#further-and-more-concise-information" id="further-and-more-concise-information"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Dynamic_Momentum_Index>

#### Usage <a href="#usage_34" id="usage_34"></a>

```csharp
DMIndex(int smooth)
DMIndex(IDataSeries inSeries, int smooth)
DMIndex(int smooth)[int barsAgo]
DMIndex(IDataSeries inSeries, int smooth)[int barsAgo]
```

#### Return value <a href="#return-value_34" id="return-value_34"></a>

**double**

When using this method with an index (e.g. **DMIndex**(3)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_31" id="parameters_31"></a>

inSeries Input data series for the indicator

smooth Smoothing settings

#### Visualization <a href="#visualization_35" id="visualization_35"></a>

![Dynamic Momentum Index (DMIndex)](https://agenatrader.github.io/AgenaIndicator-documentation/media/DMIindex.jpg)

#### Example <a href="#example_34" id="example_34"></a>

```csharp
//Output of the value for the DMIndex Indicator with a smoothing factor of 3
Print("The current value for the DMIndex is: " + DMIndex(3)[0]);
```


# Ease of Movement (EOM)

#### Description <a href="#description_34" id="description_34"></a>

Ease of Movement (EMV) is a volume-based oscillator created by Richard Arms that constantly moves above and below the zero line. It is intended to measure the "ease" of price movement, as suggested by the name. Arms developed Equivolume charts in order to visually display price ranges and volume. Ease of Movement expands upon Equivolume by quantifying the price/volume relationship and displaying the results in the form of an oscillator. Generally, when the oscillator is in a positive area, prices are advancing with relative ease. On the other hand, when the oscillator is in negative territory, prices are falling with relative ease.

#### Interpretation <a href="#interpretation_18" id="interpretation_18"></a>

When the EOM is moving away from the zero line (marker) then an impulse has begun in that direction. During a breakout onto the opposite side of the zero line, it is recommended to enter with the trend direction.

#### Further information <a href="#further-information_16" id="further-information_16"></a>

[http://www.volumen-analyse.de](http://www.volumen-analyse.de/)

#### Usage <a href="#usage_35" id="usage_35"></a>

```csharp
EaseOfMovement(int smoothing, int volDivisor)
EaseOfMovement(IDataSeries inSeries, int smoothing, int volDivisor)
EaseOfMovement(int smoothing, int volDivisor)[int barsAgo]
EaseOfMovement(IDataSeries inSeries, int smoothing, int volDivisor)[int barsAgo]
```

#### Return value <a href="#return-value_35" id="return-value_35"></a>

**double**

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

#### Parameters <a href="#parameters_32" id="parameters_32"></a>

inSeries Input data series for the indicator

smoothing Smoothing settings

volDivisor For calculation of the box ratio (see “Calculation” below)

#### Visualization <a href="#visualization_36" id="visualization_36"></a>

![Ease of Movement (EOM)](https://agenatrader.github.io/AgenaIndicator-documentation/media/EaseOfMovement.jpg)

#### Calculation <a href="#calculation" id="calculation"></a>

Midpoint = (High + Low) / 2 MidpointMove = Midpoint \[today] – Midpoint \[yesterday] BoxRatio = Volume / (High – Low) Ease = MidpointMove / Box Ratio

#### Example <a href="#example_35" id="example_35"></a>

```csharp
//Output for the values of the EOM line
Print("The value for the Ease of Movement is: " + EaseOfMovement(14, 10000)[0]);
```


# Fisher Transform

### Fisher Transform <a href="#fisher-transform" id="fisher-transform"></a>

#### Description <a href="#description_35" id="description_35"></a>

The physicist John Ehlers created the Fisher Transform in 2002. The intention of the indicator is to show where there are turning points, which can be achieved with the help of the Inverse Fisher Transform. This changes indicators in such a way that the movements are less random, and the signal quality is clearer. The Fisher Transform either stretches or compresses the input values of the function so that the output is very likely to be between -1 and 1. This gives us a clearly identifiable pattern where even indicators such as the RSI become better defined and more precise.

#### Interpretation <a href="#interpretation_19" id="interpretation_19"></a>

A system using the Fisher Transform can be found here: <https://www.prorealtime.com/de/pdf/probacktest.pdf>

#### Parameters <a href="#parameters_33" id="parameters_33"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Return value <a href="#return-value_36" id="return-value_36"></a>

**double**

When using this method with an index (e.g. **FisherTransform**(10)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Usage <a href="#usage_36" id="usage_36"></a>

```csharp
FisherTransform(int period)
FisherTransform(IDataSeries inSeries, int period)
FisherTransform(int period)[int barsAgo]
FisherTransform(IDataSeries inSeries, int period)[int barsAgo]
```

#### Visualization <a href="#visualization_37" id="visualization_37"></a>

![Fisher Transform](https://agenatrader.github.io/AgenaIndicator-documentation/media/FisherTransform.jpg)

#### Example <a href="#example_36" id="example_36"></a>

```csharp
//Output values for the Fisher Transform
Print("The current value for the Fisher Transform is: " + FisherTransform(10)[0]);
```


# Forecast Oscillator (FOSC)

#### Description <a href="#description_36" id="description_36"></a>

The FOSC makes a comparison of the current price against the value returned by the Time Series Forecast study. It is calculated as a percentage ratio of the difference between the close price and the Time Series Forecast value for the previous bar.

When this oscillator displays positive values, it hints that the Time Series Forecast has underestimated the price, whereas negative values suggest that the TSF has overestimated the price. Usually, an SMA also accompanies the Forecast Oscillator line in the search for oscillator reversals.

#### Further information <a href="#further-information_17" id="further-information_17"></a>

FMLabs: <http://www.fmlabs.com/reference/default.htm?url=ForecastOscillator.htm>

#### Parameters <a href="#parameters_34" id="parameters_34"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Return value <a href="#return-value_37" id="return-value_37"></a>

**double**

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

#### Usage <a href="#usage_37" id="usage_37"></a>

```csharp
FOSC(int period)
FOSC(IDataSeries inSeries, int period)
FOSC(int period)[int barsAgo]
FOSC(IDataSeries inSeries, int period)[int barsAgo]
```

#### Visualization <a href="#visualization_38" id="visualization_38"></a>

![Forecast Oscillator (FOSC)](https://agenatrader.github.io/AgenaIndicator-documentation/media/FOSC.jpg)

#### Examples <a href="#examples" id="examples"></a>

```csharp
//Output for the Forecast Oscillator
Print("The current value for the Forecast Oscillator is: " + FOSC(14)[0]);

//Determining the future market direction
if (FOSC(14)[0] > 0)
Print("The FOSC is bigger than zero, which indicates rising price movements.");
```


# HighestHighIndex()

#### Description <a href="#description_37" id="description_37"></a>

The Highest High Index prints the index for the bars with the highest high within a specified number of periods. It is slightly different from the GetSerieHighestValue() function in that it can be visualized within the chart.

See [*HighestHighPrice()*](/standard-indicators/highesthighprice), [*LowestLowPrice()*](/standard-indicators/lowestlowprice), [*LowestLowIndex*](/standard-indicators/lowestlowindex), *GetSerieHighestValue()*, *GetSerieLowestValue()*.

#### Usage <a href="#usage_38" id="usage_38"></a>

```csharp
HighestHighIndex(int BarsBack)
HighestHighIndex(int BarsBack)[int barsAgo]
```

#### Return value <a href="#return-value_38" id="return-value_38"></a>

**double**

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

#### **Parameter** <a href="#parameter_3" id="parameter_3"></a>

BarsBack Number of periods in which the highest high will be searched for

#### Visualization <a href="#visualization_39" id="visualization_39"></a>

![HighestHighIndex()](https://agenatrader.github.io/AgenaIndicator-documentation/media/HighestHighIndex.jpg)

#### Example <a href="#example_37" id="example_37"></a>

```csharp
// How many bars back is the bar with the highest high of the last 14 bars located?
Print("The highest high in the last 14 bars was " + HighestHighIndex(14)[0] + " bars ago.");
```


# HighestHighPrice()

#### Description <a href="#description_38" id="description_38"></a>

Highest High Price shows the highest high achieved within a predefined number of periods.

Unlike the GetSerieHighestValue(), this indicator can be displayed within the chart.

See  [*HighestHighIndex()*,](/standard-indicators/highesthighindex) [*LowestLowPrice()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#lowestlowprice), [*LowestLowIndex*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#lowestlowindex), *GetSerieHighestValue()*, *GetSerieLowestValue()*.

#### Usage <a href="#usage_39" id="usage_39"></a>

```csharp
HighestHighPrice(int BarsBack)
HighestHighPrice(int BarsBack)[int barsAgo]
```

#### Return value <a href="#return-value_39" id="return-value_39"></a>

**double**

When using this method with an index (e.g. **HighestHighPrice**(14)\[**int** barsAgo] ), the value of the indicator will be outputted for the referenced bar.

#### Parameter <a href="#parameter_4" id="parameter_4"></a>

BarsBack Number of periods in which the highest high will be searched for

#### Visualization <a href="#visualization_40" id="visualization_40"></a>

![HighestHighPrice()](https://agenatrader.github.io/AgenaIndicator-documentation/media/HighestHighPrice.jpg)

#### Example <a href="#example_38" id="example_38"></a>

```csharp
// What was the value of the highest high in the last 14 periods?
Print("The highest high for the last 14 bars is " + HighestHighPrice(14)[0]);
```


# IchimokuCloud

#### Description <a href="#description_39" id="description_39"></a>

The Ichimoku Cloud, also called Ichimoku Kinko Hyo, is a very adaptable indicator that defines support and resistance, gauges momentum, identifies trend direction and provides trading signals. Ichimoku Kinko Hyo literally means "one look equilibrium chart". With just one look, traders can identify the trend and search for possible signals in that trend. The indicator was developed by the journalist Goichi Hosoda, and published in his 1969 book. Although the Ichimoku Cloud may appear complicated when looked at on the price chart, it is in fact a simple indicator that can be implemented very well – a tribute to the fact that its inventor was a journalist! What is more, the concepts are easily understandable and the signals well-defined.

**1. Tenkan Sen** – conversion line This is the median value of the 9-period high and the 9-period low. **2. Kinjun Sen** – the baseline This is the midpoint of the 26-period high and low. **3. Chikou Span** – lagging span This is the closing price plotted 26 days in the past. **4. Senkou Span A** – the first leading line This is the midpoint between the conversion line and the baseline. The leading Span A forms one of the two cloud boundaries. It is referred to as leading because it is plotted 26 periods in the future and thus builds the faster cloud boundary. **5. Senkou Span B** – the second leading line This is the midpoint of the 52-day high-low range projected 26 periods into the future, forming the slower cloud boundary. Kumo – cloud The cloud (Kumo) is the area between Senkou Span A and Senkou Span B. This area is highlighted in color, forming a cloud shape.

**Caution:** Because the cloud is drawn “into the future”, it is necessary to shift the time axis to the left in order to view it.

#### Interpretation <a href="#interpretation_20" id="interpretation_20"></a>

Similarly to the smoothing averages, the Ichimoku indicator will create a bullish signal when the Tenkan Sen crosses over the Kinjun Sen from below.

#### Further information <a href="#further-information_18" id="further-information_18"></a>

<http://de.wikipedia.org/wiki/Ichimoku>

<http://www.forexabode.com/technical-analysis/ichimoku-cloud>

<http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:ichimoku_cloud>

<http://www.forexonlinegeheimnisse.com/ichimoku-kinko-hyo-teil-i#top> (Part 1, German)

<http://www.forexonlinegeheimnisse.com/ichimoku-kinko-hyo-teil-ii-das-perfekte-kauf-oder-verkaufssignal#top> (Part 2, German)

#### Usage <a href="#usage_40" id="usage_40"></a>

```csharp
IchimokuCloud(int periodFast, int periodMedium, int periodSlow)
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow)

//TenkanSen
IchimokuCloud(int periodFast, int periodMedium, int periodSlow).TenkanSen[int barsAgo]
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow).TenkanSen[int barsAgo]

//KijunSen
IchimokuCloud(int periodFast, int periodMedium, int periodSlow).KijunSen[int barsAgo]
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow).KijunSen[int barsAgo]

//ChikouSpan
IchimokuCloud(int periodFast, int periodMedium, int periodSlow).ChikouSpan[int barsAgo]
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow).ChikouSpan[int barsAgo]

//SenkouSpanA
IchimokuCloud(int periodFast, int periodMedium, int periodSlow).SenkouSpanA[int barsAgo]
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow).SenkouSpanA[int barsAgo]

//SenkouSpanB
IchimokuCloud(int periodFast, int periodMedium, int periodSlow).SenkouSpanB[int barsAgo]
IchimokuCloud(IDataSeries inSeries, int periodFast, int periodMedium, int periodSlow).SenkouSpanB[int barsAgo]
```

#### Return value <a href="#return-value_40" id="return-value_40"></a>

**double**

When using this method with an index (e.g. **IchimokuCloud**(9,26,52)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_35" id="parameters_35"></a>

inSeries Input data series for the indicator

periodFast Period setting for the Tenkan line. Default: 9

periodMedium Period setting for the Kijun line. Default: 29

periodSlow Number of periods used for the calculation of the Chikou line. Default: 52

#### Visualization <a href="#visualization_41" id="visualization_41"></a>

![IchimokuClo](https://agenatrader.github.io/AgenaIndicator-documentation/media/IchimokuCloud.jpg)


# Keltner Channel

#### Description <a href="#description_41" id="description_41"></a>

Keltner Channels are volatility-based envelopes placed above and below an EMA. This indicator shares similarities with Bollinger Bands, where the bands are set using the standard deviation. Here, instead of using the standard deviation, Keltner Channels use the Average True Range (ATR) to set the channel distance. Typically, the channels are set two Average True Range values above and two ATRs below the 20-day EMA. The EMA determines the direction and the Average True Range dictates the channel width. Keltner Channels form a trend-following indicator that is applied with the aim of identifying reversals with channel breakouts and channel direction. The channels can also be used to spot overbought and oversold levels when the trend is flat. In his 1960 book, *How to Make Money in Commodities,* Chester Keltner featured the "Ten-Day Moving Average Trading Rule," credited as the original version of Keltner Channels. This version started off with a 10-day SMA of the typical price {(H+L+C)/3)} as the center line. The 10-day SMA of the high-low range was added and subtracted to set the upper and lower channel lines respectively. Linda Bradford Raschke then brought in the more recent version of Keltner Channels in the 1980s. Similarly to Bollinger Bands, this new version made use of a volatility-based indicator, Average True Range (ATR), to set channel width. Middle line = 20-day exponential moving average Upper channel line: 20-day EMA + (2x ATR(10)) Lower channel line: 20-day EMA – (2xATR(10))

#### Interpretation <a href="#interpretation_22" id="interpretation_22"></a>

Indicators based on channels, bands and envelopes are designed to encompass most price action. Therefore, moves above or below the channel lines warrant attention because they are relatively rare. Trends often start with strong moves in one direction or another. A surge above the upper channel line shows extraordinary strength, while a plunge below the lower channel line shows extraordinary weakness. Such strong moves can signal the end of one trend and the beginning of another.

With an exponential *moving average*, *average* as their foundation, the Keltner Channels are a trend-following indicator. As with moving averages and trend-following indicators, Keltner Channels lag price action. The direction of the moving average dictates the direction of the channel. In general, a downtrend is present when the channel moves lower, while an uptrend exists when the channel moves higher. The trend is flat when the channel moves sideways.

A channel upturn and break above the upper trend line can signal the start of an uptrend. A channel downturn and break below the lower trend line can signal the start a downtrend. Sometimes a strong trend does not take hold after a channel breakout and prices oscillate between the channel lines. Such trading ranges are marked by a relatively flat moving average. The channel boundaries can then be used to identify overbought and oversold levels for trading purposes.

#### Further information <a href="#further-information_19" id="further-information_19"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Keltner_Channel>

#### Usage <a href="#usage_42" id="usage_42"></a>

```csharp
KeltnerChannel(double offsetMutiplier, int period)
KeltnerChannel(IDataSeries inSeries, double offsetMutiplier, int period)

//Returns midline value
KeltnerChannel(double offsetMutiplier, int period)[int barsAgo]
KeltnerChannel(IDataSeries inSeries, double offsetMutiplier, int period)[int barsAgo]

//Returns upper band value
KeltnerChannel(double offsetMutiplier, int period).Upper[int barsAgo]
KeltnerChannel(IDataSeries inSeries, double offsetMutiplier, int period).Upper[int barsAgo]

//Returns lower band value
KeltnerChannel(double offsetMutiplier, int period).Lower[int barsAgo]
KeltnerChannel(IDataSeries inSeries, double offsetMutiplier, int period).Lower[int barsAgo]
```

#### Return value <a href="#return-value_41" id="return-value_41"></a>

**double**

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

#### Parameters <a href="#parameters_36" id="parameters_36"></a>

inSeries Input data series for the indicator

offsetMultiplier Multiplier for the SMA

period Number of bars included in the calculations

#### Visualization <a href="#visualization_43" id="visualization_43"></a>

![Keltner Channel](https://agenatrader.github.io/AgenaIndicator-documentation/media/KeltnerChannel.jpg)

#### Calculation <a href="#calculation_1" id="calculation_1"></a>

diff.**Set**(High\[0] - Low\[0]);

**double** middle = **SMA**(Typical, Period)\[0];

**double** offset = **SMA**(diff, Period)\[0] \* offsetMultiplier;

**double** upper = middle + offset;

**double** lower = middle - offset;

#### Example <a href="#example_40" id="example_40"></a>

```csharp
//Current value for the Keltner Channel based on 15 periods
Print("Current value of the upper Keltner Channel band: " + KeltnerChannel(1.5, 15).Upper[0]);
Print("Current value of the middle Keltner Channel band: " + KeltnerChannel(1.5, 15)[0]);
Print("Current value of the lower Keltner Channel band: " + KeltnerChannel(1.5, 15).Lower[0]);
```


# KeyReversalUp

#### Description <a href="#description_42" id="description_42"></a>

The KeyReversalUp indicator searches within a predefined number of periods to find turning points with the following characteristics: 1 The current close is higher than the previous close 2 The current low is smaller than or equal to the last low of the last n bars

See [*KeyReversalDown*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldown), [*KeyReversalUpAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatsma), [*KeyReversalDownAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatsma), [*KeyReversalUpAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatema), [*KeyReversalDownAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatema).

#### Parameters <a href="#parameters_37" id="parameters_37"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations

#### Return value <a href="#return-value_42" id="return-value_42"></a>

**double**

0 – No reversal information available 1 – Reversal information available

#### Usage <a href="#usage_43" id="usage_43"></a>

```csharp
KeyReversalUp(int period)
KeyReversalUp(IDataSeries inSeries, int period)
KeyReversalUp(int period)[int barsAgo]
KeyReversalUp(IDataSeries inSeries, int period)[int barsAgo]
```

#### Example <a href="#example_41" id="example_41"></a>

```csharp
// Search for an entry opportunity (longs)
if (KeyReversalUp(10)[0] == 1)
Print("A long reversal formation has occurred.");
```


# KeyReversalDown

#### Description <a href="#description_43" id="description_43"></a>

KeyReversalDown searches within a predefined number of periods to find turning points with the following characteristics:

1 The current close is lower than the previous close 2 The current high is higher than or equal to the highest high of the last n bars

See [*KeyReversalUp*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalup), [*KeyReversalUpAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatsma), [*KeyReversalDownAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatsma), [*KeyReversalUpAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatema), [*KeyReversalDownAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatema).

#### Parameters <a href="#parameters_38" id="parameters_38"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations

#### Return value <a href="#return-value_43" id="return-value_43"></a>

**double**

0 – No reversal information available 1 – Reversal information available

#### Usage <a href="#usage_44" id="usage_44"></a>

```csharp
KeyReversalDown(int period)
KeyReversalDown(IDataSeries inSeries, int period)
KeyReversalDown(int period)[int barsAgo]
KeyReversalDown(IDataSeries inSeries, int period)[int barsAgo]
```

#### Example <a href="#example_42" id="example_42"></a>

```csharp
// Look for a short entry
if (KeyReversalDown(10)[0] == 1)
Print("A short reversal formation has occurred.");
```


# KeyReversalUpAtSMA

#### Description <a href="#description_44" id="description_44"></a>

KeyReversalUpAtSMA searches within a predefined number of periods to find turning points with the following characteristics:

1 The current close is higher than the previous close 2 The current low is smaller than or equal to the lowest low within n bars 3 The current low has touched or breached an SMA

See [*KeyReversalUp*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalup), [*KeyReversalDown*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldown), [*KeyReversalDownAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatsma), [*KeyReversalUpAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatema), [*KeyReversalDownAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatema).

#### Parameters <a href="#parameters_39" id="parameters_39"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations SMAperiod Number of periods included in the calculation of the SMA

#### Return value <a href="#return-value_44" id="return-value_44"></a>

**double**

0 – No reversal information 1 – Reversal information found

#### Usage <a href="#usage_45" id="usage_45"></a>

```csharp
KeyReversalUpAtSMA(int period, int SMAperiod)
KeyReversalUpAtSMA(IDataSeries inSeries, int period, int SMAperiod)
KeyReversalUpAtSMA(int period, int SMAperiod)[int barsAgo]
KeyReversalUpAtSMA(IDataSeries inSeries, int period, int SMAperiod)[int barsAgo]
```

#### Example <a href="#example_43" id="example_43"></a>

```csharp
// Look for a long entry
if (KeyReversalUpAtSMA(10)[0] == 1)
Print("A long reversal formation has occurred.");
```


# KeyReversalDownAtSMA

#### Description <a href="#description_45" id="description_45"></a>

KeyReversalDownAtSMA searches within a predefined number of periods to find a turning point with the following characteristics:

1 The current close is lower than the previous close 2 The current high is higher than or equal to the highest high within the last n periods 3 The current high has touched or breached an SMA

See [*KeyReversalUp*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalup), [*KeyReversalDown*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldown), [*KeyReversalUpAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatsma), [*KeyReversalUpAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatema), [*KeyReversalDownAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatema).

#### Parameters <a href="#parameters_40" id="parameters_40"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations SMAperiod Number of periods included in the SMA calculation

#### Return value <a href="#return-value_45" id="return-value_45"></a>

**double**

0 – No reversal formation found 1 – Reversal formation present

#### Usage <a href="#usage_46" id="usage_46"></a>

```csharp
KeyReversalDownAtSMA(int period, int SMAperiod)
KeyReversalDownAtSMA(IDataSeries inSeries, int period, int SMAperiod)
KeyReversalDownAtSMA(int period, int SMAperiod)[int barsAgo]
KeyReversalDownAtSMA(IDataSeries inSeries, int period, int SMAperiod)[int barsAgo]
```

#### Example <a href="#example_44" id="example_44"></a>

```csharp
// Search for a short entry
if (KeyReversalDownAtSMA(10)[0] == 1)
Print("A short reversal formation has occurred.");
```


# KeyReversalUpAtEMA

#### Description <a href="#description_46" id="description_46"></a>

KeyReversalUpAtEMA searches within a predefined number of periods to find a reversal formation with the following characteristics:

1 The current close is higher than the previous close 2 The current low is smaller than or equal to the lowest low within the last n bars 3 The current low has touched or breached an EMA

See [*KeyReversalUp*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalup), [*KeyReversalDown*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldown), [*KeyReversalUpAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatsma), [*KeyReversalDownAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatsma), [*KeyReversalDownAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatema).

#### Parameters <a href="#parameters_41" id="parameters_41"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations EMAperiod Number of periods included in the EMA calculation

#### Return value <a href="#return-value_46" id="return-value_46"></a>

**double**

0 – No reversal information found 1 – Reversal information found

#### Usage <a href="#usage_47" id="usage_47"></a>

```csharp
KeyReversalUpAtEMA(int period, int EMAperiod)
KeyReversalUpAtEMA(IDataSeries inSeries, int period, int EMAperiod)
KeyReversalUpAtEMA(int period, int EMAperiod)[int barsAgo]
KeyReversalUpAtEMA(IDataSeries inSeries, int period, int EMAperiod)[int barsAgo]
```

#### Example <a href="#example_45" id="example_45"></a>

```csharp
// Search for a long entry
if (KeyReversalUpAtEMA(10)[0] == 1)
Print("A long reversal formation has occurred.");
```


# KeyReversalDownAtEMA

#### Description <a href="#description_47" id="description_47"></a>

KeyReversalDownAtEMA searches within a predefined number of periods to find a reversal formation with the following characteristics:

1 The current close is lower than the previous close 2 The current high is larger than or equal to the highest high of the last n bars 3 The current high has touched or breached an EMA

See [*KeyReversalUp*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalup), [*KeyReversalDown*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldown), [*KeyReversalUpAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatsma), [*KeyReversalDownAtSMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversaldownatsma), [*KeyReversalUpAtEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#keyreversalupatema).

#### Parameters <a href="#parameters_42" id="parameters_42"></a>

inSeries Input data series for the indicator period Number of bars included in the calculations EMAperiod Number of periods used to calculate the EMA

#### Return value <a href="#return-value_47" id="return-value_47"></a>

**double**

0 – No reversal formation found

1 – Reversal formation found

#### Usage <a href="#usage_48" id="usage_48"></a>

```csharp
KeyReversalDownAtEMA(int period, int EMAperiod)
KeyReversalDownAtEMA(IDataSeries inSeries, int period, int EMAperiod)
KeyReversalDownAtEMA(int period, int EMAperiod)[int barsAgo]
KeyReversalDownAtEMA(IDataSeries inSeries, int period, int EMAperiod)[int barsAgo]
```

#### Example <a href="#example_46" id="example_46"></a>

```csharp
// Search for a short entry
if (KeyReversalDownAtEMA(10)[0] == 1)
Print("A short reversal formation has occurred.");
```


# Linear Regression

#### Description <a href="#description_49" id="description_49"></a>

Linear Regression is used to determine trends. Here, the prices are set as dependent variables, and time is set as an independent variable. Using the method for determination of the smallest square, a straight line is placed through the price movements in such a way that the distance between the prices and the line deviates as little as possible. Using this method also establishes a trend between two points in time. The regression line can be found in the middle of the price channel, and the indicator provides the end values of multiple linear regression trend lines. Each point along this indicator is therefore an end value of a linear regression trend line. What results is quite similar to a smoothing average, with the difference that the regression line exhibits less lag.

See [*R-Squared*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#r-squared), [*LinRegSlope*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregslope), [*LinRegIntercept*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregintercept).

#### Further information <a href="#further-information_20" id="further-information_20"></a>

<http://www.vtad.de/sites/files/forschung/vtad_Award_2011_Joachim_Lenz_Veroeffentlichung.pdf>

#### Interpretation <a href="#interpretation_23" id="interpretation_23"></a>

The linear regression indicator is used as a prognosis tool for the future developments of the instrument. If the prices are rising or falling steadily, then it can be expected that they will return to a more realistic/reasonable level. In other words: the indicator shows where the price should be, a deviation from the regression is assumed to be short-lived and to be corrected soon.

#### Usage <a href="#usage_50" id="usage_50"></a>

```csharp
LinReg(int period)
LinReg(IDataSeries inSeries, int period)
LinReg(int period)[int barsAgo]
LinReg(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_49" id="return-value_49"></a>

**double**

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

#### Parameters <a href="#parameters_44" id="parameters_44"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_45" id="visualization_45"></a>

![Linear Regression](https://agenatrader.github.io/AgenaIndicator-documentation/media/LinReg.jpg)

#### Example <a href="#example_48" id="example_48"></a>

```csharp
//Show the current values of the regression line
Print("The current value for the linear regression is: " + LinReg(14)[0]);
```


# LinRegIntercept

#### Description <a href="#description_50" id="description_50"></a>

The Linear Regression Intercept outputs the value of the regression constant, i.e. the mathematical intersection of where the regression line meets the price axis.

A straight line can be accurately determined with the help of the slope and intercept values.

See [*Linear Regression*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linearregression), [*R-Squared*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#r-squared) [*LinRegSlope*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregslope).

#### Interpretation <a href="#interpretation_24" id="interpretation_24"></a>

The indicator is not used by itself, but is simply a component of trading systems that analyze trade trends with the help of the linear regression.

#### Usage <a href="#usage_51" id="usage_51"></a>

```csharp
LinRegIntercept(int period)
LinRegIntercept(IDataSeries inSeries, int period)
LinRegIntercept(int period)[int barsAgo]
LinRegIntercept(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_50" id="return-value_50"></a>

**double**

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

#### Parameters <a href="#parameters_45" id="parameters_45"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_46" id="visualization_46"></a>

![LinRegIntercept](https://agenatrader.github.io/AgenaIndicator-documentation/media/LinRegIntercept.jpg)

#### Example <a href="#example_49" id="example_49"></a>

```csharp
//Show current value
Print("The current value of the regression constant is: " + LinRegIntercept(14)[0]);
```


# LinRegSlope

#### Description <a href="#description_51" id="description_51"></a>

The Linear Regression Slope outputs the slope of the linear regression line, and is a measurement of the regression line’s “elevation”.

See [*Linear Regression*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linearregression), [*R-Squared*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#r-squared), [*LinRegIntercept*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregintercept).

#### Interpretation <a href="#interpretation_25" id="interpretation_25"></a>

Simply put: in an uptrend, the elevation is positive and facing upwards. The opposite applies to downtrends. This indicator is not very useful for determining overbought or oversold areas, but can be used to measure the strength of a trend. It should be used in combination with other indicators to identify potential entries.

#### Usage <a href="#usage_52" id="usage_52"></a>

```csharp
LinRegSlope(int period)
LinRegSlope(IDataSeries inSeries, int period)
LinRegSlope(int period)[int barsAgo]
LinRegSlope(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_51" id="return-value_51"></a>

**double**

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

#### Parameters <a href="#parameters_46" id="parameters_46"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_47" id="visualization_47"></a>

![LinRegSlope](https://agenatrader.github.io/AgenaIndicator-documentation/media/LinRegSlope.jpg)

#### Example <a href="#example_50" id="example_50"></a>

```csharp
//Current value for the slope:
Print("The current value for the inclination of the linear regression line is: " + LinRegSlope(14)[0]);
```


# LowestLowIndex()

#### Description <a href="#description_52" id="description_52"></a>

LowestLowIndex delivers the index of the bar with the lowest low within a predefined number of periods.

Differently to GetSerieLowestValue(), one can display this indicator within a chart.

See [*HighestHighPrice()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#highesthighprice), [*HighestHighIndex()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#highesthighindex), [*LowestLowPrice()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#lowestlowprice), *GetSerieHighestValue()*, *GetSerieLowestValue()*.

#### Usage <a href="#usage_53" id="usage_53"></a>

```csharp
LowestLowIndex(int BarsBack)
LowestLowIndex(int BarsBack)[int barsAgo]
```

#### Return value <a href="#return-value_52" id="return-value_52"></a>

**double**

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

**Parameter**

BarsBack Number of periods within which the highest high shall be searched for

#### Visualization <a href="#visualization_48" id="visualization_48"></a>

![LowestLowIndex()](https://agenatrader.github.io/AgenaIndicator-documentation/media/LowestLowIndex.jpg)

#### Example <a href="#example_51" id="example_51"></a>

```csharp
// How many bars back is the lowest low of the last 14 bars located?
Print("The lowest low of the last 14 bars was " + LowestLowIndex(14)[0] + " bars ago.");
```


# LowestLowPrice()

#### Description <a href="#description_53" id="description_53"></a>

LowestLowPrice delivers the value of the lowest low within a predefined number of periods.

Unlike the GetSerieLowestValue(), this indicator can be viewed within the chart.

See [*HighestHighPrice()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#highesthighprice), [*HighestHighIndex()*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#highesthighindex), [*LowestLowIndex*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/), *GetSerieHighestValue()*, *GetSerieLowestValue()*.

#### Usage <a href="#usage_54" id="usage_54"></a>

```csharp
LowestLowPrice(int BarsBack)
LowestLowPrice(int BarsBack)[int barsAgo]
```

#### Return value <a href="#return-value_53" id="return-value_53"></a>

**double**

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

#### Parameter <a href="#parameter_5" id="parameter_5"></a>

BarsBack Number of periods within which the low will be searched for

#### Visualization <a href="#visualization_49" id="visualization_49"></a>

![LowestLowPrice()](https://agenatrader.github.io/AgenaIndicator-documentation/media/LowestLowPrice.jpg)

#### Example <a href="#example_52" id="example_52"></a>

```csharp
// What value did the lowest low of the last 14 periods have?
Print("The lowest low of the last 14 bars is " + LowestLowPrice(14)[0]);
```


# MACD

#### Description <a href="#description_54" id="description_54"></a>

The Moving Average Convergence-Divergence (MACD) indicator, developed by Gerald Appel in the late 70s, is one of the simplest, most effective momentum indicators out there. The MACD makes two trend-following indicators, moving averages, average, become a momentum oscillator by subtracting the longer moving average from the shorter moving average. As a result of this, the MACD offers great advantages: trend following and momentum. The MACD moves above and below the zero line as the moving averages converge, cross and diverge again. Signal line crossovers, centerline crossovers and divergences are things that traders can keep an eye out for to generate signals. Since the MACD is unbounded, it is not especially useful for identifying overbought or oversold levels. The MACD line is the 12-day Exponential Moving Average (EMA) minus the 26-day EMA, and closing prices are used for these moving averages. A 9-day EMA of the MACD line is plotted with the indicator acting as a signal line and identifying turns. The MACD histogram shows the difference between the MACD and its 9-day EMA, i.e. the signal line. When the MACD line is above its signal line, the histogram is positive, and vice versa when the MACD line is below its signal line.

The typical settings used with the MACD are the values 12, 26 and 9. However, other values can also be used depending on the trading style and goals in mind.

#### Interpretation <a href="#interpretation_26" id="interpretation_26"></a>

As its name implies, the MACD is all about the convergence and divergence of the two moving averages. Convergence occurs when the moving averages move towards each other. Divergence occurs when the moving averages move away from each other. The shorter moving average (12-day) is faster and responsible for most MACD movements. The longer moving average (26-day) is slower and less reactive to price changes in the underlying security.

The MACD line oscillates above and below the zero line, which is also known as the centerline. These crossovers signal that the 12-day EMA has crossed the 26-day EMA. The direction, of course, depends on the direction of the moving average cross. Positive MACD indicates that the 12-day EMA is above the 26-day EMA. Positive values increase as the shorter EMA diverges further from the longer EMA. This means upside momentum is increasing. Negative MACD values indicate that the 12-day EMA is below the 26-day EMA. Negative values increase as the shorter EMA diverges further below the longer EMA. This means downside [momentum](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#momentum) is increasing. Signal line crossovers are the most common MACD signals. The signal line is a 9-day EMA of the MACD line. As a moving average of the indicator, it trails the MACD and makes it easier to spot MACD turns. A bullish crossover occurs when the MACD turns up and crosses above the signal line. A bearish crossover occurs when the MACD turns down and crosses below the signal line. Crossovers can last a few days or a few weeks, it all depends on the strength of the move.

Due diligence is required before relying on these common signals. Signal line crossovers at positive or negative extremes should be viewed with caution. Even though the MACD does not have upper and lower limits, chartists can estimate historical extremes with a simple visual assessment. It takes a strong move in the underlying security to push momentum to an extreme. Even though the move may continue, momentum is likely to slow and this will usually produce a signal line crossover at the extremities. Volatility in the underlying security can also increase the number of crossovers.

#### Further information <a href="#further-information_21" id="further-information_21"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/MACD>

#### Usage <a href="#usage_55" id="usage_55"></a>

```csharp
MACD(int fast, int slow, int smooth)
MACD(IDataSeries inSeries, int fast, int slow, int smooth)

//For the value of the MACD line
MACD(int fast, int slow, int smooth)[int barsAgo]
MACD(IDataSeries inSeries, int fast, int slow, int smooth)[int barsAgo]

//For the value of the signal line
MACD(int fast, int slow, int smooth).Avg[int barsAgo]
MACD(IDataSeries inSeries, int fast, int slow, int smooth).Avg[int barsAgo]

//For the difference between the MACD and the signal line
MACD(int fast, int slow, int smooth).Diff[int barsAgo]
MACD(IDataSeries inSeries, int fast, int slow, int smooth).Diff[int barsAgo]
```

#### Return value <a href="#return-value_54" id="return-value_54"></a>

**double**

When using this method with an index (e.g. **MACD**(12,26,9)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_47" id="parameters_47"></a>

inSeries Input data series for the indicator

fast Number of periods for the fast EMA calculation

slow Number of periods for the slow EMA calculation

smooth Number of periods for the EMA calculation of the signal line

#### Visualization <a href="#visualization_50" id="visualization_50"></a>

![MACD](https://agenatrader.github.io/AgenaIndicator-documentation/media/MACD.jpg)

#### Example <a href="#example_53" id="example_53"></a>

```csharp
//Show the current values for the MACD
Print("The current value for the MACD line is: " + MACD(12,26,9)[0]);
Print("The current value for the signal line is: " + MACD(12,26,9).Avg[0]);
Print("The difference between the MACD and the signal line is: " + MACD(12,26,9).Diff[0]);
```


# MAEnvelopes

#### Description <a href="#description_55" id="description_55"></a>

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 <a href="#usage_56" id="usage_56"></a>

```csharp
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 <a href="#return-value_55" id="return-value_55"></a>

**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 <a href="#parameters_48" id="parameters_48"></a>

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 <a href="#visualization_51" id="visualization_51"></a>

![MAEnvelopes](https://agenatrader.github.io/AgenaIndicator-documentation/media/MAEnvelopes.jpg)

#### Usage <a href="#usage_57" id="usage_57"></a>

```csharp
//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]);
```


# Momentum (MOM)

#### Description <a href="#description_58" id="description_58"></a>

Momentum is one of the most popular indicators available, the first choice of many traders. This relatively simple indicator is so popular because it measures the attenuation of the motion without the need for complex formulas. The momentum indicator represents a whole family of indicators that measure a movement’s strength. Other representatives in this case are the RSI or CCI, and so on. In the illustration below, the indicator is a graph that oscillates around a zero point. There is no fixed scale in percentage terms, and the value can be quite far removed from the zero point; this usually happens when the price makes an exceptionally strong leap, which is why the indicator predominantly shows the direction in which the current prices are moving towards.

#### Interpretation <a href="#interpretation_27" id="interpretation_27"></a>

Entry signals are generated when the indicator crosses the zero line.

See [*ROC*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#rate-of-change-roc).

#### Further information <a href="#further-information_22" id="further-information_22"></a>

<http://de.wikipedia.org/wiki/Momentum_%28Chartanalyse%29>

#### Usage <a href="#usage_60" id="usage_60"></a>

```csharp
Momentum(int period)
Momentum (IDataSeries inSeries, int period)
Momentum (int period)[int barsAgo]
Momentum (IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_57" id="return-value_57"></a>

**double**

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

#### Parameters <a href="#parameters_50" id="parameters_50"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_53" id="visualization_53"></a>

![Momentum (MOM)](https://agenatrader.github.io/AgenaIndicator-documentation/media/Momentum.jpg)

#### Example <a href="#example_56" id="example_56"></a>

```csharp
//Output of the values for the momentum indicator.
Print("The current value for the momentum is " + Momentum(14)[0]);
```


# Money Flow Index (MFI)

#### Description <a href="#description_59" id="description_59"></a>

The MFI is an oscillator that makes use of both volume and price to measure buying and selling pressure. MFI, which was developed by Gene Quong and Avrum Soudack, is also known as volume-weighted [*RSI*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#relative-strength-index-rsi). MFI starts with the typical price for each period. Money flow is then positive when this aforementioned typical price increases (buying pressure) and negative when it decreases (selling pressure). A ratio of positive-negative money flow is then inserted into an RSI formula to come up with an oscillator that fluctuates between 0 and 100. The MFI, which is a momentum oscillator linked to volume, is best used for identifying reversals and price extremes with a variety of different signals.

#### Interpretation <a href="#interpretation_28" id="interpretation_28"></a>

The MFI is interpreted similarly to the RSI indicator. The MFI’s decisive factor is much stronger than the RSI’s when it comes to trend direction, due to the fact that volume is included in the calculation.

#### Further information <a href="#further-information_23" id="further-information_23"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Money_Flow_Index>

#### Usage <a href="#usage_61" id="usage_61"></a>

```csharp
MFI(int period)
MFI(IDataSeries inSeries, int period)
MFI(int period)[int barsAgo]
MFI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_58" id="return-value_58"></a>

**double**

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

#### Parameters <a href="#parameters_51" id="parameters_51"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_54" id="visualization_54"></a>

![Money Flow Index (MFI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/MoneyFlowIndex.jpg)

#### Example <a href="#example_57" id="example_57"></a>

```csharp
//Current MFI value
Print("The current value for the MFI is: " + MFI(14)[0]);
```


# Moving Averages

#### Variants <a href="#variants" id="variants"></a>

[*DEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#dema-double-exponential-moving-average) - Double Exponential Moving Average

[*EMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#ema-exponential-moving-average) - Exponential Moving Average

[*HMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#hma-hull-moving-average) - Hull Moving Average

[*KAMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#kama-kaufmans-adaptive-moving-average) - Kaufman's Adaptive Moving Average

[*MAMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#mama-mesa-adaptive-moving-average) - Mesa Adaptive Moving Average

[*SMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#sma-simple-moving-average) - Simple Moving Average

[*TEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#tema-triple-exponential-moving-average) - Triple Exponential Moving Average

[*TMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#tma-triangular-moving-average) - Triangular Moving Average

[*TRIX*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#trix-triple-exponential-moving-average) - Triple Exponential Moving Average

[*T3*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#t3-triple-exponential-moving-average) - Triple Exponential Moving Average

[*VMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#vma-variable-moving-average) - Variable Moving Average

[*VWMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#vwma-volume-weighted-moving-average) - Volume Weighted Moving Average

[*WMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#wma-weighted-moving-average), [*VMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#vma-variable-moving-average) - Weighted Moving Average

[*ZLEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#zlema-zero-lag-exponential-moving-average) - Zero Lag Exponential Moving Average

#### Interpretation <a href="#interpretation_29" id="interpretation_29"></a>

The arithmetic average, also known as the moving average or simple moving average, smoothes the progression of the price for better trend detection. Moving averages are trend-following indicators; they follow the course and do not lead. IsSerieRising averages show uptrends, whereas falling averages display downtrends. By varying the period input, the time delay of the average can be changed. The smaller the period interval, the quicker the reaction time will be, but as a consequence, the smoothing effect will also be diminished. The opposite is true when increasing the period selection. The most popular choices are: 38, 50, 100 and 200 days. The 200-day moving average in particular has a significant importance for institutional traders, since it displays the long-term trend. 200 trading days are equal to a trading year. When the 200 MA is broken, then buy/sell signals are generated.

#### Applications <a href="#applications" id="applications"></a>

**Crossing of two averages**

The integration of multiple moving averages is used to identify trend sequences and minimize the number of false signals. When two arithmetic averages are used, whereby one is a short-term and the other a long-term, more interesting signals can be generated. One such application can be seen with Richard Donchian’s methodologies, such as using the 5 and 20-day averages. The Double Crossover Method generates signals in the following way:

If the short-term average crosses the long-term average from below, this is called a Golden Cross, and a buy signal is generated. Higher trading volume reinforces the quality of the signal. The long-term average works as a support line in an uptrend.

If the short-term average crosses the long-term average from above, this is called a Death Cross. It generates a sell signal. Higher trading volume reinforces the signal quality. In a downtrend, the long-term average functions as a resistance line.

**Crossing of three moving averages**

Another method is to use three moving averages (Triple Crossover Method). This method was presented by R.C Allen, who used the 4, 9, and 18-day averages and suggested that a trend change is hinted at when the 4MA crosses the 9MA from bottom to top. An entry is only recommended when all lines are above the 18-day period. An exit is initiated when the 4-day MA moves below the 9-day MA. (Source: VTAD)


# DEMA - Double Exponential Moving Average

#### Description <a href="#description_60" id="description_60"></a>

The Double Exponential Moving Average is a technical indicator created by Patrick Mulloy. The calculation hereof is done using a simple as well as a double exponential moving average.

#### Interpretation <a href="#interpretation_30" id="interpretation_30"></a>

The DEMA is a fast-working moving average that reacts quicker to market changes. The DEMA may be used as a stand-alone indicator or in tandem with other indicators. The general interpretations are the same as for regular moving averages.

#### Usage <a href="#usage_62" id="usage_62"></a>

```csharp
DEMA(int period)
DEMA(IDataSeries inSeries, int period)
DEMA(int period)[int barsAgo]
DEMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_59" id="return-value_59"></a>

**double**

When using this method with an index (e.g. **DEMA**(20)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_52" id="parameters_52"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_55" id="visualization_55"></a>

![DEMA - Double Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/DEMA.jpg)

#### Calculation <a href="#calculation_2" id="calculation_2"></a>

```csharp
Value.Set(2 * EMA(InSeries[0], Period)[0] - EMA(EMA(InSeries[0], Period), Period)[0]);
```

#### Example <a href="#example_58" id="example_58"></a>

```csharp
//Output the values for the DEMA
Print("The current DEMA value is " + DEMA(20)[0]);
```


# EMA - Exponential Moving Average

#### Description <a href="#description_61" id="description_61"></a>

Exponential moving averages work to reduce lag by weighting recent prices more heavily. The weighting given to the most recent price depends on the number of periods in the moving average. Calculating an exponential moving average involves three steps. 1. Calculate the simple moving average. An exponential moving average (EMA) must start somewhere, therefore a simple moving average is used as the previous period's EMA in the beginning calculation. 2. Calculate the weighting multiplier. 3. Calculate the EMA.

#### Interpretation <a href="#interpretation_31" id="interpretation_31"></a>

The EMA is used by many traders in the most varying of timeframes. It is especially meaningful within the 15, 60 and 240-minute charts. The EMA 200 line is also especially popular with traders.

If the price rises sharply and moves away quickly from the respective EMA line, it is possible to enter countertrend positions in order to profit from the potential return to the moving average. General interpretations of the moving averages also apply to the EMA.

#### Usage <a href="#usage_63" id="usage_63"></a>

```csharp
EMA(int period)
EMA(IDataSeries inSeries, int period)
EMA(int period)[int barsAgo]
EMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_60" id="return-value_60"></a>

**double**

When using this method with an index (e.g. **EMA**(20)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_53" id="parameters_53"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_56" id="visualization_56"></a>

![EMA - Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/EMA.jpg)

#### Calculation <a href="#calculation_3" id="calculation_3"></a>

```csharp
Value.Set(ProcessingBarIndex == 0 ? InSeries[0] : InSeries[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
```

#### Example <a href="#example_59" id="example_59"></a>

```csharp
//Output the value for the EMA
Print("The current EMA value is " + EMA(20)[0]);
```


# EMA MTF (MultiTimeFrame)

#### Description <a href="#description_62" id="description_62"></a>

The EMA MTF indicator is a multi-timeframe version of the standard EMA indicator. This indicator basically allows you to make calculationgs in a different timeframe than that of the current chart.

For more information, see [*EMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#ema-exponential-moving-average).

Also see [*BollingerMTF*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#bollingermtf), [*SmaMTF*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#smamtf).

#### Visualization <a href="#visualization_57" id="visualization_57"></a>

A 5-minute chart with an EMA(20) calculated with hourly bars as the underlying input:

![EMA MTF (MultiTimeFrame)](https://agenatrader.github.io/AgenaIndicator-documentation/media/EMAmtf.jpg)


# HMA - Hull Moving Average

#### Description <a href="#description_63" id="description_63"></a>

The Hull Moving Average, invented by Alan Hull, is a fast-working moving average that gets rid of almost all delays/lags (zero lag). The calculation is carried out using several weighted moving averages, thereby partially reducing the smoothing effect. Hull’s methodology uses square roots of the period instead of the actual period itself.

#### Interpretation <a href="#interpretation_32" id="interpretation_32"></a>

The same interpretations as for the moving averages apply to the HMA, the only major distinction being the reduced lag. See [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Usage <a href="#usage_64" id="usage_64"></a>

```csharp
HMA(int period)
HMA(IDataSeries InSeries, int period)
HMA(int period)[int barsAgo]
HMA(IDataSeries InSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_61" id="return-value_61"></a>

**double**

When using this method with an index (e.g. **HMA**(21)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_54" id="parameters_54"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_58" id="visualization_58"></a>

![HMA - Hull Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/HMA.jpg)

#### Calculation <a href="#calculation_4" id="calculation_4"></a>

```csharp
double value1 = 2 * WMA(InSeries, (int)(Period / 2))[0];
double value2 = WMA(InSeries, Period)[0];
diffSeries.Set(value1 - value2);
Value.Set(WMA(diffSeries, (int) Math.Sqrt(Period))[0]);
```

#### Example <a href="#example_60" id="example_60"></a>

```csharp
//Output the value for the HMA
Print("The current HMA value is " + HMA(21)[0]);
```


# KAMA - Kaufman's Adaptive Moving Average

#### Description <a href="#description_64" id="description_64"></a>

The KAMA is based on an EMA in which a trend efficiency ratio controls the weight of future price changes. This efficiency ratio (the squared efficiency factor) is a measure that can also be used by itself. The trend efficiency is the ratio of the absolute price change from the start to the end of the period, and the total of the absolute daily price changes. At higher trending efficiencies (i.e. straight price movements) without too much variation, the extra price carries a higher weighting, according to a shorter day period setting. Lower trending frequencies carry a smaller weighting.

#### Interpretation <a href="#interpretation_33" id="interpretation_33"></a>

Kaufman mentions that a rising KAMA value can be interpreted as a buying signal, whilst falling KAMA values assume the prices to be falling. Kaufman also defines a maximum and minimum value for the calculation of the smoothing components. The efficiency ratio is converted using specified maximum and minimum values, which are applied to newly incoming price changes. Kaufman uses 2 (short period) as a minimum value and 30 (long period) as a maximum value. The number of days for the determination of the efficiency ratio is one of the more important parameters for the KAMA.

For a more general interpretation of moving averages, please see the following chapter: [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Further information <a href="#further-information_24" id="further-information_24"></a>

<http://www.investor-verlag.de/boersenwissen/kama/>

#### Usage <a href="#usage_65" id="usage_65"></a>

```csharp
KAMA(int fast, int period, int slow)
KAMA(IDataSeries inSeries, int fast, int period, int slow)
KAMA(int fast, int period, int slow)[int barsAgo]
KAMA(IDataSeries inSeries, int fast, int period, int slow)[int barsAgo]
```

#### Return value <a href="#return-value_62" id="return-value_62"></a>

**double**

When using this method with an index (e.g. **KAMA**(2,10,30)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_55" id="parameters_55"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

fast Short period

slow Long period

#### Visualization <a href="#visualization_59" id="visualization_59"></a>

![KAMA - Kaufman](https://agenatrader.github.io/AgenaIndicator-documentation/media/KAMA.jpg)

#### Example <a href="#example_61" id="example_61"></a>

```csharp
//Output for the value of the Kaufman Moving Average(KAMA)
Print("The current value of the KAMA is " + KAMA(2,10,30)[0]);
```


# MAMA - Mesa Adaptive Moving Average

#### Description <a href="#description_65" id="description_65"></a>

This automatically adapting moving average has a period length that is determined by means of various complex calculations. This complex indicator has its origins in publications by John Ehlers. Ehlers calculates cycles for the price movements to determine the length and intensity of single trend phases. Working with the length of the cycles, the weighting factor for the moving average can be established in several different ways.

**FAMA** This indicator is a second line – the name FAMA can be found in various publications. This line is similar to the underlying exponential moving average and can be used as a trigger line.

#### Interpretation <a href="#interpretation_34" id="interpretation_34"></a>

For more concise information, we recommend that you read Ehler’s paper.

General information about moving averages can be found here: [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Further information <a href="#further-information_25" id="further-information_25"></a>

<http://www.tradesignalonline.com/de/lexicon/view.aspx?id=MAMA+adaptive+Moving+Average>

#### Usage <a href="#usage_66" id="usage_66"></a>

```csharp
MAMA(double fastLimit, double slowLimit)
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit)
MAMA(double fastLimit, double slowLimit)[int barsAgo]
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit)[int barsAgo]

//Value of the Following Adaptive Moving Average (FAMA)
MAMA(double fastLimit, double slowLimit).Fama[int barsAgo]
MAMA(IDataSeries inSeries, double fastLimit, double slowLimit).Fama[int barsAgo]
```

#### Return value <a href="#return-value_63" id="return-value_63"></a>

**double**

When using this method with an index (e.g. **MAMA**(0.5,0.05)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_56" id="parameters_56"></a>

inSeries Input data series for the indicator

fastLimit Upper limit for the alpha value

slowLimit Lower limit for the alpha value

#### Visualization <a href="#visualization_60" id="visualization_60"></a>

![MAMA - Mesa Adaptive Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/MAMA.jpg)

#### Example <a href="#example_62" id="example_62"></a>

```csharp
//Output values for (MAMA)
Print("The current value for the MAMA is " + MAMA(0.5, 0.05)[0]);
//Output values for (FAMA)
Print("The current value for the FAMA is " + MAMA(0.5, 0.05).Fama[0]);
```


# SMA - Simple Moving Average

#### Description <a href="#description_66" id="description_66"></a>

The SMA is the most well-known average, representing the simplest method of displaying the trend direction in a chart. In mathematical terms, this is the arithmetic mean of a number of individual lengths. It is called “moving” because to establish an average, the oldest value is always sacrificed to make space for the new incoming price change. Fundamentally speaking, the period length influences the intensity of the smoothing. Shorter periods (such as 10 days) will mean that the indicator follows the price changes quite closely. The SMA has a few disadvantages, which is why several adaptations of this indicator have been developed in the last few years. One of the biggest disadvantages is the fact that the indicator tends to lag, and the equal weighting for all data inputs across time intervals. You can find more general interpretations and meanings here: [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Further information <a href="#further-information_26" id="further-information_26"></a>

<http://www.forex-trading-online.de/indikatoren/simple-moving-average-sma>

<http://vtadwiki.vtad.de/index.php/SMA#Average-Off-Berechnungsverfahren_.28MMA.29>

#### Usage <a href="#usage_67" id="usage_67"></a>

```csharp
SMA(int period)
SMA(IDataSeries InSeries, int period)
SMA(int period)[int barsAgo]
SMA(IDataSeries InSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_64" id="return-value_64"></a>

**double**

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

#### Parameters <a href="#parameters_57" id="parameters_57"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_61" id="visualization_61"></a>

![SMA - Simple Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/SMA.jpg)

#### Calculation <a href="#calculation_5" id="calculation_5"></a>

Value.**Set**((last + InSeries\[0] - InSeries\[Period]) / Math.**Min**(ProcessingBarIndex, Period));

#### Example <a href="#example_63" id="example_63"></a>

```csharp
//Output of the SMA value
Print("The current SMA value is " + SMA(14)[0]);
```


# GapSMA - Gap Simple Moving Average

#### Description <a href="#description_67" id="description_67"></a>

The SimpleSMA has the Issue, that in case of an big opening Gap, the SMA takes very long to adjust to the candles. The GapSMA ignores the Gaps and ends calculating on the Market Close and starts calculating on the Market Open again.

If there is a Gap between the Market Close and the Market Open it will not be taken into account.

#### Usage <a href="#usage_68" id="usage_68"></a>

```csharp
GapSMA(int period)
GapSMA(IDataSeries InSeries, int period)
GapSMA(int period)[int barsAgo]
GapSMA(IDataSeries InSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_65" id="return-value_65"></a>

**double**

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

#### Parameters <a href="#parameters_58" id="parameters_58"></a>

InSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_62" id="visualization_62"></a>

![GapSMA - Simple Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/GapSma.png)

#### Example <a href="#example_64" id="example_64"></a>

```csharp
//Output of the SMA value
Print("The current GapSMA value is " + GapSMA(14)[0]);
```


# SMA MTF (MultiTimeFrame)

#### Description <a href="#description_68" id="description_68"></a>

The SMA MTF – as is true for the other multi-timeframe indicator variations – allows traders to display the SMA of a specific timeframe on a chart of a different timeframe.

See [*BollingerMTF*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#bollingermtf), [*EmaMTF*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#ema-mtf-multitimeframe).

#### Visualization <a href="#visualization_63" id="visualization_63"></a>

The image shows a 5-minute chart with an SMA (14) calculated on 4-hour bars

![SMA MTF (MultiTimeFrame)](https://agenatrader.github.io/AgenaIndicator-documentation/media/SMAmtf.jpg)


# SMMA - Smoothed Moving Average

#### Description <a href="#description_69" id="description_69"></a>

The Smoothed Moving Average is combined from both Simple Moving Average and the Exponential Moving Average. Generally speaking, it is only used for higher period amounts/inputs. It normally has roughly half of the value of an EMA, meaning that an SMMA(20) is closer to an EMA(40).

#### Interpretation <a href="#interpretation_35" id="interpretation_35"></a>

For more general information about moving averages, please see [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

The SMMA is often used with the [*SuperTrend*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#supertrend) indicator.

#### Further information <a href="#further-information_27" id="further-information_27"></a>

<http://www2.wealth-lab.com/wiki/SMMA.ashx>

#### Usage <a href="#usage_69" id="usage_69"></a>

```csharp
SMMA(int period)
SMMA(IDataSeries inSeries, int period)
SMMA(int period)[int barsAgo]
SMMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_66" id="return-value_66"></a>

**double**

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

#### Parameters <a href="#parameters_59" id="parameters_59"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_64" id="visualization_64"></a>

![SMMA - Smoothed Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/SMMA.jpg)

#### Example <a href="#example_65" id="example_65"></a>

```csharp
//Output for the value of the SMMA
Print("The current SMMA value is " + SMMA(14)[0]);
```


# TEMA - Triple Exponential Moving Average

#### Description <a href="#description_70" id="description_70"></a>

The TEMA is combined from a single, a double and a triple EMA. This combo improves the delay between the indicator and price movements. The Triple Exponential Moving Average is quite efficient at smoothing price changes.

You can find more information about moving averages here: [*Moving Averages*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#moving-averages).

#### Usage <a href="#usage_70" id="usage_70"></a>

```csharp
TEMA(int period)
TEMA(IDataSeries inSeries, int period)
TEMA(int period)[int barsAgo]
TEMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_67" id="return-value_67"></a>

**double**

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

#### Parameters <a href="#parameters_60" id="parameters_60"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_65" id="visualization_65"></a>

![TEMA - Triple Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/TEMA.jpg)

#### Example <a href="#example_66" id="example_66"></a>

```csharp
//Output for the Triple Exponential Moving Average
Print("The current TEMA value is " + TEMA(14)[0]);
```


# TMA - Triangular Moving Average

#### Description <a href="#description_71" id="description_71"></a>

This specifically weighted average has an extra smoothing component. The weightings are not linear, but instead take on a triangular pattern. To demonstrate, the weighting for a 7-period average would be 1,2,3,4,3,2,1. More weight is given to the median value of the time series, and the newest and oldest data is given less weight.

#### Usage <a href="#usage_71" id="usage_71"></a>

```csharp
TMA(int period)
TMA(IDataSeries inSeries, int period)
TMA(int period)[int barsAgo]
TMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_68" id="return-value_68"></a>

**double**

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

#### Parameters <a href="#parameters_61" id="parameters_61"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_66" id="visualization_66"></a>

![TMA - Triangular Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/TMA.jpg)

#### Example <a href="#example_67" id="example_67"></a>

```csharp
//Output for the value of the TMA
Print("The current value for the TMA is " + TMA(14)[0]);
```


# TRIX - Triple Exponential Moving Average

#### Description <a href="#description_72" id="description_72"></a>

Jack Hutson developed this TRIX indicator, which is a 1-day rate-of-change indicator. What this means is that day 2 is divided by day 1, day 3 by day 2 and so on and so forth, and this is then applied to a triple exponential moving average of the closing prices. This results in a zero line fluctuating oscillator which is used as trend indicator thanks to its stability.

#### Interpretation <a href="#interpretation_36" id="interpretation_36"></a>

A buy signal is created when the TRIX indicator crosses the zero line from bottom to top. A sell signal is generated when the zero line is broken in a downwards direction.

#### Usage <a href="#usage_72" id="usage_72"></a>

```csharp
TRIX(int period, int signalPeriod)
TRIX(IDataSeries inSeries, int period, int signalPeriod)
TRIX(int period, int signalPeriod)[int barsAgo]
TRIX(IDataSeries inSeries, int period, int signalPeriod)[int barsAgo]

//For the signal line
TRIX(int period, int signalPeriod).Signal[int barsAgo]
TRIX(IDataSeries inSeries, int period, int signalPeriod).Signal[int barsAgo]
```

#### Return value <a href="#return-value_69" id="return-value_69"></a>

**double**

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

#### Parameters <a href="#parameters_62" id="parameters_62"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

signal period Number of bars included in the signal line calculation

#### Visualization <a href="#visualization_67" id="visualization_67"></a>

![TRIX - Triple Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/TRIX.jpg)

#### Example <a href="#example_68" id="example_68"></a>

```csharp
//Output for the TRIX EMA
Print("The current TRIX value is " + TRIX(14, 3)[0]);

//Output for the TRIX signal line
Print("The current TRIX value is " + TRIX(14, 3).Signal[0]);
```


# T3 - Triple Exponential Moving Average

#### Description <a href="#description_73" id="description_73"></a>

The Triple Exponential Moving Average T3 indicator (also dubbed the T3MA) is calculated by taking the weighted sums of a simple, a double, and a triple EMA. This produces a smooth, soft indicator line. The parameter tCount allows the trader to set the number of reiterations. The calculation is the same as the calculation for the DEMA, with the slight difference that here, a volume factor is also added. It accepts values between 0 and 1 (default: 0.7).

#### Usage <a href="#usage_73" id="usage_73"></a>

```csharp
T3(int period, int tCount, double vFactor)
T3(IDataSeries inSeries, int period, int tCount, double vFactor)
T3(int period, int tCount, double vFactor)[int barsAgo]
T3(IDataSeries inSeries, int period, int tCount, double vFactor)[int barsAgo]
```

#### Return value <a href="#return-value_70" id="return-value_70"></a>

**double**

When using this method with an index (e.g. **T3**(14,3,0.7)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_63" id="parameters_63"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

tCount Number of iterations for the smoothing

vFactor Volume factor (multiplier)

#### Visualization <a href="#visualization_68" id="visualization_68"></a>

![T3 - Triple Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/T3.jpg)

#### Example <a href="#example_69" id="example_69"></a>

```csharp
//Output of the value for the T3 indicator
Print("The current T3 value is " + T3(14, 3, 0.7)[0]);
```


# VMA - Variable Moving Average

#### Description <a href="#description_74" id="description_74"></a>

This variation of an EMA automatically smoothes any fluctuations in the market, and its sensitivity grows as more weight is placed on more recent data.

The VMA attempts to get rid of the disadvantages of other moving averages by automatically regulating the smoothing constant. This is why the VMA can be implemented for most of the market conditions, and is in a few cases actually better than other averages.

**Caution** The VMA is not to be confused with the Volume Moving Average (VolMA)!

#### Usage <a href="#usage_74" id="usage_74"></a>

```csharp
VMA(int period, int volatilityPeriod)
VMA(IDataSeries inSeries, int period, int volatilityPeriod)
VMA(int period, int volatilityPeriod)[int barsAgo]
VMA(IDataSeries inSeries, int period, int volatilityPeriod)[int barsAgo]
```

#### Return value <a href="#return-value_71" id="return-value_71"></a>

**double**

When using this method with an index (e.g. **VMA**(9,9)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_64" id="parameters_64"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

volatility period Number of bars included in the calculation for the signal line

#### Visualization <a href="#visualization_69" id="visualization_69"></a>

![VMA - Variable Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/VMA.jpg)

#### Example <a href="#example_70" id="example_70"></a>

```csharp
//Output the VMA value
Print("The current VMA value is " + VMA(9, 9)[0]);
```


# VWMA - Volume Weighted Moving Average

#### Description <a href="#description_75" id="description_75"></a>

VWMA is a non-cumulated smoothed average that is weighted based on the various volumes for the periods.

#### Usage <a href="#usage_75" id="usage_75"></a>

```csharp
VWMA(int period)
VWMA(IDataSeries inSeries, int period)
VWMA(int period)[int barsAgo]
VWMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_72" id="return-value_72"></a>

**double**

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

#### Parameters <a href="#parameters_65" id="parameters_65"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_70" id="visualization_70"></a>

![VWMA - Volume Weighted Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/VWMA.jpg)

#### Example <a href="#example_71" id="example_71"></a>

```csharp
//Output for the VWMA
Print("The current VWMA value is " + VWMA(14)[0]);
```


# WMA - Weighted Moving Average

#### Description <a href="#description_76" id="description_76"></a>

The Weighted Moving Average is the most well-known of the weighted averages, and is implemented to identify and quickly react to price changes. Current prices are given higher weighting than older ones. In addition, bad signals in sideways markets are minimized. The WMA smoothes the price changes and makes more efficient trade identification possible.

#### Further information <a href="#further-information_28" id="further-information_28"></a>

<http://www.tradesignalonline.com/de/lexicon/view.aspx?id=Moving+Average+Weighted+%28WMA%29>

#### Usage <a href="#usage_76" id="usage_76"></a>

```csharp
WMA(int period)
WMA(IDataSeries inSeries, int period)
WMA(int period)[int barsAgo]
WMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_73" id="return-value_73"></a>

**double**

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

#### Parameters <a href="#parameters_66" id="parameters_66"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_71" id="visualization_71"></a>

![WMA - Weighted Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/WMA.jpg)

#### Example <a href="#example_72" id="example_72"></a>

```csharp
//Output for the WMA
Print("The current value of the WMA is " + WMA(14)[0]);
```


# ZLEMA - Zero Lag Exponential Moving Average

#### Description <a href="#description_77" id="description_77"></a>

The Zero Lag Exponential Moving Average is another variation of the EMA. Zero lag in this context signifies no delay, which means that the indicator adapts to the price changes more closely. The indicator does so by removing older price data and decreasing the cumulative effect in order to minimize the lag.

#### Further information <a href="#further-information_29" id="further-information_29"></a>

FMLabs: <http://www.fmlabs.com/reference/default.htm?url=ZeroLagExpMA.htm>

#### Usage <a href="#usage_77" id="usage_77"></a>

```csharp
ZLEMA(int period)
ZLEMA(IDataSeries inSeries, int period)
ZLEMA(int period)[int barsAgo]
ZLEMA(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_74" id="return-value_74"></a>

**double**

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

#### Parameters <a href="#parameters_67" id="parameters_67"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_72" id="visualization_72"></a>

![ZLEMA - Zero Lag Exponential Moving Average](https://agenatrader.github.io/AgenaIndicator-documentation/media/ZLEMA.jpg)

#### Example <a href="#example_73" id="example_73"></a>

```csharp
//Output for the value of the Zero Lag Exponential Moving Average
Print("The current ZLEMA value is " + ZLEMA(14)[0]);
```


# nBarsUp

#### Description <a href="#description_78" id="description_78"></a>

The nBarsUp indicator looks for a specified number of rising closing prices. Other conditions can also be added to the search, for example: Constantly rising bars, i.e. close < open (red candles) Constantly rising highs Constantly rising lows

#### Usage <a href="#usage_78" id="usage_78"></a>

```csharp
NBarsUp(int barCount, bool BarUp, bool higherHigh, bool higherLow)
NBarsUp(IDataSeries inSeries, int barCount, bool BarUp, bool higherHigh, bool higherLow)
NBarsUp(int barCount, int barCount, bool BarUp, bool higherHigh, bool higherLow)[int barsAgo]
NBarsUp(IDataSeries inSeries, int barCount, bool BarUp, bool higherHigh, bool higherLow)[int barsAgo]
```

#### Return value <a href="#return-value_75" id="return-value_75"></a>

**double**

When using this method with an index (e.g. **NBarsUp**(...)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

1 – The condition applies 0 – The condition does not apply

#### Parameters <a href="#parameters_68" id="parameters_68"></a>

inSeries Input data series for the indicator

barCount Number of successively rising closing prices

barUp Additional condition (true): each close must be higher than the open (green bar)

higherHigh Additional condition (true): continuously rising highs

higherLow Additional condition (true): continuously rising lows

#### Visualization <a href="#visualization_73" id="visualization_73"></a>

![nBarsUp](https://agenatrader.github.io/AgenaIndicator-documentation/media/nBarsUp.jpg)

#### Example <a href="#example_74" id="example_74"></a>

```csharp
// Look for 3 successively rising closing prices
if (NBarsUp(3, true, true, true)[0] == 1)
Print("3 successively higher closing prices have occurred.");
```


# nBarsDown

#### Description <a href="#description_79" id="description_79"></a>

The nBarsDown indicator looks for a specified number of falling closing prices.

The following conditions can also be included in the search: - Constantly falling bars - Constantly falling highs - Constantly falling lows

#### Usage <a href="#usage_79" id="usage_79"></a>

```csharp
NBarsDown(int barCount, bool BarDown, bool lowerHigh, bool lowerLow)
NBarsDown(IDataSeries inSeries, int barCount, bool BarDown, bool lowerHigh, bool lowerLow)
NBarsDown(int barCount, bool BarDown, bool lowerHigh, bool lowerLow)[int barsAgo]
NBarsDown(IDataSeries inSeries, bool barCount, int BarDown, bool lowerHigh, bool lowerLow)[int barsAgo]
```

#### Return value <a href="#return-value_76" id="return-value_76"></a>

**double**

When using this method with an index (e.g. **NBarsDown**(...)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

1 – The condition applies 0 – The condition does not apply

#### Parameters <a href="#parameters_69" id="parameters_69"></a>

inSeries Input data series for the indicator

barCount Required number of successively lower closing prices

barDown Additional condition (true): each close must be lower than the open

lowerHigh Additional condition (true): continuously falling highs

lowerLow Additional condition (true); continuously falling lows

#### Visualization <a href="#visualization_74" id="visualization_74"></a>

![nBarsDown](https://agenatrader.github.io/AgenaIndicator-documentation/media/nBarsDown.jpg)

#### Example <a href="#example_75" id="example_75"></a>

```csharp
NBarsDown(int barCount, bool BarDown, bool lowerHigh, bool lowerLow)
NBarsDown(IDataSeries inSeries, int barCount, bool BarDown, bool lowerHigh, bool lowerLow)
NBarsDown(int barCount, bool BarDown, bool lowerHigh, bool lowerLow)[int barsAgo]
NBarsDown(IDataSeries inSeries, bool barCount, int BarDown, bool lowerHigh, bool lowerLow)[int barsAgo]
```


# OnBalanceVolume (OBV)

#### Description <a href="#description_80" id="description_80"></a>

This indicator displays the buy or sell pressure. For each day with a positive close, the volume is added cumulatively, and it is subtracted for days with a close that is smaller than the open.

#### Interpretation <a href="#interpretation_37" id="interpretation_37"></a>

Granville theorized that volume precedes price. OBV rises when volume on up days outpaces volume on down days. OBV falls when volume on down days is stronger. A rising OBV reflects positive volume pressure that can lead to higher prices. Conversely, falling OBV reflects negative volume pressure that can foreshadow lower prices. Granville noted in his research that OBV would often move before price. Expect prices to move higher if OBV is rising while prices are either flat or moving down. Expect prices to move lower if OBV is falling while prices are either flat or moving up.

The absolute value of OBV is not important. Chartists should instead focus on the characteristics of the OBV line. First define the trend for OBV. Second, determine if the current trend matches the trend for the underlying security. Third, look for potential support or resistance levels. Once broken, the trend for OBV will change and these breaks can be used to generate signals. Also notice that OBV is based on closing prices. Therefore, closing prices should be considered when looking for divergences or support/resistance breaks. And finally, volume spikes can sometimes throw off the indicator by causing a sharp move that will require a settling period. (Source: Stockcharts.com)

#### Usage <a href="#usage_80" id="usage_80"></a>

```csharp
OBV()
OBV(IDataSeries inSeries)
OBV()[int barsAgo]
OBV(IDataSeries inSeries)[int barsAgo]
```

#### Return value <a href="#return-value_77" id="return-value_77"></a>

**double**

When using this method with an index (e.g. **OBV**()\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameter <a href="#parameter_7" id="parameter_7"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization_75" id="visualization_75"></a>

![OnBalanceVolume (OBV)](https://agenatrader.github.io/AgenaIndicator-documentation/media/OBV.jpg)

#### Example <a href="#example_76" id="example_76"></a>

```csharp
//Output the value for the On Balance Volume (OBV)
Print("The current value for the OBV is " + OBV()[0]);
```


# OutsideBars

#### Description <a href="#description_81" id="description_81"></a>

The Outside Bars indicator is in fact an outdated version of the [*InsideBarsMT*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#insidebarsmt).


# Parabolic SAR

#### Description <a href="#description_83" id="description_83"></a>

Welles Wilder came up with the Parabolic SAR, which denotes a price and time-based trading system. Wilder named this the "Parabolic Time/Price System." SAR signifies "stop and reverse," which is the name of the actual indicator used in his system, where **SAR trails price as the trend extends over time**. When prices are rising, the indicator is below them, and when prices are falling, it is above them. Therefore the indicator stops and reverses when the price trend reverses and breaks either above or below the indicator.

Wilder used his new book, New Concepts in Technical Trading Systems, to introduce the Parabolic Time/Price System in 1978. The book also discusses RSI, Average True Range, and the Directional Movement Concept (ADX). Although they were created before the computer age, Wilder's indicators function equally well today and have a high reputation.

SAR follows the price, and can be considered a trend-following indicator. If a downtrend reverses and starts up, SAR follows the prices just like a trailing stop. This stop continues to rise so long as the uptrend remains intact, which means that the SAR never decreases in an uptrend and is always protecting profits as prices move forwards. Once the price stops rising and reverses below SAR, a downtrend starts and SAR is above the price. SAR follows prices lower like a trailing stop, as mentioned before. The stop continuously falls as long as the downtrend continues to exist. Due to the fact that SAR never rises in a downtrend, it always protects profits on short positions.

#### Further information <a href="#further-information_30" id="further-information_30"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Parabolic_SAR>

Wikipedia: <http://en.wikipedia.org/wiki/Parabolic_SAR>

#### Usage <a href="#usage_81" id="usage_81"></a>

```csharp
ParabolicSAR(double acceleration, double accelerationStep, double accelerationMax)
ParabolicSAR(IDataSeries inSeries, double acceleration, double accelerationStep, double accelerationMax)
ParabolicSAR(double acceleration, double accelerationStep, double accelerationMax)[int barsAgo]
ParabolicSAR(IDataSeries inSeries, double acceleration, double accelerationStep, double accelerationMax)[int barsAgo]
```

#### Return value <a href="#return-value_78" id="return-value_78"></a>

**double**

When using this method with an index (e.g. **ParabolicSAR**(...)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_71" id="parameters_71"></a>

|                  |                                     |
| ---------------- | ----------------------------------- |
| acceleration     | Acceleration                        |
| accelerationStep | Increment of the acceleration       |
| accelerationMax  | Maximum acceleration                |
| InSeries         | Input data series for the indicator |

#### Visualization <a href="#visualization_76" id="visualization_76"></a>

![Parabolic SAR](https://agenatrader.github.io/AgenaIndicator-documentation/media/ParabolicSAR.jpg)

#### Example <a href="#example_77" id="example_77"></a>

```csharp
//Output of the value for the PSAR
Print("The current value for the Parabolic SAR is " + ParabolicSAR(0.02, 0.2, 0.02)[0]);
```


# Percentage Price Oscillator (PPO)

#### Description <a href="#description_84" id="description_84"></a>

The Percentage Price Oscillator displays the percentage difference between two moving averages. It is classed as a momentum indicator and is similar to the MACD in its construction.

#### Interpretation <a href="#interpretation_39" id="interpretation_39"></a>

The PPO can be used for divergence analysis. The divergences have the advantage of having a higher percentual hit rate. On the downside, they often appear too early and thus are hard for newer traders to assess properly.

#### Usage <a href="#usage_82" id="usage_82"></a>

```csharp
PPO(int fast, int slow, int smooth)
PPO(IDataSeries inSeries, int fast, int slow, int smooth)
PPO(int fast, int slow, int smooth)[int barsAgo]
PPO(IDataSeries inSeries, int fast, int slow, int smooth)[int barsAgo]

//For the smoothed value
PPO(int fast, int slow, int smooth).Smoothed[int barsAgo]
PPO(IDataSeries inSeries, int fast, int slow, int smooth).Smoothed[int barsAgo]
```

#### Return value <a href="#return-value_79" id="return-value_79"></a>

**double**

When using this method with an index (e.g. **PPO**(12,26,9)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_72" id="parameters_72"></a>

inSeries Input data series for the indicator

fast Number of bars for the calculation of the fast EMA

slow Number of bars for the calculation of the slow EMA

smooth Number of bars for the calculation of the EMA signal line

#### Visualization <a href="#visualization_77" id="visualization_77"></a>

![Percentage Price Oscillator (PPO)](https://agenatrader.github.io/AgenaIndicator-documentation/media/PPO.jpg)

#### Example <a href="#example_78" id="example_78"></a>

```csharp
//Output for the PPO
Print("The current value for the PPO is " + PPO(12, 26, 9)[0]);

//Output for the value of the PPO smoothed
Print("The current value for the PPO is " + PPO(12, 26, 9).Smoothed[0]);
```


# PercentEnvelopes

#### Description <a href="#description_85" id="description_85"></a>

The Percent Envelopes indicator draws an upper and a lower band around a predefined value with a distance of a specified percentage value. The trader can specify which data series the entry value should be (highs, lows, closing price, another indicator etc.).

It is possible to use an SMA as the entry value. In this case, the upper and lower bands will be displayed with a distance of 1.5%.

#### Interpretation <a href="#interpretation_40" id="interpretation_40"></a>

Similarly to the Bollinger Bands, the Percent Envelope indicator can be used to make buy or sell decisions and to determine whether the price is under- or overvalued.

The Percent Envelope should never be used to make decisions based solely on the output, but should be used in conjunction with other indicators to confirm signals.

#### Usage <a href="#usage_83" id="usage_83"></a>

```csharp
PercentEnvelopes(double percent)
PercentEnvelopes(IDataSeries inSeries, double percent)

//For the upper band
PercentEnvelopes(double percent).UpperPercentBand[int barsAgo]
PercentEnvelopes(IDataSeries inSeries, double percent).UpperPercentBand[int barsAgo]

//For the lower band
PercentEnvelopes(double percent).LowerPercentBand[int barsAgo]
PercentEnvelopes(IDataSeries inSeries, double percent).LowerPercentBand[int barsAgo]
```

#### Return value <a href="#return-value_80" id="return-value_80"></a>

**double**

When using this method with an index (e.g. **PercentEnvelopes**(2)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_73" id="parameters_73"></a>

inSeries Input data series for the indicator

percent Difference in % for the bands (from the input value)

#### Visualization <a href="#visualization_78" id="visualization_78"></a>

![PercentEnvelopes](https://agenatrader.github.io/AgenaIndicator-documentation/media/PercentEnvelopes.jpg)

#### Example <a href="#example_79" id="example_79"></a>

```csharp
//Output for the upper band
Print("Value of the upper percent band is: " + PercentEnvelopes(3).UpperPercentBand[0]);

//Output for the lower band
Print("Value of the lower percent band is: " + PercentEnvelopes(3).LowerPercentBand[0]);
```


# Pivot Points

#### Description <a href="#description_86" id="description_86"></a>

This indicator, based on the price zone approach invented by Dr. Bruce Gould, has been honed over the years. In the beginning, the price zones were calculated using the price developments of the last 2-3 years. Nowadays, however, the practical concept of pivot points is taken from the calculation of price zones in the daily chart, using the previous day’s periods as the basis. The goal hereby is to determine price levels that one could use as potential resistance zones (R1..R3) or support zones (S1..S3). The following methods can be used to calculate the indicator: Classic, Floor, Woodie, Camarilla, Fibonacci. The Classic and Floor methods are often wrongly named within literature, which is why in AgenaTrader you will find that the Classic method is labeled as “Floor” and vice versa. The indicator displays the pivot points for intraday charts, and the parameter “ShowPrices” allows you to display the price on the levels. The parameter “DaysBack” allows you to set the number of periods in the past that should be used for the calculation. The line coloring can be defined manually

#### Interpretation <a href="#interpretation_41" id="interpretation_41"></a>

Traders prefer to sell above the resistance lines 1 & 2 (e.g. to build up short positions), and to start building up tactical long positions at the support lines.

#### Further information <a href="#further-information_31" id="further-information_31"></a>

<http://www.finanznachrichten.de/nachrichten-2008-01/9833653-was-sind-pivot-punkte-und-wie-kann-ich-sie-handeln-005.htm>

<http://www.aktienboard.com/forum/f38/7-kapitel-pivot-points-t36428/>

<http://www.forexschule.com/schule/wie-man-mit-hilfe-von-pivot-punkten-handelt-50>

#### Usage <a href="#usage_84" id="usage_84"></a>

```csharp
PivotPoints()
PivotPoints(PivotPointsMode mode)
PivotPoints(PivotPointsMode mode, int LineWidth, bool ShowPrices, int DaysBack, Color RColor, Color PPColor, Color SColor)
PivotPoints(IDataSeries inSeries, PivotPointsMode mode, int LineWidth, bool ShowPrices, int DaysBack, Color RColor, Color PPColor, Color SColor)
PivotPoints()[barsAgo]
PivotPoints(PivotPointsMode mode)[barsAgo]
PivotPoints(PivotPointsMode mode, int LineWidth, bool ShowPrices, int DaysBack, Color RColor, Color PPColor, Color SColor)[barsAgo]
PivotPoints(IDataSeries inSeries, PivotPointsMode mode, int LineWidth, bool ShowPrices, int DaysBack, Color RColor, Color PPColor, Color SColor)[barsAgo]
```

#### Return value <a href="#return-value_81" id="return-value_81"></a>

This class has the following public methods (as data series), which all return double values:

**PP, S1, S2, S3, R1, R2 ,R3**

#### Example: <a href="#example_80" id="example_80"></a>

```csharp
PivotPoints().PP[int barsAgo]
PivotPoints(PivotPointsMode.Classic).S3[int barsAgo]
```

#### Parameters <a href="#parameters_74" id="parameters_74"></a>

|                           |                                                                                             |
| ------------------------- | ------------------------------------------------------------------------------------------- |
| InSeries                  | Input data series for the indicator                                                         |
| PivotPointsMode           | Calculatory method. Default: floor                                                          |
| PivotPointsMode.Classic   |                                                                                             |
| PivotPointsMode.Floor     |                                                                                             |
| PivotPointsMode.Woodie    |                                                                                             |
| PivotPointsMode.Camarilla |                                                                                             |
| PivotPointsMode.Fibonacci |                                                                                             |
| LineWidth                 | Default: 1                                                                                  |
| ShowPrices                | Shows prices next to the lines. Default:false                                               |
| DaysBack                  | The number of historical periods to be included in the display of the pivot lines Default:0 |
| RColor                    | Resistance line color                                                                       |
| PPColor                   | Pivot line color                                                                            |
| SColor                    | Support line color                                                                          |
| Show Regions              | Color fill space between lines                                                              |
| Extend Lines to Future    | Extend lines to latest data                                                                 |

#### Visualization <a href="#visualization_79" id="visualization_79"></a>

![Pivot Points](https://agenatrader.github.io/AgenaIndicator-documentation/media/PivotPoints.jpg)

#### Example <a href="#example_81" id="example_81"></a>

```csharp
//Output current pivot point
Print("The floor pivot point is located at: " + PivotPoints()[0]);
//Output first support (S1)
Print("The first pivot support (S1) is at: " + PivotPoints().S1[0]);
```

#### Calculation <a href="#calculation_6" id="calculation_6"></a>

H=yesterday’s high, L=yesterday’s low, O=yesterday’s open, C=yesterday’s close

Range = H-L

**Classic**

pp = (H + L + C)/3

r1 = 2\*pp - L

s1 = 2\*pp - H

r2 = pp - s1 + r1

s2 = pp - r1 + s1

r3 = H + 2\*(pp - L)

s3 = L - 2\*(H - pp)

**Floor**

pp = (H + L + C)/3

r1 = 2\*pp - L

s1 = 2\*pp - H

r2 = pp + Range

s2 = pp - Range

r3 = pp + 2\*Range

s3 = pp - 2\*Range

**Woodie**

pp = (H + L + 2\*C)/4

r1 = 2\*pp - L

s1 = 2\*pp - H

r2 = pp + H - L

s2 = pp - H + L

r3 = 0.0

s3 = 0.0

**Camarilla**

pp = (H + L + C)/3

r1 = C + Range \* 1.1 / 12

s1 = C - Range \* 1.1 / 12

r2 = C + Range \* 1.1 / 6

s2 = C - Range \* 1.1 / 6

r3 = C + Range \* 1.1 / 4

s3 = C - Range \* 1.1 / 4

**Fibonacci**

pp = (H + L + C)/3

r1 = pp + 0.382 \* Range

s1 = pp - 0.382 \* Range

r2 = pp + 0.618 \* Range

s2 = pp - 0.618 \* Range

r3 = pp + 0.764 \* Range

s3 = pp - 0.764 \* Range


# Polarized Fractal Efficiency (PFE)

#### Description <a href="#description_87" id="description_87"></a>

Hans Hannula developed the PFE, which is categorized as a momentum indicator. It uses the methods of fractal geometry and chaos theory to determine the price efficiency of the movements.

#### Interpretation <a href="#interpretation_42" id="interpretation_42"></a>

When the PFE zigzags around the zero line, no trend is present. If the PFE is equally formed and running above the zero line, the market is in an uptrend. The higher the value, the stronger the uptrend.

#### Usage <a href="#usage_85" id="usage_85"></a>

```csharp
PFE(int period)
PFE(IDataSeries inSeries, int period)
PFE(int period)[int barsAgo]
PFE(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_82" id="return-value_82"></a>

**double**

When using this method with an index (e.g. **PFE**(20)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_75" id="parameters_75"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_80" id="visualization_80"></a>

![Polarized Fractal Efficiency (PFE)](https://agenatrader.github.io/AgenaIndicator-documentation/media/PFE.jpg)

#### Example <a href="#example_82" id="example_82"></a>

```csharp
//Output for the value of the Polarized Fractal Efficiency (PFE)
Print("The current value for the PFE is: " + PFE(20)[0]);
```


# Price Oscillator

#### Description <a href="#description_88" id="description_88"></a>

This indicator is based on the difference between two moving averages. The difference is measured in absolute values, not in percentages.

#### Usage <a href="#usage_86" id="usage_86"></a>

```csharp
PriceOscillator(int fast, int slow, int smooth)
PriceOscillator(IDataSeries inSeries, int fast, int slow, int smooth)
PriceOscillator(int fast, int slow, int smooth)[int barsAgo]
PriceOscillator(IDataSeries inSeries, int fast, int slow, int smooth)[int barsAgo]
```

#### Return value <a href="#return-value_83" id="return-value_83"></a>

**double**

When using this method with an index (e.g. **PriceOscillator**(12,26,9)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_76" id="parameters_76"></a>

inSeries Input data series for the indicator

fast Number of bars used for the calculation of the fast EMA

slow Number of bars used for the calculation of the slow EMA

smooth Number of bars used for the calculation of the EMA signal line

#### Visualization <a href="#visualization_81" id="visualization_81"></a>

![Price Oscillator](https://agenatrader.github.io/AgenaIndicator-documentation/media/PriceOscillator.jpg)

#### Example <a href="#example_83" id="example_83"></a>

```csharp
//Output for the value of the price oscillator
Print("The current value for the PPO is " + PriceOscillator(12, 26, 9)[0]);
//Output for the value of the smooth price oscillator
Print("The current value for the smooth is " + PriceOscillator(12, 26, 9).Smoothed[0]);
```


# Rainbow

#### Description <a href="#description_89" id="description_89"></a>

The rainbow indicator is represented by the set of the moving average indicator lines. Each of these lines is placed closer or further from the chart depending on the time period taken into the account for calculation of moving averages.

#### Introduction <a href="#introduction" id="introduction"></a>

The rainbow indicator has some advantages comparing to the single moving average lines because it shows better, where the trend reversal occurs. When divergence in all lines is substantial - this is a signal of a strong up- or downtrend movement. By default red lines are the closest to the chart and represent the moving average line with the smallest time period. Yellow lines indicate short-term trends. Blue display the area for short-term traders’ activity. Green is typify for medium-term trends. Pink lines can be usefull for traders who hold positions for a long period.

#### Return value <a href="#return-value_84" id="return-value_84"></a>

Colors:

Yellow ЕМА: 2,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15; Blue ЕМА: 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41; Green ЕМА: 44, 47, 50, 53, 56, 59, 62, 65, 68, 71, 74; Red ЕМА: 78, 82, 86, 90, 94, 98, 102, 106, 110, 114, 118, 122; Pink ЕМА: 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200.

#### Parameters <a href="#parameters_77" id="parameters_77"></a>

|                |                                                                                                                                                                                                                                                                                    |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MA Type        | Allows to select between the types of the moving average lines that shape a rainbow indicator. Default setting is the EMA (exponential moving average) but it is possible to choose a simple (SMA), hull (HMA) and weighted (WMA) moving average lines                             |
| Low MA Period  | Shows the smallest amount of time periods for which the moving average will be calculated. For example, the setting “2” for the daily chart indicates the two latest daily closing prices.                                                                                         |
| High MA Period | Shows the largest amount of time periods for which the moving average will be calculated.                                                                                                                                                                                          |
| Step           | Defines the amount of moving average lines shown on a chart within the rainbow indicator. The smaller is this number the larger amount of lines will be plotted. In our example, step 2 would mean that the indicator will contain 80 EMA lines: EMA(2), EMA(4), EMA(6) and so on. |

#### Visualisation <a href="#visualisation" id="visualisation"></a>

![Rainbow](https://agenatrader.github.io/AgenaIndicator-documentation/media/Rainbow.jpg)


# Range

#### Description <a href="#description_90" id="description_90"></a>

Range delivers the span/difference between the high and low in ticks for each bar. The range is always greater than or equal to 0.

#### Usage <a href="#usage_87" id="usage_87"></a>

```csharp
Range()
Range(IDataSeries inSeries)
Range()[int barsAgo]
Range(IDataSeries inSeries)[int barsAgo]
```

#### Return value <a href="#return-value_85" id="return-value_85"></a>

**double**

When using this method with an index (e.g. **Range**()\[**int** barsAgo] ), the range value for the referenced bar will be outputted.

#### Parameter <a href="#parameter_8" id="parameter_8"></a>

inSeries Input data series for the indicator

#### Visualization <a href="#visualization_82" id="visualization_82"></a>

![Range](https://agenatrader.github.io/AgenaIndicator-documentation/media/Range.jpg)

#### Example <a href="#example_84" id="example_84"></a>

```csharp
//Output for the value of the range
Print("The current bar has a range of: " + Range()[0]);

//Identical output
Print("The current bar has a range of: " + High[0] - Low[0]);
```


# Range Indicator (RIND)

#### Description <a href="#description_91" id="description_91"></a>

Jack Weinberg created the Range Indicator (RIND), which was first published in 1954. The RIND compares the intraday span (range) between the high and low to the span (range) between the current closing price and the closing price from the day before.

#### Interpretation <a href="#interpretation_43" id="interpretation_43"></a>

When the span between the current close and the previous days close is bigger than the intraday span between high and low, the indicator will display a high value. This signals a potential trend change...

#### Further information <a href="#further-information_32" id="further-information_32"></a>

<http://www.fmlabs.com/reference/default.htm?url=RangeIndicator.htm>

#### Usage <a href="#usage_88" id="usage_88"></a>

```csharp
RIND(int periodQ, int smooth)
RIND(IDataSeries inSeries, int periodQ, int smooth)
RIND(int periodQ, int smooth)[int barsAgo]
RIND(IDataSeries inSeries, int periodQ, int smooth)[int barsAgo]
```

#### Return value <a href="#return-value_86" id="return-value_86"></a>

**double**

When using this method with an index (e.g. **RIND**(3,10)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_78" id="parameters_78"></a>

inSeries Input data series for the indicator

periodQ Number of bars used for the short-term stochastic

smooth Number of bars used for smoothing the indicator (using an EMA)

#### Visualization <a href="#visualization_83" id="visualization_83"></a>

![Range Indicator (RIND)](https://agenatrader.github.io/AgenaIndicator-documentation/media/Rind.jpg)

#### Example <a href="#example_85" id="example_85"></a>

```csharp
//Output
Print("The current value for the PFE is: " + RIND(3, 10)[0]);
```


# Rate of Change (ROC)

#### Description <a href="#description_92" id="description_92"></a>

The Rate of Change Indicator is a simple yet effective momentum oscillator. It measures the relative percentage change of the prices from one period to the next. The calculation looks at the current price and compares it to the price of n periods ago.

#### Interpretation <a href="#interpretation_44" id="interpretation_44"></a>

As long as the ROC is above 0, the uptrend is intact. As long as the ROC is below 0, the downtrend is intact. Divergences between the indicator and the price development can hint to a trend change.

#### Further information <a href="#further-information_33" id="further-information_33"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/RoC>

#### Usage <a href="#usage_89" id="usage_89"></a>

```csharp
ROC(int period)
ROC(IDataSeries inSeries, int period)
ROC(int period)[int barsAgo]
ROC(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_87" id="return-value_87"></a>

**double**

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

#### Parameters <a href="#parameters_79" id="parameters_79"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_84" id="visualization_84"></a>

![Rate of Change (ROC)](https://agenatrader.github.io/AgenaIndicator-documentation/media/ROC.jpg)


# Relative Performance

#### Description <a href="#description_94" id="description_94"></a>

Calculates the price ratio between current and selected symbols.

#### Further information <a href="#further-information_34" id="further-information_34"></a>

<http://stockcharts.com/articles/mailbag/2012/01/how-can-i-chart-relative-performance-qqq-underperforms-spy-.html?st=relative+performance>

<http://www.wikinvest.com/wiki/Relative\\_performance>

#### Usage <a href="#usage_90" id="usage_90"></a>

```csharp
RelativePerformance (Instrument)
RelativePerformance (Instrument)[int barsAgo]
```

#### Return value <a href="#return-value_88" id="return-value_88"></a>

**double**

#### Parameters <a href="#parameters_81" id="parameters_81"></a>

IInstrument

#### Visualization <a href="#visualization_85" id="visualization_85"></a>

![Relative Performance](https://agenatrader.github.io/AgenaIndicator-documentation/media/RelativePerformance.png)


# Relative Spread Strength (RSS)


# Relative Strength Index (RSI)

#### Description <a href="#description_96" id="description_96"></a>

J. Welles Wilder, the creator of several indicators, also developed the RSI, which is one of the most popular, useful momentum oscillators. It compares the size of the most recent profits with the size of the most recent losses, which means that it assesses the relationships between the up and down closing prices. The values are shown between 0 and 100.

#### Interpretation <a href="#interpretation_46" id="interpretation_46"></a>

Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30. Signals can also be generated by searching for divergences, failure swings and centerline crossovers. RSI can also be used to identify the general trend. These traditional levels can also be adjusted to better fit the security or analytical requirements. Raising overbought to 80 or lowering oversold to 20 will reduce the number of overbought/oversold readings. Short-term traders sometimes use 2-period RSI to look for overbought readings above 80 and oversold readings below 20.

#### Further information <a href="#further-information_35" id="further-information_35"></a>

<http://technische-analyse.eu/index.php?title=RSI>

#### Usage <a href="#usage_92" id="usage_92"></a>

```csharp
RSI(int period, int smooth)
RSI(IDataSeries inSeries, int period, int smooth)
RSI(int period, int smooth)[int barsAgo]
RSI(IDataSeries inSeries, int period, int smooth)[int barsAgo]

//For the average value
RSI(int period, int smooth).Avg[int barsAgo]
RSI(IDataSeries inSeries, int period, int smooth).Avg[int barsAgo]
```

#### Return value <a href="#return-value_90" id="return-value_90"></a>

**double**

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

#### Parameters <a href="#parameters_83" id="parameters_83"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

smooth Number of periods for the smoothing

#### Visualization <a href="#visualization_87" id="visualization_87"></a>

![Relative Strength Index (RSI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/RSI.jpg)

#### Example <a href="#example_87" id="example_87"></a>

```csharp
//Output for the RSI
Print("The current value for the RSI is: " + RSI(14, 3)[0]);

//Output for the average line
Print("The current value for the AVG line is: " + RSI(14, 3).Avg[0]);
```


# Relative Strength Levy (RSL)

#### Description <a href="#description_97" id="description_97"></a>

The concept of the Relative Strength according to R.A. Levy is that the past developments play a very important role in the strength that will be seen in the future. The current performance is compared to the past performance.

The calculation involves taking the weekly closes (or daily closes) and dividing them by the arithmetic mean of the closing prices for the examined period. The result is then balanced around the 10 marker, and an ordered list is created where the value of the highest RSL fills the first place.

#### Usage <a href="#usage_93" id="usage_93"></a>

```csharp
RSL(int period)
RSLDataSeries inSeries, int period)
RSLnt period)[int barsAgo]
RSL(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_91" id="return-value_91"></a>

**double**

When using this method with an index (e.g. **RSL**(27)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_84" id="parameters_84"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_88" id="visualization_88"></a>

![Relative Strength Levy (RSL)](https://agenatrader.github.io/AgenaIndicator-documentation/media/RSL.png)

#### Example <a href="#example_88" id="example_88"></a>

```csharp
//RSL value output
Print("The Relative Strength as calculated by Levy is " + RSL(27)[0]);
```


# Relative Volatility Index (RVI)

#### Description <a href="#description_98" id="description_98"></a>

The Relative Volatility Index (RVI) has many similarities to the RSI indicator. Donald Dorsey developed the RVI, which uses the standard deviation instead of the daily price span. To determine the underlying volatility of the instrument, the RVI uses the standard deviation over a period of 10. The RSI indicator is then used on the results, which normalizes them. What comes from this is displayed on a scale of 1 to 100.

#### Interpretation <a href="#interpretation_47" id="interpretation_47"></a>

Values above 50 assume an increase in volatility. Values below 50 imply a drop in volatility. Dorsey recommends using the indicator as a filter for other indicators.

#### Further information <a href="#further-information_36" id="further-information_36"></a>

<http://vtadwiki.vtad.de/index.php/Relative_Volatility_Index_%28RVI%29>

#### Usage <a href="#usage_94" id="usage_94"></a>

```csharp
RVI(int period)
RVI(IDataSeries inSeries, int period)
RVI(int period)[int barsAgo]
RVI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_92" id="return-value_92"></a>

**double**

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

#### Parameters <a href="#parameters_85" id="parameters_85"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_89" id="visualization_89"></a>

![Relative Volatility Index (RVI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/RVI.jpg)

#### Example <a href="#example_89" id="example_89"></a>

```csharp
//Output of the RVI value
Print("The current value for the RVI is: " + RVI(14)[0]);
```


# R-Squared

#### Description <a href="#description_100" id="description_100"></a>

This indicator belongs to the linear regression series. R-Squared is the correlation coefficient that specifies the quality of the linear regression line.

It is the calculation that gives R-Squared its name – the value is the square of the correlation coefficient, which in mathematics is prefixed with the Greek letter Rho (P).

See [*Linear Regression*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linearregression), [*LinRegSlope*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregslope), [*LinRegIntercept*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#linregintercept).

#### Interpretation <a href="#interpretation_49" id="interpretation_49"></a>

The value of the oscillator fluctuates between 0 and 1. By default, the upper boundary line is located at 0.75, and the lower border is at 0.2. If the prices are in a sideways movement, the data is scattered around the regression line. R-Squared will have a value of 0 in the aforementioned situation. In a strong trend phase, the prices will remain within a tight range for an extended period of time; if these are located close to the regression line then the R-Squared indicator will have a value of 1. Stanley Kroll and Tuchar Chande used the correlation coefficient as a trend filter in their book “*The new technical trader*”.

#### Further information <a href="#further-information_37" id="further-information_37"></a>

<http://www.blastchart.com/Community/IndicatorGuide/Indicators/LinearRegressionRSquared.aspx>

#### Usage <a href="#usage_96" id="usage_96"></a>

```csharp
RSquared(int period)
RSquared(IDataSeries inSeries, int period)
RSquared(int period)[int barsAgo]
RSquared(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_94" id="return-value_94"></a>

**double**

When using this method with an index (e.g. **RSquared**(8)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_87" id="parameters_87"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_91" id="visualization_91"></a>

![R-Squared](https://agenatrader.github.io/AgenaIndicator-documentation/media/RSquared.jpg)

#### Example <a href="#example_91" id="example_91"></a>

```csharp
//Output for the value of R-Squared
Print("The current value of R-Squared is: " + RSquared(8)[0]);
```


# Standard Error (StdError)

#### Description <a href="#description_102" id="description_102"></a>

Jon Anderson came up with the Standard Error Bands, which are similar to the Bollinger Bands, but with a different calculation. An upper and a lower boundary around a middle line create the bands – this is also known as the linear regression. The lower standard error band results from the subtraction of two standard errors from the final value of the regression line. Because individual closing prices can have a huge influence on the values of the bands, it is necessary to use a Simple Moving Average to smooth the data.

#### Interpretation <a href="#interpretation_51" id="interpretation_51"></a>

One of the applications of the standard error bands is the tightening of the bands when prices rise/fall. If the bands tighten, it signifies that a trend is currently in place. A strong trend will continue to tighten the bands.

#### Further information <a href="#further-information_39" id="further-information_39"></a>

<http://www.forexrealm.com/technical-analysis/technical-indicators/standard-error-bands.html>

#### Usage <a href="#usage_98" id="usage_98"></a>

```csharp
StdError(int period)
StdError(IDataSeries inSeries, int period)
StdError(int period)[int barsAgo]
StdError(IDataSeries inSeries, int period)[int barsAgo]

//Upper band
StdError(int period).Upper[int barsAgo]
StdError(IDataSeries inSeries, int period).Upper[int barsAgo]

//Lower band
StdError(int period).Lower[int barsAgo]
StdError(IDataSeries inSeries, int period).Lower[int barsAgo]
```

#### Return value <a href="#return-value_96" id="return-value_96"></a>

**double**

When using this method with an index (e.g. **StdError**(21)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_89" id="parameters_89"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_93" id="visualization_93"></a>

![Standard Error (StdError)](https://agenatrader.github.io/AgenaIndicator-documentation/media/StdError.jpg)

#### Example <a href="#example_93" id="example_93"></a>

```csharp
//Output for the values of the middle line
Print("The middle line is currently at: " + StdError(21)[0]);

//Output for the lower band
Print("The lower band of the standard error is currently at: " + StdError(21).Lower[0]);

//output for the upper band
Print("The upper band of the standard error is currently at: " + StdError(21).Upper[0]);
```


# Stochastics

#### Description <a href="#description_103" id="description_103"></a>

The stochastic indicator was developed by George C. Lane in the 1950s. It belongs to the class “momentum indicators” (oscillators) and represents the current closing price in relation to a high or low area over a defined number of periods. The stochastic indicator is based on the observation that in an uptrend, the closing price is close to the daily high, while in a downtrend, the closing price is closer to the daily low. The stochastic indicator consists of two exponential Average Lines (%K and %D), both of which range between 0 and 100. There are two types of stochastic: the classic slow stochastic and the fast stochastic.

**Fast stochastic:** The %D line is the smoothing average of the %K line

**Slow stochastic:** The %D is the basis on which the smoothing average is calculated. The slow stochastic smoothes the fast stochastic, thus stabilizing the oscillator.

#### Interpretation <a href="#interpretation_52" id="interpretation_52"></a>

The closing prices found in the upper area imply an accumulation (buying pressure); the lower area represents selling pressure. The stochastic indicator is a classic oscillator, and is primarily used in sideways markets in order to determine the reversal points. Days with a stable trend will not provide the indicator with any relevant or valuable results/information.

#### Further information <a href="#further-information_40" id="further-information_40"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Stochastik>

#### Usage <a href="#usage_99" id="usage_99"></a>

```csharp
Stochastics(int periodD, int periodK, int smooth)
Stochastics(IDataSeries inSeries, int periodD, int periodK, int smooth)

//For the %D line
Stochastics(int periodD, int periodK, int smooth).D[int barsAgo]
Stochastics(IDataSeries inSeries, int periodD, int periodK, int smooth).D[int barsAgo]

//For the %K line
Stochastics(int periodD, int periodK, int smooth).K[int barsAgo]
Stochastics(IDataSeries inSeries, int periodD, int periodK, int smooth).K[int barsAgo]
```

#### Return value <a href="#return-value_97" id="return-value_97"></a>

**double**

When using this method with an index (e.g. **Stochastics**(7,14,3)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_90" id="parameters_90"></a>

inSeries Input data series for the indicator

periodD Number of periods to be used for the %K smoothing

periodK Number of bars included in the %K calculation

smooth Number of periods for the smoothing of %D

#### Visualization <a href="#visualization_94" id="visualization_94"></a>

![Stochastics](https://agenatrader.github.io/AgenaIndicator-documentation/media/Stochastics.jpg)

#### Example <a href="#example_94" id="example_94"></a>

```csharp
//Output for the %K line
Print("The stochastic line %K is currently at: " + Stochastics(3, 14, 7).K[0]);

//Output for the %D line
Print("The stochastic line %D is currently at: " + Stochastics(3, 14, 7).D[0]);
```


# Stochastics Fast

#### Description <a href="#description_104" id="description_104"></a>

See [*stochastics*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#stochastics).

#### Interpretation <a href="#interpretation_53" id="interpretation_53"></a>

Closing prices that are constantly in the upper area indicate accumulation (i.e. buying pressure), whilst the distribution (i.e. selling pressure) is shown by an indicator value in the lower area.

#### Further information <a href="#further-information_41" id="further-information_41"></a>

VTAD: <http://vtadwiki.vtad.de/index.php/Stochastik>

Charttec: <http://www.charttec.de/html/indikator_stochastics.php>

#### Usage <a href="#usage_100" id="usage_100"></a>

```csharp
StochasticsFast(int periodD, int periodK)
StochasticsFast(IDataSeries inSeries, int periodD, int periodK)

//For the %D line
StochasticsFast(int periodD, int periodK).D[int barsAgo]
StochasticsFast(IDataSeries inSeries, int periodD, int periodK).D[int barsAgo]

//For the %K line
StochasticsFast(int periodD, int periodK).K[int barsAgo]
StochasticsFast(IDataSeries inSeries, int periodD, int periodK).K[int barsAgo]
```

#### Return value <a href="#return-value_98" id="return-value_98"></a>

**double**

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

#### Parameters <a href="#parameters_91" id="parameters_91"></a>

inSeries Input data series for the indicator

periodD Number of periods for the smoothing of %K

periodK Number of periods included in the calculation of %K

#### Visualization <a href="#visualization_95" id="visualization_95"></a>

![Stochastics Fast](https://agenatrader.github.io/AgenaIndicator-documentation/media/StochasticsFast.jpg)

#### Example <a href="#example_95" id="example_95"></a>

```csharp
//Output for the %K line of the fast stochastic
Print("The stochastic line %K is currently at: " + StochasticsFast(3, 14).K[0]);

//Output %D line
Print("The stochastic line %D is currently at: " + StochasticsFast(3, 14).D[0]);
```


# Stochastics RSI (StochRSI)

#### Description <a href="#description_105" id="description_105"></a>

Stochastics RSI is a calculation of the stochastic based on the RSI indicator.

#### Interpretation <a href="#interpretation_54" id="interpretation_54"></a>

The indicator provides fast and precise extreme values/points in the price movements. The StochRSI can be used as a trend filter in higher timeframes as well as a tool for better entry timing.

#### Further information <a href="#further-information_42" id="further-information_42"></a>

<http://www.investopedia.com/terms/s/stochrsi.asp#axzz263tizhIG>

#### Usage <a href="#usage_101" id="usage_101"></a>

```csharp
StochRSI(int period)
StochRSI(IDataSeries inSeries, int period)
StochRSI(int period)[int barsAgo]
StochRSI(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_99" id="return-value_99"></a>

**double**

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

#### Parameters <a href="#parameters_92" id="parameters_92"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_96" id="visualization_96"></a>

![Stochastics RSI (StochRSI)](https://agenatrader.github.io/AgenaIndicator-documentation/media/StochRSI.jpg)

#### Example <a href="#example_96" id="example_96"></a>

```csharp
//Output for the StochRSI
Print("The current value for the StochRSI is: " + StochRSI(14)[0]);
```


# Summation (SUM)

#### Description <a href="#description_106" id="description_106"></a>

Summation is the sum over a predefined number of periods.

#### Usage <a href="#usage_102" id="usage_102"></a>

```csharp
SUM(int period)
SUM(IDataSeries inSeries, int period)
SUM(int period)[int barsAgo]
SUM(IDataSeries inSeries, int period)[int barsAgo]
```

#### Return value <a href="#return-value_100" id="return-value_100"></a>

**double**

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

#### Parameters <a href="#parameters_93" id="parameters_93"></a>

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_97" id="visualization_97"></a>

![Summation (SUM)](https://agenatrader.github.io/AgenaIndicator-documentation/media/SUM.jpg)

#### Example <a href="#example_97" id="example_97"></a>

```csharp
// Sum of the volume for the last 10 trading days
Print(SUM(Volume,10)[0]);
```


# SuperTrend

#### Description <a href="#description_107" id="description_107"></a>

The SuperTrend indicator was invented by a French trader. SuperTrend is similar to the Parabolic Stop and Reverse System (Parabolic SAR), and is based on the median values of the candles. It measures volatility as a span between high and low, not taking potential price gaps into account. The indicator, which originates from a starting value, continues to proceed in one direction until the market changes direction, combined with rising volatility. This causes the indicator to adjust its starting value to match that of the counter-direction. The indicator is programmed in such a way that nothing but the trend direction can bring about a change. Dropping volatility combined with movements against the trend direction cause the indicator to move horizontally.

#### Interpretation <a href="#interpretation_55" id="interpretation_55"></a>

There are multiple interpretations and applications for the SuperTrend. Forex traders prefer to trade the crosses directly. This way, the system will continuously be inside the market and only needs to be complemented by a stop and further trading logic settings. Analytically speaking, the SuperTrend indicator is only able to provide information about the current trend. If the market is above the indicator, then an uptrend exists, otherwise a downtrend is in force. The indicator can be used as an exit for additional trading systems, meaning that an open position can be closed if a trend change occurs.

#### Usage <a href="#usage_103" id="usage_103"></a>

```csharp
SuperTrend(SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth)
SuperTrend(IDataSeries inSeries, SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth)
SuperTrend(SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth)[int barsAgo]
SuperTrend(IDataSeries inSeries, SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth)[int barsAgo]

//For the values of the uptrend:
SuperTrend(SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth).UpTrend[int barsAgo]
SuperTrend(IDataSeries inSeries, SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth).UpTrend[int barsAgo]

//For the values of the downtrend:
SuperTrend(SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth).DownTrend[int barsAgo]
SuperTrend(IDataSeries inSeries, SuperTrendMode stMode, int length, double multiplier, SuperTrendMAType maType, int smooth).DownTrend[int barsAgo]
```

#### Return value <a href="#return-value_101" id="return-value_101"></a>

**double**

When using this method with an index (e.g. **SuperTrend**(...).UpTrend\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Parameters <a href="#parameters_94" id="parameters_94"></a>

|                       |                                                                   |
| --------------------- | ----------------------------------------------------------------- |
| InSeries              | Input data series for the indicator                               |
| maType                | For the calculation of the MA, the following methods can be used: |
| SuperTrendMAType.HMA  |                                                                   |
| SuperTrendMAType.SMA  |                                                                   |
| SuperTrendMAType.SMMA |                                                                   |
| SuperTrendMAType.TEMA |                                                                   |
| SuperTrendMAType.TMA  |                                                                   |
| SuperTrendMAType.VMA  |                                                                   |
| SuperTrendMAType.VWMA |                                                                   |
| SuperTrendMAType.WMA  |                                                                   |

Also see: [*HMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#hma-hull-moving-average), [*SMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#sma-simple-moving-average), [*SMMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#smma-smoothed-moving-average), [*TEMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#tema-triple-exponential-moving-average), [*TMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#tma-triangular-moving-average), [*VMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#vma-variable-moving-average), [*VWMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#vwma-volume-weighted-moving-average), [*WMA*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#wma-weighted-moving-average). Default: HMA | | multiplier | This is a multiplier for the internal calculation of the offset. This is only used when the method is set to ATR and DualThrust. (In the adaptive mode, the multiplier uses the Homodyne Discriminator) Default: 2.618 | | Period | Number of bars used for the calculation of the moving average Default: 14 | | smooth | Values for additional smoothing If no smoothing is necessary, this value can be set to 1 Default: 14 | | stMode | The following methods can be chosen: SuperTrendMode.ATR, SuperTrendMode.DualThrust, SuperTrendMode.Adaptive The Period Parameter will have a huge influence when the DualThrustMode is selected. The smaller the period, the tighter the indicator will follow price developments. Default: SuperTrendMode.ATR |

#### Visualization <a href="#visualization_98" id="visualization_98"></a>

![SuperTrend](https://agenatrader.github.io/AgenaIndicator-documentation/media/SuperTrend.jpg)

#### Example <a href="#example_98" id="example_98"></a>

```csharp
if (Close[0] > SuperTrend(SuperTrendMAType.HMA, SuperTrendMode.ATR, 14, 2.618, 14).UpTrend[0])
  Print("The market is in an uptrend.");
if (Close[0] < SuperTrend(SuperTrendMAType.HMA, SuperTrendMode.ATR, 14, 2.618, 14).DownTrend[0])
  Print("The market is in a downtrend.");
```


# SupportResistanceAreas

#### Description <a href="#description_108" id="description_108"></a>

This indicator draws support and resistance areas in the chart. There are 4 different types of possible supports and resistances, which are differentiated by various colors.

Support due to a lower high (ColorLowerHigh)

Support due to a lower low (ColorLowerLow)

Resistance due to a higher high (ColorHigherHigh)

Resistance due to a higher low (ColorHigherLow)

#### Interpretation <a href="#interpretation_56" id="interpretation_56"></a>

S/R zones play an important role in technical analysis. Clearly defined and identifiable support areas provide favorable entry opportunities, while resistance areas provide target zones to exit those trades. Once broken, these areas tend to reverse their function, meaning that a broken support zone becomes a resistance zone.

<http://finanzportal.wiwi.uni-saarland.de/tech/Kapitel5_4.htm>

#### Parameters <a href="#parameters_95" id="parameters_95"></a>

|                                                        |                                                                                                  |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| ATRRangeFactor                                         | Settings for the width of the support/resistance area as calculated by the ATR.                  |
| The smallest configurable value is 0.1; default is 0.3 |                                                                                                  |
| Levels                                                 | This setting defines how many S/R zones of the same type are displayed. The default is 3         |
| Opacity                                                | Transparency of the bars to be drawn into the chart; 0 (transparent) – 255 (completely visible). |
| Default is 70                                          |                                                                                                  |
| SensibilityFactor                                      | Defines the sensitivity of the S/R search.                                                       |
| The smallest setting is 1; the default is 5            |                                                                                                  |

#### Visualization <a href="#visualization_99" id="visualization_99"></a>

![SupportResistanceAreas](https://agenatrader.github.io/AgenaIndicator-documentation/media/SupportResistanceAreas.jpg)


# Swing

#### Description <a href="#description_109" id="description_109"></a>

Based on the strength of the swing highs or the swing lows, the swing indicator draws a line at these points. The number of bars to the left and right of the extreme point is the determining factor for the strength. Methods for these indicators can also be implemented for other scripts.

#### Interpretation <a href="#interpretation_57" id="interpretation_57"></a>

The methods for these indicators can be used in scripts to determine the last extreme point and its corresponding price value. The highs and lows of these points may then be used as entry, stop or target markers.

#### Usage <a href="#usage_104" id="usage_104"></a>

```csharp
//For a high
Swing(int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod);
Swing(IDataSeries inSeries, int strength).SwingHighBar(int barsAgo, int instance, int lookBackPeriod);

//For a low
Swing(int strength).SwingLowBar(int barsAgo, int instance, int lookBackPeriod);
Swing(IDataSeries inSeries, int strength).SwingLowBar(int barsAgo, int instance, int lookBackPeriod);
```

#### Return value <a href="#return-value_102" id="return-value_102"></a>

**double**

When using this method with an index (e.g. **Swing**(5)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

**When the current bar is smaller than the parameter strength, or if no swing high/low has been found, the return value is -1.**

#### Parameters <a href="#parameters_96" id="parameters_96"></a>

|                |                                                                                                              |
| -------------- | ------------------------------------------------------------------------------------------------------------ |
| barsAgo        | Starting point for the search                                                                                |
| InSeries       | Input data series for the indicator                                                                          |
| instance       | The number of occurrences of extreme points (1 is the last occurrence, 2 is the second last occurrence etc.) |
| length         | Number of bars included in the calculation                                                                   |
| lookBackPeriod | Number of bars in the past in which swing points will be searched for (search area)                          |
| strength       | Number of bars to the left and right of the extreme points                                                   |

#### Visualization <a href="#visualization_100" id="visualization_100"></a>

![Swing](https://agenatrader.github.io/AgenaIndicator-documentation/media/Swing.jpg)

#### Example <a href="#example_99" id="example_99"></a>

```csharp
// Position and price of the last swing high
int barsAgo = Swing(5).SwingHighBar(0, 1, 10);
Print("The last swing high was " + barsAgo + " bars ago.");
Print("The last swing high was at " + High[barsAgo]);
```


# Time-Series-Forecast (TSF)

#### Description <a href="#description_110" id="description_110"></a>

The Time-Series-Forecast is quite similar to a moving average. Here, the trend is established based on a regression equation that uses the smallest square formula. The goal of the TSF is to anticipate future price movements with the help of currently existing data.

#### Interpretation <a href="#interpretation_58" id="interpretation_58"></a>

The TSF reacts faster than the moving averages. These always have time delays when depicting the pre-existing trends. The TSF formula never allows the distance to the current price to become too large, thus permitting sharper trade reversal recognition.

An entry is placed when the price breaks the TSF line from bottom to top.

#### Further information <a href="#further-information_43" id="further-information_43"></a>

<http://en.wikipedia.org/wiki/Time_series>

#### Usage <a href="#usage_105" id="usage_105"></a>

```csharp
TSF(int forecast, int period)
TSF(IDataSeries inSeries, int forecast, int period)
TSF(int forecast, int period)[int barsAgo]
TSF(IDataSeries inSeries, int forecast, int period)[int barsAgo]
```

#### Return value <a href="#return-value_103" id="return-value_103"></a>

**double**

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

#### Parameters <a href="#parameters_97" id="parameters_97"></a>

forecast Number of bars used for the forecast

inSeries Input data series for the indicator

period Number of bars included in the calculations

#### Visualization <a href="#visualization_101" id="visualization_101"></a>

![Time-Series-Forecast (TSF)](https://agenatrader.github.io/AgenaIndicator-documentation/media/TSF.jpg)

#### Example <a href="#example_100" id="example_100"></a>

```csharp
//Output the TSF values
Print("The current value for the TSF is: " + TSF(3, 14)[0]);
```


# Constant Lines

#### Description <a href="#description_111" id="description_111"></a>

The Constant Lines tool can draw a maximum of four freely configurable horizontal lines within a chart. In general, it is used to label certain price levels in order to keep an eye on them.

#### Usage <a href="#usage_106" id="usage_106"></a>

```csharp
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value)
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value)[barsAgo]
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value).Line1[barsAgo]
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value).Line2[barsAgo]
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value).Line3[barsAgo]
ConstantLines(double line1Value, double line2Value, double line3Value, double line4Value).Line4[barsAgo]
```

#### Return value <a href="#return-value_104" id="return-value_104"></a>

**double**

When using this method with an index (e.g. **ConstantLines**(1,2,3,4)\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Visualization <a href="#visualization_102" id="visualization_102"></a>

![Constant Lines](https://agenatrader.github.io/AgenaIndicator-documentation/media/ConstantLines.jpg)


# CurrentDayOHL

#### Description <a href="#description_112" id="description_112"></a>

This function delivers the values for the open, high and low of the current day i.e. session.

CurrentDayOHL is intended for use with intraday data series.

See [*PriorDayOHLC*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#priordayohlc), [*DayLines*](https://agenatrader.github.io/AgenaIndicator-documentation/indicators_oscillators/#daylines).

#### Parameter <a href="#parameter_9" id="parameter_9"></a>

inSeries Input data series for the indicator

#### Return value <a href="#return-value_105" id="return-value_105"></a>

**double**

When using this method with an index (e.g. **CurrentDayOHL**.CurrentOpen\[**int** barsAgo] ), the value of the indicator will be issued for the referenced bar.

#### Usage <a href="#usage_107" id="usage_107"></a>

```csharp
CurrentDayOHL()
CurrentDayOHL(IDataSeries inSeries)
int barsAgo = 0;
//For the open value
CurrentDayOHL().CurrentOpen[ barsAgo]
CurrentDayOHL(IDataSeries inSeries).CurrentOpen[ barsAgo]
//For the high value
CurrentDayOHL().CurrentHigh[ barsAgo]
CurrentDayOHL(IDataSeries inSeries).CurrentBarHigh[ barsAgo]


//For the low value
CurrentDayOHL().CurrentLow[ barsAgo]
CurrentDayOHL(IDataSeries inSeries).CurrentLow[ barsAgo]
```

#### Visualization <a href="#visualization_103" id="visualization_103"></a>

![CurrentDayOHL](https://agenatrader.github.io/AgenaIndicator-documentation/media/CurrentDayOHL.jpg)

#### Example <a href="#example_101" id="example_101"></a>

```csharp
Print("The low of the current session is at " + CurrentDayOHL().GetCurrentBar().Low[0]);
```




---

[Next Page](/llms-full.txt/1)

