-
Notifications
You must be signed in to change notification settings - Fork 10
/
zsl4 div.txt
32 lines (24 loc) · 939 Bytes
/
zsl4 div.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
study("zsl4 d")
k=15
data=rsi(close,28)/linreg(close,56,1)
p4=60*k*4
p3=50*k*3
p2=40*k*2
p1=20*k*1
//pr1=0.84375
pr1=1.6
pr2=2
pr3=2.5
pr4=6
zs1=(data-linreg(data,p1,1))/stdev(data,p1)
zs2=(data-linreg(data,p2,1))/stdev(data,p2)
zs3=(data-linreg(data,p3,1))/stdev(data,p3)
zs4=(data-linreg(data,p4,1))/stdev(data,p4)
c1=abs(zs1)<pr1?white:abs(zs1)>pr1 and abs(zs1)<pr2?yellow:abs(zs1)>pr2 and abs(zs1)<pr3?orange:red
c2=abs(zs2)<pr1?white:abs(zs2)>pr1 and abs(zs2)<pr2?yellow:abs(zs2)>pr2 and abs(zs2)<pr3?orange:red
c3=abs(zs3)<pr1?white:abs(zs3)>pr1 and abs(zs3)<pr2?yellow:abs(zs3)>pr2 and abs(zs3)<pr3?orange:red
c4=abs(zs4)<pr1?white:abs(zs4)>pr1 and abs(zs4)<pr2?yellow:abs(zs4)>pr2 and abs(zs4)<pr3?orange:red
plot(zs1, color=c1,style=line, linewidth=p1*5/p4/2)
plot(zs2, color=c2, style=line, linewidth=p2*5/p4/2)
plot(zs3, color=c3, style=line, linewidth=p3*5/p4/2)
plot(zs4, color=c4, style=line, linewidth=p4*5/p4/2)