RedToGreen
Active member
So I've been messing around with the ichimoku, I know there's some people who instead of a 9-26, will use a 18-52.
I also made a 4-13.
On the chart I have a cloud, refrencing the Tenkan 4 & Kijun 52.
You can see the tenkan 4 is greater than the Kijun 52, via the green cloud and also the label.
When I run a scan for a short;
def short = Tenkan4 < kijun52;
plot s = short;
...
Tsla comes up on the scan as fitting that criteria but my chart says differently.
If anyone can point me in the right direction as to what if anything I'm doing incorectly, I'd appreciate it
Thank you
I also made a 4-13.
On the chart I have a cloud, refrencing the Tenkan 4 & Kijun 52.
You can see the tenkan 4 is greater than the Kijun 52, via the green cloud and also the label.
When I run a scan for a short;
def short = Tenkan4 < kijun52;
plot s = short;
...
Tsla comes up on the scan as fitting that criteria but my chart says differently.
If anyone can point me in the right direction as to what if anything I'm doing incorectly, I'd appreciate it
Thank you
Code:
#=============================================
input price = close;
input showT4 = no;
input showk13 = no;
input showT18 = no;
input showK52 = no;
input T4 = 4.5;
input K13 = 13;
input T18 = 18;
input K52 = 52;
# ===================================================================================
# ======================== TENKAN/KIJUN
def Tenkan4 = (Highest(high, T4) + Lowest(low, T4)) / 2 ;
def Kijun13 = (Highest(high, K13) + Lowest(low, K13)) / 2;
def AA = (Tenkan4[K13] + Kijun13[K13]) / 2;
def BA = (Highest(high[K13], 2 * K13) + Lowest(low[K13], 2 * K13)) / 2;
def Tenkan18 = (Highest(high, T18) + Lowest(low, T18)) / 2;
def Kijun52 = (Highest(high, K52) + Lowest(low, K52)) / 2;
def A2 = (Tenkan18[K52] + Kijun52[K52]) / 2;
def B2 = (Highest(high[K52], 2 * K52) + Lowest(low[K52], 2 * K52)) / 2;
# ============================================================================
# ================== TK PLOTS =========================================
plot T = IF SHOWT4 THEN tenkan4 ELSE DOUBle.NaN;
plot k = IF SHOWk13 THEN kijun13 ELSE DOUBle.NaN;
T.SetDefaultColor(CreateColor(75,235,175));
T.SetLineWeight(1);
T.SetStyle(Curve.FIRM);
K.SetDefaultColor(CreateColor(219,75,68));
K.SetLineWeight(1);
K.SetStyle(Curve.FIRM);
plot T2 = IF SHOWt18 THEN tenkan18 ELSE DOUBle.NaN;
plot k2 = IF SHOWk52 THEN kijun52 ELSE DOUBle.NaN;
T2.SetDefaultColor(CreateColor(99,211,146));
T2.SetLineWeight(2);
T2.SetStyle(Curve.FIRM);
K2.SetDefaultColor(CreateColor(158,19,19));
K2.SetLineWeight(2);
K2.SetStyle(Curve.FIRM);
AddCloud( tenkan4, kijun52, CreateColor(57,186,100), CreateColor(221,65,65)); #*
# =================== conditions ==============================
# ============= Current cloud Status ========================
def tkl4 = tenkan4 > kijun52;
def tks4 = tenkan4 < kijun52;
plot S = tks4;
AddLabel(yes, if tkl4 then "-T4 > K52-" else if TKS4 then "-T4 < K52-" else "", if TKL4 then CreateColor(63, 187, 93) else if TKS4 then CreateColor(191, 42, 42) else Color.DARK_GRAY);