Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
Overlap Studies
Momentum Indicators
Volume Indicators
Volatility Indicators
Cycle Indicators
Price Transform
talib.AVGDEV
talib.AVGPRICE
talib.MEDPRICE
talib.TYPPRICE
talib.WCLPRICE
Statistic Functions
Math Transform
Math Operators
Pattern Recognition
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Calculates the Average Price.

talib.AVGPRICE(inPriceOHLC)

Examples

Compute the Average Price from the latest K-lines.

javascript
function main() { var records = exchange.GetRecords() if (!records) return var ret = talib.AVGPRICE(records) Log(ret) }
python
import talib def main(): records = exchange.GetRecords() if not records: return ret = talib.AVGPRICE(records.Open, records.High, records.Low, records.Close) Log(ret)

Returns

TypeDescription

numeric array

Indicator values, the same length as the input; the leading values without enough data are NaN.

Arguments

NameTypeRequiredDescription

inPriceOHLC

Record array

Yes

K-line array; the open, high, low and close fields are used. In Python, pass records.Open, records.High, records.Low, records.Close in this order.

See Also

Remarks

TA-Lib equivalent: AVGPRICE(Records[Open,High,Low,Close]) = Array(outReal).