Can someone help me with this?
Have a candle coloring strategy
There should be an input on whether to color the candles yes/no
1) Candles are green if it closes above Tenkan and Kijun is below the Tenkan
2) Candles are orange if it closes in between Kijun and Tenkan
3) Candles are red if it closes below Tenkan and the Kijun is above the Tenkan
@samer800 or anyone else on this forum
https://usethinkscript.com/threads/superichi-lux-for-thinkorswim.17454/
Have a candle coloring strategy
There should be an input on whether to color the candles yes/no
1) Candles are green if it closes above Tenkan and Kijun is below the Tenkan
2) Candles are orange if it closes in between Kijun and Tenkan
3) Candles are red if it closes below Tenkan and the Kijun is above the Tenkan
@samer800 or anyone else on this forum
https://usethinkscript.com/threads/superichi-lux-for-thinkorswim.17454/
Code:
#// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0
#// © LuxAlgo
#indicator("SuperIchi [LUX]",'SuperIchi [LUX]',overlay=true,max_lines_count=500)
# Converted by Sam4Cok@Samer800 - 06/2022
input tenkan_len = 9; #'Tenkan????????
input kijun_len = 26; #'Kijun???????????
input spanB_len = 52; #'Senkou Span B?',inline='span')
input Displacement = 26; #'Displacement')
input tenkan_mult = 2.0; # tenkan
input kijun_mult = 4.0; #' kijun
input spanB_mult = 6.0; #'span')
input UseSmooth = no;
input TenkanLine = yes;
input KijunLine = yes;
input ChikouLine = no;
input Cloud = yes;
def na = Double.NaN;
#//------------------------------------------------------------------------------
DefineGlobalColor("tenkan", CreateColor(33 , 87 , 243));
DefineGlobalColor("kijun", CreateColor(255, 93 , 0 ));
DefineGlobalColor("cloudUP", CreateColor(0 , 128, 128));
DefineGlobalColor("cloudDN", CreateColor(239, 83 , 80 ));
DefineGlobalColor("chikou", CreateColor(123, 31 , 162));
#//------------------------------------------------------------------------------
script avg {
input src = close;
input length = 9;
input mult = 2;
def atr = ATR(LENGTH = length) * mult;
def up = hl2 + atr;
def dn = hl2 - atr;
def upper = if src[1] < upper[1] then Min(up, upper[1]) else up;
def lower = if src[1] > lower[1] then Max(dn, lower[1]) else dn;
def os = if src > upper then 1 else if src < lower then 0 else os[1];
def spt = if os == 1 then lower else upper;
def max = if Crosses(src, spt) then Max(src, max[1]) else if os == 1 then Max(src, max[1]) else spt;
def min = if Crosses(src, spt) then Min(src, min[1]) else if os == 0 then Min(src, min[1]) else spt;
def value = (max + min) / 2;
plot return = value;
}
#//------------------------------------------------------------------------------
def tenkan = avg(close, tenkan_len, tenkan_mult);
def kijun = avg(close, kijun_len , kijun_mult );
plot tenkan1 = if TenkanLine then tenkan else Na;
plot kijun1 = if KijunLine then kijun else Na;
plot Chikou = if ChikouLine and UseSmooth then EhlersSuperSmootherFilter(close[-Displacement + 1]) else
if ChikouLine then close[-Displacement + 1] else Na;
def senkouA1 = (kijun + tenkan) / 2 ;
def senkouB1 = avg(close, spanB_len, spanB_mult);
def senkouA = senkouA1[Displacement - 1];
def senkouB = senkouB1[Displacement - 1];
#//------------------------------------------------------------------------------
tenkan1.SetPaintingStrategy(PaintingStrategy.LINE);
tenkan1.SetLineWeight(2);
tenkan1.SetDefaultColor(GlobalColor("tenkan"));
kijun1.SetPaintingStrategy(PaintingStrategy.LINE);
kijun1.SetLineWeight(2);
kijun1.SetDefaultColor(GlobalColor("kijun"));
Chikou.SetPaintingStrategy(PaintingStrategy.LINE);
Chikou.SetLineWeight(1);
Chikou.SetDefaultColor(GlobalColor("Chikou"));
plot DotUP = if tenkan crosses above kijun then kijun else Na;
DotUP.SetPaintingStrategy(PaintingStrategy.SQUARES);
DotUP.SetDefaultColor(GlobalColor("tenkan"));
DotUP.SetLineWeight(3);
plot DotDN = if tenkan crosses below kijun then kijun else Na;
DotDN.SetPaintingStrategy(PaintingStrategy.SQUARES);
DotDN.SetDefaultColor(GlobalColor("kijun"));
DotDN.SetLineWeight(3);
AddCloud (if Cloud then senkouA else Na, senkouB, GlobalColor("cloudUP"), GlobalColor("cloudDN"));
#-- END of CODE
Last edited by a moderator: