Forums › ProRealTime forum Français › Support ProBuilder › MA DIRECTION CHANGE signal › Reply To: MA DIRECTION CHANGE signal
07/29/2025 at 9:40 AM
#249182
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
//PRC_MovingAverage Distribution | indicator //05.03.2019 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge // --- settings ShortMAPeriod = 20 ADRperiod = 20 // --- end of settings //compute ADR sum=0 for i = 0 to ADRperiod-1 do sum=sum+(dhigh(i)-dlow(i)) next adr=sum/ADRperiod shortMA=average[ShortMAPeriod](medianprice) diff=medianprice-shortMA MAD=(diff*100)/adr if MAD crosses over 0 then buy 1 contract at market elsif MAD crosses under 0 then sellshort 1 contract at market endif //----- GRAPH MAD r=176 g=23 b=31 if MAD>0 then r=30 g=144 b=255 endif graph MAD coloured(r,g,b) as "Moving Average Distribution" |