new to the forum, new to thinkscript, I have this strategy that I am just about done with but I cant get it to work. One line is red. Seems like an easy fix for a more seasoned thinkscripter.
Code:
input price = close;
input desiredentryvma = 9;
input desiredexitvma = 9;
def entryvma = VMA (legnth = desiredentryvma);
def exitvma = VMA (legnth = desiredexitvma);
def buylong = price > entryvma;
def selllong = price < exitvma;
AddOrder(OrderType.BUY_TO_OPEN, buylong, tickcolor = Color.GREEN, arrowcolor = Color.GREEN, name = "open");
AddOrder(OrderType.BUY_TO_CLOSE, selllong, tickcolor = Color.RED, arrowcolor = Color.RED, name = "CLOSE");