TAKline
停顿形态 (Stalled Pattern)
TA.CDLSTALLEDPATTERN() - 看跌反转形态
语法
python
result = TA.CDLSTALLEDPATTERN(records)参数
| 参数 | 类型 | 说明 |
|---|---|---|
| records | array | K线数据数组 |
返回值
- -100: 看跌反转信号
- 0: 无信号
形态特征
停顿形态是三日看跌反转形态:
- 前两天:两根强劲白色K线
- 第三天:小白色K线或纺锤线
- 开盘在前日实体内
- 收盘勉强创新高
- 上影线较长
类似"前进阻挡",但第三根K线更弱,显示上涨停顿。
信号解读
- 看跌反转 (-100)
- 强势上涨后出现
- 第三天涨势停滞
- 买盘明显减弱
- 可能开始反转
使用示例
python
def onTick():
exchange.SetContractType("swap")
records = exchange.GetRecords()
if len(records) < 100:
return
# 检测停顿形态
stalled = TA.CDLSTALLEDPATTERN(records)
if stalled[-1] == -100:
rsi = TA.RSI(records, 14)
if rsi[-1] > 65:
# MACD顶背离确认
macd = TA.MACD(records, 12, 26, 9)
if macd[0][-1] < macd[0][-5]: # MACD下降
Log("检测到停顿形态(RSI超买+MACD背离)")
# 平多单
position = exchange.GetPosition()
if len(position) > 0 and position[0].Type == 0:
exchange.SetDirection("closebuy")
exchange.Sell(-1, position[0].Amount)