Page 1 of 1

DIX Strategy Requested!

PostPosted: Thu Jan 02, 2020 3:46 pm
by mariqmarzuki
hello Apprentice....I hope to have a Disparity Index Strategy with buy and sell signals over a zero line with MA period and different MAs as adjustable inputs, thanks!

Re: DIX Strategy Requested!

PostPosted: Fri Jan 03, 2020 4:01 am
by Apprentice
Something like this?
viewtopic.php?f=31&t=63393
If NOT, can you please provide pseudo-code for your strategy?

Re: DIX Strategy Requested!

PostPosted: Mon Jan 06, 2020 11:46 am
by mariqmarzuki
//@version=4
study("DIX", shorttitle="DIX")

length = input(title="Length", type=input.integer, minval=1, defval=14)
src = input(title="Source", type=input.source, defval=close)

di = 100 * (src - sma(src, length)) / sma(src, length)

diColor = di >= 0 ? #42a5f5 : #ef5350
plot(di, title="Disparity Index", linewidth=1, color=diColor, transp=0)

hline(0, title="Zero Level", linestyle=hline.style_solid, color=#434651)

above is my code from tradingview, was hoping I can select a different MA from options like EMA WMA TRIMA KAMA MEMA VIDYA if possible thanks!

Re: DIX Strategy Requested!

PostPosted: Tue Jan 07, 2020 8:32 am
by Apprentice
Your request is added to the development list.
Development reference 527.

Re: DIX Strategy Requested!

PostPosted: Tue Jan 07, 2020 8:44 am
by mariqmarzuki
lest I forget sir could the team also make price source Open High Low Close HL2 HLC3 OHLC4 as options for the selected MA period? thanks!

Re: DIX Strategy Requested!

PostPosted: Wed Jan 08, 2020 6:52 am
by Apprentice
Try this version.
viewtopic.php?f=17&t=69298
Capture.PNG

Some price options.

Re: DIX Strategy Requested!

PostPosted: Wed Jan 08, 2020 12:23 pm
by mariqmarzuki
so it's finally done? or still under development sir?

Re: DIX Strategy Requested!

PostPosted: Thu Jan 09, 2020 4:03 am
by Apprentice
It is completed and available for download.
viewtopic.php?f=17&t=69298
Median Price is calculated as: (High + Low ) / 2
Typical Price is calculated as: (High + Low + Close) / 3