I am looking to make these labels with syminfo.mintick to show the tick and point values instead of the current value that is showing?

huangapple go评论66阅读模式
英文:

I am looking to make these labels with syminfo.mintick to show the tick and point values instead of the current value that is showing?

问题

I tried switching out the bar index but it doesn't work. For example, the orange label reads 4154.4177 but should read 4150.50 or 4150.25 for the ES MINI Futures. Because it moves in .25 cent increments. Thanks!

label.delete(rsidown)
yrsil = al*bar_index + bl
rsidown := label.new(bar_index, yrsil,
text=str.tostring(yrsil, "#.####"), color=color.red, style=label.style_text_outline, yloc=yloc.price)

label.delete(rsiup)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, yrsih, text=str.tostring(yrsih, "#.####"), color=color.green, style=label.style_text_outline, yloc=yloc.price)

英文:

I am looking to make these labels with syminfo.mintick to show the tick and point values instead of the current value that is showing?I tried switching out the bar index but it doesn't work. For example the orange label reads 4154.4177 but should read 4150.50 or 4150.25 for the ES MINI Futures. Because it moves in .25 cent increments. Thanks!

label.delete(rsidown)
yrsil = al*bar_index + bl
rsidown := label.new(bar_index, yrsil, 

text=str.tostring(yrsil, "#.####"), color=color.red, style=label.style_text_outline, yloc=yloc.price)

label.delete(rsiup)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, yrsih, text=str.tostring(yrsih, "#.####"), color=color.green, style=label.style_text_outline, yloc=yloc.price)

答案1

得分: 0

这是要翻译的代码部分:

label.delete(rsiup)
HighPlace = ta.highest(10)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, HighPlace, text=str.tostring(yrsih/syminfo.mintick, "#"), color=color.green, style=label.style_label_down, yloc=yloc.price)

label.delete(rsidown)
LowPlace = ta.lowest(10)
yrsil = (al*bar_index + bl)
rsidown := label.new(bar_index, LowPlace, text=str.tostring(yrsil/syminfo.mintick, "#"), color=color.red, style=label.style_label_up, yloc=yloc.price)

请注意,上述代码中的变量和函数名称保持原样未翻译。

英文:

You should try this to have the value in tradingview tick on your labels :

label.delete(rsiup)
HighPlace = ta.highest(10)
yrsih = ah*bar_index + bh
rsiup := label.new(bar_index, HighPlace, text=str.tostring(yrsih/syminfo.mintick, "#"), color=color.green, style=label.style_label_down, yloc=yloc.price)

label.delete(rsidown)
LowPlace = ta.lowest(10)
yrsil = (al*bar_index + bl)
rsidown := label.new(bar_index, LowPlace, text=str.tostring(yrsil/syminfo.mintick, "#"), color=color.red, style=label.style_label_up, yloc=yloc.price)

Result :
I am looking to make these labels with syminfo.mintick to show the tick and point values instead of the current value that is showing?

huangapple
  • 本文由 发表于 2023年4月17日 00:24:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/76028979.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定