我想将这行代码从 pinescript 转换为 thinkscript ( Thinkorswim ) 我该怎么写?我遇到了多个 if 语句的问题
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
我试试这个,但不起作用:
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");
);