Esta es una adaptación de un código aparecido en la plataforma Tradingview :https://es.tradingview.com/script/IUskHZy5-Predictive-EMA/
A su vez es una traducción de un indicador de mq4
He hecho esta adaptación para Prorealtime v10.3 :
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
REM PREDICTIVE EMA
//adaptación para Prorealtime v10.3
//del indicador EMAPredictive de mq4
//@version=3
//+------------------------------------------------------------------+
//| EMAPredictive3.mq4 |
//| Matthew ("Dr Chaos") Kennel |
//| ftp://lyapunov.ucsd.edu/pub/nonlinear |
//+------------------------------------------------------------------+
LongPeriod= 25.0
ShortPeriod= 8.0
ExtraTimeForward= 1.0
p1= 2.0 / (LongPeriod+ 1.0 )
p3= 2.0 / (ShortPeriod+ 1.0 )
t1= (LongPeriod- 1.0 )/ 2.0
t3= (ShortPeriod- 1.0 )/ 2.0
t= ShortPeriod + ExtraTimeForward
ma1= close
ma3= ma1
val= ma1
slope1= ma1
predict= ma1
ExtBuffer= ma1
for i= 1 to LongPeriod
val= close [ i]
ma1= p1* val + (1.0 - p1)* ma1
ma3= p3* val + (1.0 - p3)* ma3
slope1= (ma3- ma1)/ (t1- t3)
predict= ma3 + slope1* t
ExtBuffer= predict
next
if close > ExtBuffer then
r= 0
g= 153
b= 0
else
r= 255
g= 0
b= 0
endif
return ExtBuffer coloured (r,g,b)as "Predictive EMA"
1 user thanked author for this post.