This code is a screener for the famous “Tenkan-Kijun Cross” strategy.
Buy conditions :
Tenkan crosses over Kijun
Tenkan & Kijun > Kumo
Close > Kumo
Chikou > Kumo
Sell conditions : the opposite
You can also set it like an indicator, with “+1” for buy conditions, and “-1” for sell conditions.
INDICATEUR = 0
Tenkansen = (highest[9]+lowest[9])/2
Kijunsen = (highest[26]+lowest[26])/2
SSpanA = (tenkansen[26]+kijunsen[26])/2
SSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
Chikou = close[26]
// ACHAT
C1 = close > SSpanA and close > SSpanB
C2 = Tenkansen crosses over Kijunsen
C3 = Tenkansen > SSpanA and Tenkansen > SSpanB
C4 = Kijunsen > SSpanA and Kijunsen > SSpanB
C5 = Chikou > SSpanA[26] and Chikou > SSpanB[26]
IF C1 and C2 and C3 and C4 and C5 THEN
INDICATEUR = 1
ENDIF
// VENTE
C1v = close < SSpanA and close < SSpanB
C2v = Tenkansen crosses under Kijunsen
C3v = Tenkansen < SSpanA and Tenkansen < SSpanB
C4v = Kijunsen < SSpanA and Kijunsen < SSpanB
C5v = Chikou < SSpanA[26] and Chikou < SSpanB[26]
IF C1v and C2v and C3v and C4v and C5v THEN
INDICATEUR = -1
ENDIF
screener[INDICATEUR]
It can be very useful if you like Ichimoku.
Of course, you can also try it with some other parameters, such as weak TKC on the opposite side of the Kumo, or inside the Kumo.
Use it well !
Happy Trading !