user’s indicator Darvas
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
hh = highest [ n]
ll = lowest [ n]
once state = 2
v = hh
if hh = high [ n- 1 ] and high [ n- 1 ] > high and high [ n- 1 ] > low and (state = 1 or state = 2 ) then
v = hh
state = 0
x = 0
elsif ll = low [ n- 1 ] and low [ n- 1 ] < low and low [ n- 1 ] < high and ( state = 0 or state = 2 ) then
x = ll
state = 1
v = 0
elsif state = 0 and high > v[ 1 ] then
v = 0
x = 0
state = 2
elsif state = 1 and low < x[ 1 ] then
x = 0
v = 0
state = 2
else
v = v[ 1 ]
x = x[ 1 ]
endif
return v AS "Darvas R" , x AS "Darvas S"
call in trading system program
myDarvasR, myDarvasS = CALL "Darvas Boxes Forever" [ 4 ]
i receive values myDarvasR, myDarvasS are equal zeros all time
What is my errors?