首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将代码块PineScript转换为thinkscript

将代码块PineScript转换为thinkscript
EN

Stack Overflow用户
提问于 2018-11-02 19:13:31
回答 1查看 695关注 0票数 0

我想把这行代码从pinescript转换成thinkscript ( Thinkorswim ),我该怎么写呢?我遇到了多个if语句的问题

代码语言:javascript
复制
isAboveEma01 = line_01 > line_01[1] and line_01 > line_50 ? blue : line_01 > line_01[1] and line_01 < line_50 ? #cc00cc : line_01 < line_01[1] and line_01 > line_50 ? #0388FF : line_01 < line_01[1] and line_01 < line_50 ? #BD003A : na

我试过了,但不起作用:

代码语言:javascript
复制
line_01.AssignValueColor( 
if (line_01 >= line_01[1] and line_01 > line_50) then {
line_01.Color("PositiveUp") ;
} else if (line_01 >= line_01[1] and line_01 < line_50) then {
line_01.Color("PositiveDown");
} else if line_01 < line_01[1] and line_01 > line_50 then {
line_01.Color("NegativeUp");
}) else line_01.Color("NegativeDown");
);
EN

回答 1

Stack Overflow用户

发布于 2018-11-29 17:41:48

'if‘语句的语法在官方tutorial中,只需注意PineScript对缩进/空格敏感。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53117527

复制
相关文章

相似问题

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