九转序列指标 TradingView 版的代码分享

神奇的九轉序列,實時觀測變盤信號,幫助提高逃頂逃底的成功率

TradingView的代码:

study(“TD9″,overlay=true)
transp=input(0)
Numbers=input(true)
SR=input(true)
Barcolor=input(true)
TD = close > close[4] ?nz(TD[1])+1:0
TS = close < close[4] ?nz(TS[1])+1:0

TDUp = TD – valuewhen(TD < TD[1], TD , 1 )
TDDn = TS – valuewhen(TS < TS[1], TS , 1 )

plotshape(Numbers?(TDUp==7?true:na):na,style=shape.triangledown,text=”7″,color=green,location=location.abovebar,transp=transp)
plotshape(Numbers?(TDUp==8?true:na):na,style=shape.triangledown,text=”8″,color=green,location=location.abovebar,transp=transp)
plotshape(Numbers?(TDUp==9?true:na):na,style=shape.triangledown,text=”🍅”,color=green,location=location.abovebar,transp=transp)

true:na):na,style=shape.triangleup,text=”6″,color=red,location=location.belowbar,transp=transp)
plotshape(Numbers?(TDDn==7?true:na):na,style=shape.triangleup,text=”7″,color=red,location=location.belowbar,transp=transp)
plotshape(Numbers?(TDDn==8?true:na):na,style=shape.triangleup,text=”8″,color=red,location=location.belowbar,transp=transp)
plotshape(Numbers?(TDDn==9?true:na):na,style=shape.triangleup,text=”🤢”,color=red,location=location.belowbar,transp=transp)

富途牛牛的代码:

COUNTUP = BARSLASTCOUNT(close>ref(close,4))
NINEUPOTHER:=ISLASTBAR AND BETWEEN(COUNTUP, 5,8);
NUMBERUP:=COUNTUP*( BACKSET((COUNTUP=9) > 0, 9) OR BACKSET(NINEUPOTHER > 0, COUNTUP))
DRAWNUMBER((NUMBERUP > 6 AND NUMBERUP < 9), H*1.005, NUMBERUP), COLORGREEN;
DRAWTEXT(COUNTUP = 9, H*1.005, ‘🍅’), COLORGREEN;
COUNTDOWN:= BARSLASTCOUNT(C<REF(C,4));
NINEDOWNOTHER:=ISLASTBAR AND BETWEEN(COUNTDOWN, 5,8);
NUMBERDOWN:= COUNTDOWN*( BACKSET((COUNTDOWN =9) > 0, 9) OR BACKSET(NINEDOWNOTHER > 0, COUNTDOWN))
DRAWNUMBER((NUMBERDOWN > 6 AND NUMBERDOWN < 9), L*0.995, NUMBERDOWN), COLORRED;
DRAWTEXT(COUNTDOWN = 9, L*0.995, ‘🤢’), COLORRED;

公式的解释

1找到连续满足收盘价比4天前收盘价高的K线有多少根
2确定一下当前最后一根K线是否需要标注除9以外的其他数字
3给每一根K线赋值
4在满足条件的K线上方画上7和8的数字
5在九转的地方画上一个番茄,表示可能的转折点要格外注意
6反过来用同样的方法画数字再画一个绿色的脸表示可以抄底的时机

文章极致简洁
数字化区块时代 » 九转序列指标 TradingView 版的代码分享

2 评论

  1. 九转序列指标 TradingView 版的代码分享
    刚刚使用无法成功 能在邮寄一份代码给我嘛 感谢

    1. 有段时间没用,要再看看

发表回复