How Can We Help?

AVG Function

You are here:
< All Topics

AVERAGE(Vector, Periods) 

AVG(Vector, Periods) 

Returns a vector containing a running average, as specified by the Periods argument. The AVERAGE function can also be referenced by AVG for short. 

Example: 

AVERAGE(CLOSE, 10) 
AVG(CLOSE, 10) 

Both scripts return a vector of averages based on a 10- period window.

Example use:
set BUY = close > AVG(close,10)

Table of Contents