Finds the average value of the series.

 

This example shows the use of the common auto indexed series.

 

For information on using functions with non auto indexed series review Series Functions.

Syntax:

value = Average( series, bars, [offset] )

 

Parameter:

Description:

series

Name of the series.

bars

Number of bars over which to find the value.

[offset]

Number of bars to offset before finding the value.

 

Example:

VARIABLES: highestClose, highestHigh, lowestLow TYPE: Price

VARIABLES: averageClose, standDev TYPE: Price
 
' Find the highest close of the last 50 bars
highestClose = Highest( instrument.close, 50 )
 
' Find the lowest low of the last 100 bars
lowestLow = Lowest( instrument.low, 100 )
 
' Find the highest high since the entry of the first unit of the current position
IF instrument.position <> OUT THEN
  highestHigh = Highest( instrument.high, instrument.unitBarsSinceEntry )
ENDIF
 
' Find the 10 day average of the close starting 20 days ago
averageClose = Average( instrument.close, 10, 20 )
 
' Find the standard deviation of the close over the last 100 days
standDev = StandardDeviation( instrument.close, 100 )

Returns:

Average value found by taking the sum all values in the series and then divided by the bar value.

 

Links:

Median

See Also:

Series Functions

 


Edit Time: 5/3/2017 09:33:54 AM


Topic ID#: 158

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software