Ichimoku Clouds For ThinkOrSwim
mod note:
The Ichimoku Cloud is popular in that it displays support and resistance, momentum, and trend all in one view.
TenkanSen and KijunSen are similar to moving averages and are analyzed in relationship to one another.
mod note:
The Ichimoku Cloud is popular in that it displays support and resistance, momentum, and trend all in one view.
TenkanSen and KijunSen are similar to moving averages and are analyzed in relationship to one another.
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2024
# Modified by Henry Kaczmarczyk 05142024
input T_Arrows = 0; #1 == yes 0 == no
input K_Arrows = 0; #1 == yes 0 == no
input SA_Arrows = 0; #1 == yes 0 == no
input SB_Arrows = 0; #1 == yes 0 == no
input TKC_Arrows = 0; #1 == yes 0 == no
input SABC_Arrows = 0; #1 == yes 0 == no
input Dotsize = 2; # size of arrows
input tenkan_period = 9;
input kijun_period = 26;
input Plt_Chikou = 0; #1 == yes 0 == no
plot Tenkan = (Highest(high, tenkan_period) + Lowest(low, tenkan_period)) / 2;
plot Kijun = (Highest(high, kijun_period) + Lowest(low, kijun_period)) / 2;
plot "Span A" = (Tenkan[kijun_period] + Kijun[kijun_period]) / 2;
plot "Span B" = (Highest(high[kijun_period], 2 * kijun_period) + Lowest(low[kijun_period], 2 * kijun_period)) / 2;
plot Chikou = if Plt_Chikou == 1 then close[-kijun_period] else Double.Nan;
def TKMx = Max(Tenkan,Kijun);
def TKMn = Min(Tenkan,Kijun);
def SMx = Max("Span A","Span B");
def SMn = Max("Span A","Span B");
Tenkan.SetDefaultColor(Color.Cyan);
Kijun.SetDefaultColor(Color.Magenta);
"Span A".SetDefaultColor(Color.Blue);
"Span B".SetDefaultColor(Color.Red);
Chikou.SetDefaultColor(Color.Gray);
DefineGlobalColor("Bullish", Color.Blue);
DefineGlobalColor("Bearish", Color.RED);
AddCloud("Span A", "Span B", globalColor("Bullish"), globalColor("Bearish"));
DefineGlobalColor("Bullish2", Color.Cyan);
DefineGlobalColor("Bearish2", Color.Magenta);
AddCloud(Tenkan, Kijun, globalColor("Bullish2"), globalColor("Bearish2"));
Plot T_Arrow_up = if T_Arrows==1 and (Close Crosses Above Tenkan) then Low else double.nan;
Plot T_Arrow_dn = if T_Arrows==1 and (Close Crosses below Tenkan) then High else double.nan;
Plot K_Arrow_up = if K_Arrows==1 and (Close Crosses Above Kijun) then Low else double.nan;
Plot K_Arrow_dn = if K_Arrows==1 and (Close Crosses below Kijun) then High else double.nan;
Plot SA_Arrow_up = if SA_Arrows==1 and (Close Crosses Above "Span A") then Low else double.nan;
Plot SA_Arrow_dn = if SA_Arrows==1 and (Close Crosses below "Span A") then High else double.nan;
Plot SB_Arrow_up = if SB_Arrows==1 and (Close Crosses Above "Span B") then Low else double.nan;
Plot SB_Arrow_dn = if SB_Arrows==1 and (Close Crosses below "Span B") then High else double.nan;
Plot TKC_Arrow_up = if TKC_Arrows==1 and (Close Crosses Above TKMx) then Low else double.nan;
Plot TKC_Arrow_dn = if TKC_Arrows==1 and (Close Crosses below TKMn) then High else double.nan;
Plot SABC_Arrow_up = if SABC_Arrows==1 and (Close Crosses Above SMx) then Low else double.nan;
Plot SABC_Arrow_dn = if SABC_Arrows==1 and (Close Crosses below SMn) then High else double.nan;
T_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
T_Arrow_up.setDefaultColor(color.Cyan);
T_Arrow_Up.setLineWeight(dotsize);
T_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
T_Arrow_Dn.setDefaultColor(color.Cyan);
T_Arrow_Dn.setLineWeight(dotsize);
K_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
K_Arrow_up.setDefaultColor(color.Magenta);
K_Arrow_Up.setLineWeight(dotsize);
K_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
K_Arrow_Dn.setDefaultColor(color.Magenta);
K_Arrow_Dn.setLineWeight(dotsize);
SA_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
SA_Arrow_up.setDefaultColor(color.Blue);
SA_Arrow_Up.setLineWeight(dotsize);
SA_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
SA_Arrow_Dn.setDefaultColor(color.Blue);
SA_Arrow_Dn.setLineWeight(dotsize);
SB_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
SB_Arrow_up.setDefaultColor(color.Red);
SB_Arrow_Up.setLineWeight(dotsize);
SB_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
SB_Arrow_Dn.setDefaultColor(color.Red);
SB_Arrow_Dn.setLineWeight(dotsize);
TKC_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
TKC_Arrow_up.setDefaultColor(color.Yellow);
TKC_Arrow_Up.setLineWeight(dotsize +1);
TKC_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
TKC_Arrow_Dn.setDefaultColor(color.Yellow);
TKC_Arrow_Dn.setLineWeight(dotsize +1);
SABC_Arrow_Up.setpaintingStrategy(paintingStrategy.Arrow_Up);
SABC_Arrow_up.setDefaultColor(color.Dark_Orange);
SABC_Arrow_Up.setLineWeight(dotsize +1);
SABC_Arrow_Dn.setpaintingStrategy(paintingStrategy.Arrow_Down);
SABC_Arrow_Dn.setDefaultColor(color.Dark_Orange);
SABC_Arrow_Dn.setLineWeight(dotsize +1);
Last edited by a moderator: