Bonsoir, je souhaiterai avoir un screener à partir de cet indicateur
period=50
plusDM = (MAX(HIGH-HIGH[1], 0))*10
minusDM = (MAX(LOW[1]-LOW, 0))*10
IF plusDM > minusDM THEN
minusDM = 0
ENDIF
IF plusDM < minusDM THEN
plusDM = 0
ENDIF
IF plusDM = minusDM THEN
plusDM = 0
minusDM = 0
ENDIF
plusDI = WILDERAVERAGE[period](plusDM)
minusDI = WILDERAVERAGE[period](minusDM)
DM = (plusDI-minusDI)/pipsize
moy = exponentialaverage[period]((DM))
if Moy<Moy[1] and Moy[1]>Moy[2] and Moy[1]>0 then
RetB5=RetB4
RetB4=RetB3
RetB3=RetB2
RetB2=RetB1
RetB1=Moy[1]
ReturnBmoy=(RetB1+RetB2+RetB3+RetB4+RetB5)/5
endif
if Moy>Moy[1] and Moy[1]<Moy[2] and Moy[1]<0 then
RetH5=RetH4
RetH4=RetH3
RetH3=RetH2
RetH2=RetH1
RetH1=Moy[1]
ReturnHmoy=(RetH1+RetH2+RetH3+RetH4+RetH5)/5
endif
if abs(returnBmoy-0) > abs(returnHmoy-0) then
limitUP = returnBmoy
elsif abs(returnBmoy-0) < abs(returnHmoy-0) then
LimitUp = -ReturnHmoy
endif
if abs(ReturnHmoy-0) > abs(ReturnBmoy-0) then
limitDn = ReturnHmoy
elsif abs(ReturnHmoy-0) < abs(ReturnBmoy-0) then
LimitDn = – ReturnBmoy
endif
TopDMMoy = exponentialaverage [150](returnBMoy)
BottomDMMoy = exponentialaverage[150](returnHmoy)
if DM > 0 and DM > TopDMMoy then
drawcandle (0,0, DM, DM) COLOURED (32,0,192)
elsif DM > 0 and DM < TopDMmoy then
drawcandle (0,0, DM, DM) COLOURED (0,204,255)
endif
if DM < 0 and DM < BottomDMmoy then
drawcandle (0,0, DM, DM) COLOURED (255,0,0)
elsif DM < 0 and DM > BottomDMmoy then
drawcandle (0,0, DM, DM) COLOURED (255,204,153)
endif
Return DM as “DM”, moy as “DM Moy”, TopDMMoy as “TOP”, BottomDMMoy as “BOTTOM’
Ce screener devrait identifier lorsque le DM est au dessus du TopDMMoy ou au dessous du BottomDMMOy avec un DM au dessus ou au dessous de la Moy.
j’ai tenté le screener ci dessous mais il ne remonte pas tout :
///////////////////////////////////////////////////////////////////// DM
period=50
plusDM = (MAX(HIGH-HIGH[1], 0))*10
minusDM = (MAX(LOW[1]-LOW, 0))*10
IF plusDM > minusDM THEN
minusDM = 0
ENDIF
IF plusDM < minusDM THEN
plusDM = 0
ENDIF
IF plusDM = minusDM THEN
plusDM = 0
minusDM = 0
ENDIF
plusDI = WILDERAVERAGE[period](plusDM)
minusDI = WILDERAVERAGE[period](minusDM)
DM = (plusDI-minusDI)/pipsize
moy = exponentialaverage[period]((DM))
if Moy<Moy[1] and Moy[1]>Moy[2] and Moy[1]>0 then
RetB5=RetB4
RetB4=RetB3
RetB3=RetB2
RetB2=RetB1
RetB1=Moy[1]
ReturnBmoy=(RetB1+RetB2+RetB3+RetB4+RetB5)/5
endif
if Moy>Moy[1] and Moy[1]<Moy[2] and Moy[1]<0 then
RetH5=RetH4
RetH4=RetH3
RetH3=RetH2
RetH2=RetH1
RetH1=Moy[1]
ReturnHmoy=(RetH1+RetH2+RetH3+RetH4+RetH5)/5
endif
TopDMMoy = exponentialaverage [150](returnBMoy)
BottomDMMoy = exponentialaverage[150](returnHmoy)
DMStrongUp = (DM > moy) and (DM > TopDMMoy)
DMStrongDn = (Dm < moy) and (DM < BottomDMMoy)
screener [DMStrongUp or DMStrongDn]
merci.