• LIMITED TIME OFFER: use coupon code PRIMEDAY (case sensitive) at checkout to save $50 off VIP membership (down to $149 / year). Valid through Tuesday 6/22. Biggest discount this year!

WaveTrend Oscillator for ThinkorSwim [LazyBear]

BenTen

Administrative
Staff
VIP
Here's the WaveTrend Oscillator script for ThinkorSwim. Came from the TradingView version that was ported from TS/MT, also known as "The Perfect Leading Indicator."

According to the Forex indicator:

It features a sophisticated algorithm which enables it to detect true reversals in a extremely accurate manner. The beauty of this indicator is that is does not generate signals during choppy sideways markets.

A Buy signal is generated based on the oscillator crosses above the signal while below the Oversold band. You'll see a Sell signal when the oscillator is above the overbought band and crosses down on the signal line.

I'm also happy to say that the WaveTrend signals does not repaint.

LkL1CI7.png


IORymcb.png


thinkScript Code

Rich (BB code):
#WT_LB Short Name TV
declare lower;
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 zero = 0;
plot zero = 0;
zero.SetDefaultColor( Color.GRAY );
plot obLevel1 = over_bought_1;
obLevel1.SetDefaultColor(Color.RED);
plot osLevel1 = over_sold_1;
osLevel1.SetDefaultColor(Color.GREEN);
plot  obLevel2 = over_bought_2;
obLevel2.SetDefaultColor(Color.RED);
obLevel2.SetStyle(Curve.SHORT_DASH);
plot  osLevel2 = over_sold_2;
osLevel2.SetDefaultColor(Color.GREEN);
osLevel2.SetStyle(Curve.SHORT_DASH);

plot wt1_1 = wt1;
wt1_1.SetDefaultColor(Color.GREEN);
plot wt2_1 = wt2;
wt2_1.SetDefaultColor(Color.RED);
wt2_1.SetStyle(Curve.POINTS);
plot wt3 = (wt1 - wt2);
wt3.SetDefaultColor(Color.BLUE);
wt3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
def signal1 = wt1 crosses above wt2 and wt1 < over_sold_2;
plot Signal = if signal1  then (signal1 * over_sold_2) else Double.NaN;
Signal.SetDefaultColor(Color.GREEN);
Signal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Signal.SetLineWeight(3);
Signal.HideTitle();
def signal2 = wt1 crosses below wt2 and wt1 > over_bought_2;
plot Signal2_ = if signal2  then (signal2 * over_bought_2) else Double.NaN;
Signal2_.SetDefaultColor(Color.RED);
Signal2_.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
Signal2_.SetLineWeight(3);
Signal2_.HideTitle();

Shareable Link

Credits:
 
Last edited:

GeneHo

New member
2019 Donor
VIP
WaveTrend indicator with Ichimoku.

Code:
# MOHFWaveTrendIchimoku
# @myownhedgefund
# Last updated: 4/11/2018
# Modified from LazyBear's Pine script port
#   https://www.tradingview.com/u/LazyBear/
# Modified from ducksjc's Pine script port 
#   https://www.tradingview.com/u/ducksjc/
# Modified from TD Ameritrade's Ichimoku 
# 
#   www.myownhedgefund.com
#

declare lower;

#Ichimoku Input
input len = 10;
input tenkan_period = 9;
input kijun_period = 26;

#WT
def ap = hlc3;
def esa = ExpAverage(ap, len);
def d = ExpAverage(AbsValue(ap - esa), len);
def ci = (ap - esa) / (0.015 * d);
def tci = ExpAverage(ci, 21);
#def wt1 = Round(tci, 1);
def wt1 = tci;
def wt2 = Average(wt1, 4);

#Ichimoku
#def Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
#def Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
#def "Span A" = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
#def "Span B" = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
#def Chikou = close[-kijun_period];
#DefineGlobalColor("Neutral", Color.GRAY);
#DefineGlobalColor("Bullish", Color.GREEN);
#DefineGlobalColor("Bearish", Color.RED);
#AddCloud("Span A", "Span B", globalColor("Bullish"), globalColor("Bearish"));

#WT+Ichimoku
def turn = (Lowest(wt1, tenkan_period) + Highest(wt1, tenkan_period)) / 2;
def std = (Lowest(wt1, kijun_period) + Highest(wt1, kijun_period)) / 2;

plot WT = wt1;
WT.SetStyle(curve.Points);
WT.SetDefaultColor(Color.GRAY);

WT.AssignValueColor( if wt1>turn and wt1>std then (Color.GREEN)
else if wt1<std and wt1<turn then (Color.RED) else (color.GRAY));

plot WTTurn = turn;
plot WTstd = std;
WTTurn.SetDefaultColor(Color.BLUE);
WTstd.SetDefaultColor(Color.RED);

#WT
#plot WT_Fast = wt1;
#plot WT_Slow = wt2;
#plot WT_Diff = wt1 - wt2;
plot Zero = 0;
plot OS1 = -60;
plot OS2 = -53;
plot OB1 = 60;
plot OB2 = 53;

#WT_Fast.SetDefaultColor(Color.CYAN);
#WT_Slow.SetDefaultColor(Color.RED);
#WT_Diff.SetDefaultColor(Color.GRAY);
Zero.SetDefaultColor(Color.GRAY);
OS1.SetDefaultColor(Color.GREEN);
OS2.SetDefaultColor(Color.GREEN);
OB1.SetDefaultColor(Color.RED);
OB2.SetDefaultColor(Color.RED);
# End Script
 
Last edited:

cherif

Member
VIP
@BenTen hi. would this indicator be useful on daily charts? i am thinking of using it with a slowRSI to indicate overbought and oversold and therefore reversals. what do you think?

 
Last edited:

BenTen

Administrative
Staff
VIP
@cherif That would be interesting to check and backtest. I have not been able to go through this indicator for long so I definitely don't have any personal experience with it yet.

 
Last edited:

horserider

Well-known member
VIP
Redundant to TMO. Same calculations. Just use TMO and it already has the MTF. Why waste time on a second study or is it the arrows that are attractive?
 

skynetgen

Well-known member
Seems this is pretty much identical to PPO/MACD. Its a momentum based indicator using differences of different averages length
 

12matthew09

New member
not just the upper arrows but the lower study with its matching arrows too not showing very well actually..... to go with showing the false signals
All you do is take off all the plots except for the last two then move the indicator to the price box.
 

Hguru

Member
All you do is take off all the plots except for the last two then move the indicator to the price box.
I was just commenting about how the lower actual study when watching it was not doing well and showing the false signals so watching the upper study arrows without watching the whole study is like flying blind for a while at least with this study which I do not know very well yet or if ever ..that is all thanks for the info
 

diazlaz

Well-known member
2019 Donor
VIP
I was just commenting about how the lower actual study when watching it was not doing well and showing the false signals so watching the upper study arrows without watching the whole study is like flying blind for a while at least with this study which I do not know very well yet or if ever ..that is all thanks for the info

I will share an approach on how to trade this when I get back from my travels. it's actually pretty good for intra day trading.
 

Lambert58

New member
The Wave Trend Oscillator is a great tool. Is there a scan to identify when the Wt2_1 red dot first goes under the Wt1_1 line?
 
Last edited by a moderator:

Similar threads

Top