首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在thinkscript中输出/打印?

如何在thinkscript中输出/打印?
EN

Stack Overflow用户
提问于 2019-10-04 13:49:16
回答 2查看 162关注 0票数 1

非常直截了当。我只想用thinkscript打印出来。如果这个问题表明我在问这个问题时遗漏了thinkscript的一个重要元素,请让我知道这一点。

EN

回答 2

Stack Overflow用户

发布于 2021-03-08 23:18:38

使用类似下面的代码:AddLabel(yes, if close > 0 then "whatyouwanttoprint"

票数 1
EN

Stack Overflow用户

发布于 2021-03-22 09:32:58

  • 如果你正在询问如何实际打印出脚本的代码:我能找到的最好的方法就是将代码复制到另一个编辑器中,然后从那里打印。

代码语言:javascript
复制
#hint: Demonstrates adding a chart bubble at a given bar number and a label showing the last (most recent) bar number.\nNote: bar[0] is the rightmost, or most recent, bar. It is actually n bars from the leftmost side of the chart;\nbar[1] is one bar left of bar[0], and bar[2] is 2 bars left of bar 0.\nThis example also shows no plot is required in this case.

def isLastBar = !IsNaN(close) and IsNaN(close[-1]);
def lastBarNum = if isLastBar then BarNumber() else 0;

AddChartBubble( "time condition"=(BarNumber() == 15), "price location"=high, text="BarNumber" + BarNumber(), color=Color.YELLOW);
AddChartBubble( "time condition"=(BarNumber() == 30), "price location"=high, text="BarNumber" + BarNumber(), color=Color.YELLOW);
AddChartBubble( "time condition"=(BarNumber() == 45), "price location"=high, text="BarNumber" + BarNumber(), color=Color.YELLOW);


AddLabel(visible=isLastBar, text="bar[0] (rightmost): " + lastBarNum, color=Color.GREEN);
AddLabel(visible=isLastBar, text="bar[1]: " + (lastBarNum - 1), color=Color.YELLOW);
AddLabel(visible=isLastBar, text="bar[2]: " + (lastBarNum - 2), color=Color.ORANGE);


#plot Data = close;  #plot is not required if only adding labels/chart bubbles
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58230615

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档