Moving Average Distribution

Category: Indicators By: Nicolas Created: March 5, 2019, 3:30 PM
March 5, 2019, 3:30 PM
Indicators
5 Comments

Indicator based on Shay Campbells’ E-Mini Swing Trading System where he uses a technique to enter the market based on pull backs of the price based upon a Moving Average Distribution indicator.

“Using a very short moving average of median price does a good job of defining a usable equilibrium point.  A distribution can then be calculated around that equilibrium by subtracting the equilibrium point from the market price.

To normalize these readings for volatility, this result is then divided by the recent daily range of price.

  • Buy Signal=  Trend Direction is Up (6 to 9 month Mov Ave) and the MA Distribution registers a significant Pullback, i.e, negative value.
  • Sell Signal=  Trend Direction is Down and the MA Distribution registers a significant Pullback, i.e, positive value.”

The code calculate the Average Daily Range, so in order to make it possible, please extend the units displayed on your chart to have at least the ADRperiod number of days. Should not be a problem on a daily timeframe though.

Coded following a request in this topic: How would you create a Mov Ave Distribution Histogram?

//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

r=176
g=23
b=31
MAD=(diff*100)/adr
if MAD>0 then
 r=30
 g=144
 b=255
endif

return MAD coloured(r,g,b) style(histogram) as "Moving Average Distribution"

 

Download
Filename: PRC_MovingAverage-Distribution.itf
Downloads: 111
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...