0

我想获得每个序列会话的价格表现并在聊天中显示。本例为TD序列。我无法确定每个 TD 序列会话的最新柱并将“关闭”分配给变量 LC。

我如何确定最新的酒吧。谢谢

在此处输入图像描述

//@version=5
indicator("TD Seq test01",overlay=true)

Numbers=input(true)
SR=input(true)
Barcolor=input(true)
TD = 0
TS = 0
PP = 0.00
var IC = 0.0
var LC = 0.0
TD := close > close[4] ? nz(TD[1])+1 :0
TS := close < close[4] ? nz(TS[1])+1 :0

TDUp = TD - ta.valuewhen(TD < TD[1], TD , 1 )

//IC: the close price of the the bar in TD sequence
//LC: the close price of the latest bar in the TD sequence 
IC := TDUp==1 ? close[1] :IC
???LC := 
PP := (LC-IC)*100/IC

plotshape(Numbers?(TDUp==1?true:na):na,style=shape.triangledown,text="1",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==2?true:na):na,style=shape.triangledown,text="2",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==3?true:na):na,style=shape.triangledown,text="3",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==4?true:na):na,style=shape.triangledown,text="4",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==5?true:na):na,style=shape.triangledown,text="5",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==6?true:na):na,style=shape.triangledown,text="6",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==7?true:na):na,style=shape.triangledown,text="7",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==8?true:na):na,style=shape.triangledown,text="8",color=color.green,location=location.abovebar)
plotshape(Numbers?(TDUp==9?true:na):na,style=shape.triangledown,text="9",color=color.green,location=location.abovebar)
4

0 回答 0