//Defparam drawonlastbaronly = true
MyMACD = MACDline[12,26,9](close)
MACDflag = MyMACD < 0
MySLine = MACDSignal[12,26,9](close)
SLINEflag = MySline < 0
//MyHis = MACD[12,26,9](close)
//Offset = 10 * pipsize
p1 = 10
p2 = 50
// (。♥‿♥。) Block Start
// Block End (。♥‿♥。)
CP3 = 0
CP2 = 0
CP1 = 0
IF MyMACD < 0 AND MySLine < 0 THEN
// (。♥‿♥。) Block Start P3
//BACKGROUNDCOLOR (0, 155, 10, 25)
FOR X3 = 0 To p1 Do
//IF MyMACD[Y] Crosses Under MySLine[Y] AND MyMACD[Y] < 0 AND MySLine[Y] < 0 THEN
IF MyMACD[X3] Crosses Under MySLine[X3] THEN
//AbscisseP3 = X3
//BarP3 = Barindex[X3]
CP3 = 1
//Drawtext(“#X3#”, Barindex[X3], Low[X3]-1)
//DRAWELLIPSE(BarP3-1,LOW[X3]-Offset,BarP3+1,HIGH[X3]+Offset)coloured(255,10,10)
Break
//ELSE
//CP3 = 0
ENDIF
Next
// Block End (。♥‿♥。)P3
// (。♥‿♥。) Block Start P2
IF CP3 THEN
FOR X2 = X3 To X3+p1 Do
//IF MyMACD[Y] Crosses Under MySLine[Y] AND MyMACD[Y] < 0 AND MySLine[Y] < 0 THEN
IF MyMACD[X2] Crosses Over MySLine[X2] THEN
//AbscisseP2 = X2
//BarP2 = Barindex[X2]
CP2 = 1
//Drawtext(“#X2#”, Barindex[X2], Low[X2]-1)
//DRAWELLIPSE(BarP2-1,LOW[X2]-Offset,BarP2+1,HIGH[X2]+Offset)coloured(255,10,10)
Break
//ELSE
//CP2 = 0
ENDIF
Next
ENDIF
// Block End (。♥‿♥。)P2
// (。♥‿♥。) Block Start P1
IF CP2 THEN
FOR X1 = X2 To X2+p2 Do
//IF MyMACD[Y] Crosses Under MySLine[Y] AND MyMACD[Y] < 0 AND MySLine[Y] < 0 THEN
IF MyMACD[X1] Crosses Under MySLine[X1] THEN
//AbscisseP1 = X1
//BarP1 = Barindex[X1]
CP1 = 1
//Drawtext(“#X1#”, Barindex[X1], Low[X1]-1)
//DRAWELLIPSE(BarP1-1,LOW[X1]-Offset,BarP1+1,HIGH[X1]+Offset)coloured(255,10,10)
Break
//ELSE
//CP1 = 0
ENDIF
Next
ENDIF
// Block End (。♥‿♥。)P1
ENDIF
// tks to the Nisola’s Cours ;-)
Cond = CP1 AND CP2 AND CP3 AND MACDflag AND SLINEflag
SCREENER[Cond]