资源加载中... loading...

talib.STOCH

talib.STOCH()函数用于计算Stochastic (STOCH指标)

talib.STOCH()函数的返回值为:二维数组。 array

talib.STOCH(inPriceHLC) talib.STOCH(inPriceHLC, optInFastK_Period) talib.STOCH(inPriceHLC, optInFastK_Period, optInSlowK_Period) talib.STOCH(inPriceHLC, optInFastK_Period, optInSlowK_Period, optInSlowK_MAType) talib.STOCH(inPriceHLC, optInFastK_Period, optInSlowK_Period, optInSlowK_MAType, optInSlowD_Period) talib.STOCH(inPriceHLC, optInFastK_Period, optInSlowK_Period, optInSlowK_MAType, optInSlowD_Period, optInSlowD_MAType)

inPriceHLC参数用于指定K线数据。 inPriceHLC true {@struct/Record Record}结构数组 optInFastK_Period参数用于设置Fast-K周期,默认值为5。 optInFastK_Period false number optInSlowK_Period参数用于设置Slow-K周期,默认值为3。 optInSlowK_Period false number optInSlowK_MAType参数用于设置Slow-K均线类型,默认值为0。 optInSlowK_MAType false number optInSlowD_Period参数用于设置Slow-D周期,默认值为3。 optInSlowD_Period false number optInSlowD_MAType参数用于设置Slow-D均线类型,默认值为0。 optInSlowD_MAType false number

function main() {
    var records = exchange.GetRecords()
    var ret = talib.STOCH(records)
    Log(ret)
}
import talib
def main():
    records = exchange.GetRecords()
    ret = talib.STOCH(records.High, records.Low, records.Close)
    Log(ret)
void main() {
    auto records = exchange.GetRecords();
    auto ret = talib.STOCH(records);
    Log(ret);
}

STOCH()函数在talib库文档中的描述为:STOCH(Records[High,Low,Close],Fast-K Period = 5,Slow-K Period = 3,Slow-K MA = 0,Slow-D Period = 3,Slow-D MA = 0) = [Array(outSlowK),Array(outSlowD)]

talib.RSI talib.STOCHF