I am trying to code this as an indicator
AvgRange= Average((H-L),10
NarrowRange= AvgRange*.65
AdvanvcedADR=((H-L),Periods
Wide Range= Avg Range * 1.25
This is what I have but I think it is incorrect. Please help
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
|
defparam drawonlastbaronly=true
AVR= (High–Low)[p]
WR=AVR *1.25
NR=AVR *.65
ADADR= (High–Low)
If ADADR > WR then
r=255
g=0
b=0
endif
If ADADR > NR and ADADR < WR then
r=0
g=0
b=255
endif
If ADADR < NR then
r=204
g=204
b=0
endif
return ADADR coloured(r,g,b) style(histogram),AVR as “AVR” , WR as “WR”, NR as “NR”
|