## Disparity Index

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

### Disparity Index

A technical indicator that measures the relative position of the most recent closing price to a selected moving average and reports the value as a percentage. A value greater than zero suggests that the asset is gaining upward momentum, while a value less than zero can be interpreted as a sign that selling pressure is increasing.

Formula
Disparity Index = (Close - MA )/ MA *100

DI.lua

Averages DI.lua

For Averages DI you will need to install averages indicator.
viewtopic.php?f=17&t=2430&p=5705&hilit=averages#p5705

The indicator was revised and updated

Apprentice
FXCodeBase: Confirmed User

Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Disparity Index

Histogram of Disparity Index

Thanks

Sjc

http://www.mql5.com/en/code/1353

Coondawg71

Posts: 324
Joined: Sat Jan 15, 2011 11:45 am

### Re: Disparity Index

Apprentice
FXCodeBase: Confirmed User

Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Disparity Index

Disparity Index.lua

Averages Disparity Index.lua

For Averages DI you will need to install averages indicator.
viewtopic.php?f=17&t=2430&p=5705&hilit=averages#p5705

Apprentice
FXCodeBase: Confirmed User

Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Disparity Index

Although simple and less sexy than many others, this is very useful.
Could we add the 'Averages' lua to it..that is can we expand the MAs available to include the other more sensative ones.....?
Patrick Sweet

Posts: 72
Joined: Fri Apr 26, 2013 4:23 am

### Re: Disparity Index

Averages Disparity Index.lua / Averages DI Added.

Apprentice
FXCodeBase: Confirmed User

Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Disparity Index

Hi!

It s possible make this indicator in this way:

Disparity Index = ((Close - MA )/ MA *100)*100

for see a bigger range. I think it's better...

_____________________________________________

And its possible make a quantitative version?

X * natural logarithm (Disparity Index1/Disparity IndexN)

Where;
Disparity Index = ((Close - MA )/ MA *100)*100
X= a variable>0 , a positive number
Disparity Index1= the current valor of Disparity Index
Disparity IndexN = Disparity Index of N candelstick ago ( example the previous 5 or 60)
____________________________________________________

I think it's a good indicator.

Thanks!!!

Mattia
Mattia

Posts: 12
Joined: Tue Mar 08, 2016 9:18 am

### Re: Disparity Index

DI Modification.lua

Disparity Index = ((Close - MA )/ MA *100)*100
DI Modification Quantitative.lua

DI Modification Quantitative = X * natural logarithm (Disparity Index1/Disparity IndexN)

Apprentice
FXCodeBase: Confirmed User

Posts: 20594
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

### Re: Disparity Index

hi apprendice,

can you create a strategy based on disparity index indicator

buy; DI cross over Top line
sell: DI cross under Bottom line

Posts: 29
Joined: Mon Oct 24, 2011 3:14 pm

### Re: Disparity Index

Thabks for modification!

Mattia
Mattia

Posts: 12
Joined: Tue Mar 08, 2016 9:18 am