Im new to the coding language in prorealtime and hope somebody could give me a hint on this issue.
I have an indicator that draw stochastic divergence lines, see below.
From an automatic trading robot I know I can CALL this indicator by:
1
myStoch,my0=CALL"mydivergence4"[14,1,3,100]
In my trading system that calls the indicator, how can I know exactly when a divergence line is drawn so I can make a decision if I want to buy or sell.
Is it possible to find out from the myStoch variable that is returned in the CALL request, or, do I have to incorporate the indicator code into my trading robot and do SELL or BUY instead of drawsegment?
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
32
33
34
35
36
37
38
39
40
StochPrd=9
KPrd=1
DPrd=3
N=100
StochD=Stochasticd[StochPrd,KPrd,DPrd](close)
Offset=.01
IF(BarIndex>10+1+N)THEN
// short
IF(StochD[1]>StochDANDStochD[1]>StochD[2])THEN
extremum2=StochD[1]
extremum1=highest[N](StochD)
preciomax2=close[1]
preciomax=Highest[N](close)
IF(extremum2<extremum1 AND preciomax2>preciomax[1]) THEN
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue