英文:
Hiding signal labels via pine script
问题
在Pine Script中是否有一种直接隐藏信号标签的方法?我知道你可以在设置中取消勾选该框,但每次脚本刷新时,我的整个图表都会变得混乱。我想保留用于交易列表中的调试信号内容,只是想将它们从图表中移除。
英文:
Is there a way to hide the signal labels directly via pine script? I know you can uncheck the box in the settings, but each time the script refreshes my hole chart is cluttered. I do want to keep the signal contents for debugging in the trade list, just want them removed from the graph.
答案1
得分: 2
// 为了调试,您可以将以下代码添加到您的代码的末尾:
// 删除所有标签
label.new(bar_index, close)
a_allLabels = label.all
if array.size(a_allLabels) > 0
for i = 0 to array.size(a_allLabels) - 1
label.delete(array.get(a_allLabels, i))
这将删除您的代码绘制的所有标签。
参见:https://www.tradingview.com/pine-script-reference/v5/#var_label%7Bdot%7Dall
英文:
For your debugging purpose you can add it at the end of your code :
//delete all labels
label.new(bar_index, close)
a_allLabels = label.all
if array.size(a_allLabels) > 0
for i = 0 to array.size(a_allLabels) - 1
label.delete(array.get(a_allLabels, i))
It will delete all the labels drawn by your code.
see : https://www.tradingview.com/pine-script-reference/v5/#var_label%7Bdot%7Dall
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论