Forums ProRealTime forum Français Support ProBuilder MA DIRECTION CHANGE signal Reply To: MA DIRECTION CHANGE signal

#249168

Here we are/ Et voila …

// — settings MA /ADR
//ShortMAPeriod = 20
//ADRperiod = 20
// — end of settings

//compute ADR
sum=0
for i = 0 to ADRperiod-1 do
sum=sum+(dhigh(i)-dlow(i))// d= daily day before
next
adr=sum/ADRperiod
shortMA=average[ShortMAPeriod](totalprice)
diff=medianprice-shortMA
r=255
g=0
b=0
MAD=(diff*100)/adr
ChangeMAD =0
if MAD>0 then
r=0
g=0
b=255
endif
if MAD<=0 then
r=255
g=0
b=0
endif
midline=0

return MAD coloured(r,g,b) style(LINE,2)as “Moving Average Distribution”, midline as “zeroline”

Merci