Moren Information about:
Link: 1) www.genetics.org/cgi/content/full/158/3/1321
Link: 2) www.forexrealm.com/technical-analysis/technical-indicators/disparity-index.html
Link: 3) www.babypips.com/forexpedia/Disparity_Index
Link: 4) www.vtsystems.com/resources/helps/0000/HTML_VTtrader_Help_Manual/index.html?ti_disparityindex.html




Calculation:

[ C - Mov(C,X,MA ) ] / [ Mov(C,X,MA) * 100 ]

Where X is the number of time periods
MA is the calculation type of the moving average.



Source Code "DIX Indicator":

function init()
{
with (DIX) {
   createBuffer("DIX");
   setBufferColor("DIX", "lime");
   setBufferDrawStyle("DIX", DrawStyle.LINE);
   setAutoChangeMaxMin("DIX");

   addLevel(0, "white");

   createParameter("Period", 20);

 }
}

function start()
{
   var period = DIX.parameter("Period");
   DIX.label = "DIX (" + period + ")";

   var num = Shared.numberOfQuotes();

   var DIXbuf = new Array(num);

   var CloseBuf = Shared.close();
   var EmaBuf = Shared.ema( period, Shared.close());

     for (var i = 0; i < num; ++i) {
     DIXbuf[i] = 100 * (( CloseBuf[i] - EmaBuf[i]) / EmaBuf[i] );
     }

   DIX.setBufferData("DIX", DIXbuf);
}