我想将这行代码从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");
);