Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
talib.STDDEV
Calculates the Standard Deviation.
talib.STDDEV(inReal)
talib.STDDEV(inReal, optInTimePeriod)
talib.STDDEV(inReal, optInTimePeriod, optInNbDev)Examples
Compute the Standard Deviation from the latest K-lines.
javascript
function main() {
var records = exchange.GetRecords()
if (!records) return
var ret = talib.STDDEV(records)
Log(ret)
}
python
import talib
def main():
records = exchange.GetRecords()
if not records:
return
ret = talib.STDDEV(records.Close)
Log(ret)Returns
| Type | Description |
numeric array | Indicator values, the same length as the input; the leading values without enough data are |
Arguments
| Name | Type | Required | Description |
inReal |
| Yes | K-line array (close prices are used) or numeric array; in Python, pass a numeric array such as |
optInTimePeriod | number | No | Calculation period. Default |
optInNbDev | number | No | Number of deviations. Default |
See Also
Remarks
TA-Lib equivalent: STDDEV(Records[Close],Time Period = 5,Deviations = 1) = Array(outReal).