The AC indicator is derived from the Awesome Indicator (AO) indicator. This is the current value of the AO minus the single moving average of the AOs over the five most recent intervals:
AC = AO – SMA (AO, 5) AO is, in turn, median price (MP) for five intervals minus ADM of MP on 34 intervals:
AO = SMA (MP, 5) – SMA (MP, 34)
The Acceleration / Deceleration Oscillator (AC) is used to determine whether the market motive trend is upward or downward. It gives you an advanced warning of changes in price direction: AC indicator changes direction before market trend changes direction before prices change. If you use the AC indicator you will have two lengths in advance of changes in price direction. This will allow you to place your orders before the price change takes place.
//PRC_Accelerator Decelerator | indicator
//26.09.2017
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
ao = average[5](medianprice)-average[34](medianprice)
ac = ao-average[5](ao)
if ac>ac[1] then
r=0
g=255
else
r=255
g=0
endif
return ac coloured(r,g,0) style(histogram)