Multi Z-Score

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

Multi Z-Score

Postby isamegrelo » Thu Jul 19, 2018 5:39 pm

Code:


//--- settings
period = 20
MAtype = 1
definition = 100
//--- end of settings

globalz=0

for i = 1 to definition do
avg = average[period*i,MAtype](customclose)
st = std[period*i](customclose)

zscore = (customclose-avg)/st

if zscore<0 then
r=255-(30*i)
g=0
drawtext(".",barindex,zscore,Dialog,Bold,20) coloured(max(r,100),g,0)
else
r=0
g=255-(30*i)
drawtext(".",barindex,zscore,Dialog,Bold,20) coloured(r,max(g,100),0)
endif

globalz=(globalz+zscore*i)/definition

next
smooth=average[period](globalz)


RETURN 0 coloured(100,100,100) style(dottedline), 2 coloured(100,100,100) style(dottedline), -2 coloured(100,100,100) style(dottedline), 4 coloured(100,100,100) style(dottedline), -4 coloured(100,100,100) style(dottedline), smooth
isamegrelo
FXCodeBase: Initiate
 
Posts: 114
Joined: Mon May 29, 2017 3:36 pm



Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 14 guests