Hi @jmcenterio
Here is the code of the parabolic SAR.
This code gives the same results as the “internal PRT” indicator…
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
increment = 0.02
initial = 0.02
limite = 0.2
IF BARINDEX < 2 THEN
Lparabolic = LOW
islong = 1
af = limite
hp = HIGH
lp = LOW
ELSE
IF islong THEN
Lparabolic = Lparabolic + af * (hp - Lparabolic)
Lparabolic = MIN (Lparabolic, LOW [ 1 ] )
Lparabolic = MIN (Lparabolic, LOW [ 2 ] )
ELSE
Sparabolic= Sparabolic + af * (lp - Sparabolic)
Sparabolic= MAX (Sparabolic, HIGH [ 1 ] )
Sparabolic= MAX (Sparabolic, HIGH [ 2 ] )
ENDIF
reverse = 0
IF islong THEN
IF LOW < Lparabolic THEN
islong = 0
reverse = 1
Sparabolic = hp
lp = LOW
af = initial
ENDIF
ELSE
IF HIGH > Sparabolic THEN
islong = 1
reverse = 1
Lparabolic = lp
hp = HIGH
af = initial
ENDIF
ENDIF
IF NOT reverse THEN
IF islong THEN
IF HIGH > hp THEN
hp = HIGH
af = af + increment
af = MIN (af,limite)
ENDIF
ELSE
IF LOW < lp THEN
lp = LOW
af = af + increment
af = MIN (af,limite)
ENDIF
ENDIF
ENDIF
ENDIF
If isLong then
DRAWPOINT (barindex , Lparabolic, 2 ) Coloured (0 ,255 ,0 )
EndIf
If NOT isLong then
DRAWPOINT (barindex ,Sparabolic,2 ) Coloured (255 ,0 ,0 )
EndIf
Return