indicator = 0
///////////////////////////////////////////////////////////////
//M15 ICHIMOKU
M15Tenkansen1 = (highest[135](high)+lowest[135](low))/30
M15Kijunsen1 = (highest[390](high)+lowest[390](low))/30
M15SSpanA = (M15tenkansen1[390]+M15kijunsen1[390])/30
M15SSpanB = (highest[780](high[390])+lowest[780](low[390]))/30
M15ca1 = M15SSpanA < M15SSpanB //or M15SSpanA < M15SSpanB
M15ca2 = close > M15SSpanA AND open > M15SSpanA
M15ca3 = close > M15SSpanB AND open > M15SSpanB
M15ca4 = open < close
M15achat = M15ca1 AND M15ca2 AND M15ca3 AND M15Ca4
///////////////////////////////////////////////////////////////
// M5 ICHIMOKU
M5Tenkansen1 = (highest[45](high)+lowest[45](low))/10
M5Kijunsen1 = (highest[130](high)+lowest[130](low))/10
M5SSpanA = (M5tenkansen1[130]+M5kijunsen1[130])/10
M5SSpanB = (highest[260](high[130])+lowest[260](low[130]))/10
M5ca1 = M5SSpanA > M5SSpanB or M5SSpanA < M5SSpanB
M5ca2 = close > M5SSpanA AND open > M5SSpanA
M5ca3 = close > M5SSpanB AND open > M5SSpanB
M5ca4 = open < close
M5achat = M5ca1 AND M5ca2 AND M5ca3 AND M5Ca4
///////////////////////////////////////////////////////////////
// M1 ICHIMOKU
M1Tenkansen1 = (highest[9](high)+lowest[9](low))/2
M1Kijunsen1 = (highest[26](high)+lowest[26](low))/2
M1SSpanA = (M1tenkansen1[26]+M1kijunsen1[26])/2
M1SSpanB = (highest[52](high[26])+lowest[52](low[26]))/2
M1ca1 = M1SSpanA > M1SSpanB or M1SSpanA < M1SSpanB
M1ca2 = close > M1SSpanA AND open > M1SSpanA
M1ca3 = close > M1SSpanB AND open > M1SSpanB
M1ca4 = open < close
M1achat = M1ca1 AND M1ca2 AND M1ca3 AND M1Ca4
///////////////////////////////////////////////////////////////
// M1 CONDITION ACHAT
achat = M15achat AND M5achat AND M1achat
IF achat THEN
indicator = 1
ENDIF
RETURN indicator