Hello,
I would like to autotrade supertrend in thinkorswim.
input AtrMult = 1.0;
input nATR = 4;
input AvgType = AverageType.HULL;
input PaintBars = yes;
def ATR = MovingAverage(AvgType, TrueRange(high, close, low), nATR);
def UP = HL2 + (AtrMult * ATR);
def DN = HL2 + (-AtrMult * ATR);
def ST = if close < ST[1] then UP else DN;
plot SuperTrend = if ST crosses below close then +1.0 else 0.0;
I get the recursion error when I try to use it. Is there a way to modify the code to use it for autotrade?
Like this:
Like Loading...