blakecmathis
Well-known member
Wave Trend Oscillator Upper Signals
Code:
#WT_LB Short Name TV
declare upper;
input Channel_Length = 10; #10
input Average_Length = 21; #10
input over_bought_1 = 60;
input over_bought_2 = 53;
input over_sold_1 = -60;
input over_sold_2 = -53;
input show_bubbles = yes;
input show_sec_bbls = no;
input show_alerts = yes;
def ap = hlc3;
def esa = ExpAverage(ap, Channel_Length);
def d = ExpAverage(AbsValue(ap - esa), Channel_Length);
def ci = (ap - esa) / (0.015 * d);
def tci = ExpAverage(ci, Average_Length);
def wt1 = tci;
def wt2 = SimpleMovingAvg(wt1, 4);
def signal1 = wt1 crosses above wt2 and wt1 < over_sold_2;
def signal2 = wt1 crosses below wt2 and wt1 > over_bought_2;
# Plot Signals
plot bullish = signal1;
bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
bullish.SetDefaultColor(Color.CYAN);
bullish.SetLineWeight(5);
plot bearish = signal2;
bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
bearish.SetDefaultColor(Color.MAGENTA);
bearish.SetLineWeight(5);