Pharos
TAMomentum

TA.ULTOSC() - 终极振荡器

终极振荡器 (Ultimate Oscillator)

结合3个不同时间周期的动量指标,减少假信号。

返回动量指标目录


语法

python
TA.ULTOSC(high, low, close, timeperiod1=7, timeperiod2=14, timeperiod3=28)

参数

参数名类型必选默认值说明
highany-最高价数组
lowany-最低价数组
closeany-收盘价数组
timeperiod1any-短期周期,默认7
timeperiod2any-中期周期,默认14
timeperiod3any-长期周期,默认28

返回值

返回终极振荡器值数组,范围0-100。

信号解读

  • UO > 70: 超买
  • UO < 30: 超卖
  • 底背离: 价格新低,UO未新低,买入
  • 顶背离: 价格新高,UO未新高,卖出

基础示例

python
def main():
    while True:
        records = exchange.GetRecords()
        if len(records) < 50:
            Sleep(1000)
            continue
        
        highs = [r['High'] for r in records]
        lows = [r['Low'] for r in records]
        closes = [r['Close'] for r in records]
        
        uo = TA.ULTOSC(highs, lows, closes, 7, 14, 28)
        
        Log(f"终极振荡器: {uo[-1]:.2f}")
        
        if uo[-1] > 70:
            Log("⚠️ 超买区域")
        elif uo[-1] < 30:
            Log("💡 超卖区域")
        
        Sleep(60000)

优势

  • 结合多周期,减少假信号
  • 适合识别背离
  • 较少的超买超卖假信号

相关指标


返回动量指标目录 | 返回 TA 指标总目录