SuperTrend Signal

G

GeneHo

New member
VIP
how to convert the following code into scan or watchlist?

Code:
##############################

#Supertrend by Mobius

#ported to Mobile by DJS

#use in conjunction with

#supertrend plot for mobile

#

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;

#Define the signal plot

declare lower;

plot SuperTrendUP = if ST crosses below close then 1 else 0;

plot SuperTrendDN = if ST crosses above close then 1 else 0;

# End Code SuperTrend
 
Last edited by a moderator:

Top