英文:
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 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)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论