// _ _ _ _ _ _
// /_\| |_| |_ _ _(_) |__ _ _| |_ ___
// / _ \ _| _| ‘_| | ‘_ \ || | _(_-<
// /_/ \_\__|\__|_| |_|_.__/\_,_|\__/__/
MyMACD = MACDline[12,26,9](close)
MySLine = MACDSignal[12,26,9](close)
PointA = MyMACD Crosses Over MySLine AND MyMACD < 0 AND MySLine < 0
IF PointA Then
FOR X3 = 1 To 100 Do
IF MyMACD[X3] Crosses Under MySLine[X3] AND MyMACD[X3] < 0 AND MySLine[X3] < 0 Then
AbscisseX3 = X3
BarIndX3 = Barindex[X3]
CondP3 = 1
Break
ELSE
CondP3 = 0
ENDIF
Next
IF CondP3 Then
FOR X2 = X3+1 To 100 Do
IF MyMACD[X2] Crosses Over MySLine[X2] AND MyMACD[X2] < 0 AND MySLine[X2] < 0 Then
AbscisseX2 = X2
BarIndX2 = Barindex[X2]
CondP2 = 1
Break
ELSE
CondP2 = 0
ENDIF
Next
ENDIF
IF CondP2 Then // AND Not CondP3[1]
FOR X1 = X2+1 To 100 Do
IF MyMACD[X1] Crosses Under MySLine[X1] AND MyMACD[X1] < 0 AND MySLine[X1] < 0 Then
AbscisseX1 = X1
BarIndX1 = Barindex[X1]
CondP1 = 1
Break
ELSE
CondP1 = 0
ENDIF
Next
ENDIF
ELSE
CondP3 = 0
CondP2 = 0
CondP1 = 0
ENDIF
AllCondition = CondP3 AND CondP2 AND CondP1
// ########################################################################
// _ _ ___ _ _ _ _
// _| | |_ | \ ___| |__ _ _ __ _(_)_ _ __ _ _| | |_
// |_ . _| | |) / -_) ‘_ \ || / _<code>| | ' \/ _</code> | |_ . _|
// |_ _| |___/\___|_.__/\_,_\__, |_|_||_\__, | |_ _|
// |_|_| |___/ |___/ |_|_|
Debuging = 0
If Debuging Then
DRAWTEXT(“#CondP3#”, barindex, pipsize)
DRAWTEXT(“#CondP2#”, barindex, – pipsize)
DRAWTEXT(“#CondP1#”, barindex,- 3 * pipsize)
DRAWTEXT(“#AllCondition#”, barindex, – 5 * pipsize)
ENDIF
IF AllCondition AND Not AllCondition[1] Then
BACKGROUNDCOLOR(0,255,0,42)
DrawRectangle(BarIndX1, 2*pipsize , BarIndX3, -2*pipsize)
DRAWTEXT(“◄”, barindex, pipsize)
DRAWTEXT(“►”, BarIndX1, pipsize)
ENDIF
RETURN