rottentrade
Member
I would like to reverse the trade at the next bar if it moves in the opposite direction of my entry, long or short.
###Long/Short###
def long1 = Some condition;
def long2 = short[1] && Close > Close[1]; <-- Error with "Short[1]" as being undefined.
def short1 = Some condition;
def short2 = long[1] && Close < Close[1];
How would I be able to define what "Short[1]" is in this case (it would be like a circular argument)? Is there a possible (more simpler) workaround for this?
###Long/Short###
def long1 = Some condition;
def long2 = short[1] && Close > Close[1]; <-- Error with "Short[1]" as being undefined.
def short1 = Some condition;
def short2 = long[1] && Close < Close[1];
How would I be able to define what "Short[1]" is in this case (it would be like a circular argument)? Is there a possible (more simpler) workaround for this?