Ichimoku Wave Trend Oscillator

BenTen

BenTen

Administrative
Staff
VIP
This is a Wave Trend Oscillator with Ichimoku included. Originally found on TradingView (it use a different code, I think PineScript) so the author had to convert it to thinkScript in order for the indicator to work on ThinkorSwim.

Created by: MyOwnHedgeFund



thinkScript Code
Rich (BB 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
Shareable Link
original: http://tos.mx/xZYAgT

modified: http://tos.mx/eGHwg3

 
Last edited:

Top