hello to all
i'm searching help to traslate this program to MT4 indicator and EA
it give 1 for buy order and -1 to sell order (stop and revers)
I must to have the possibility to set "p3".
I'd like to have EA for back test with these parameters:
1 set stop loss in pip
2 set trailing profit in pip
3 set target profit in pip
4 set p3
5 set time start and time end.
thank you in advance
------------------------------------------------------------
//p3=50
k=p3
de48=DPO[k*2](close)
if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] then
flag=1
endif
n=(k*2)-4
p=(n/2)-1
d100=DPO[n](close)
moy100=close-d100
co=(moy100-moy100[1]+(close[p])/n)*n
if flag[1]=1 and flag[2]=0 then
hh=co[1]
endif
if flag[1]=1 then
co=hh
endif
n=p3 mod 2
p=(p3-n)/2
p3=(2*p)+1
once x=0
w=abs((p-x)/p)
w=w*w*w
w=(1-w)
w=w*w*w
x=x+1
if barindex=p3 then
a=0
b=0
e=0
for i=1 to p3
z=barindex-i+1
a=a+w[z]
b=b+w[z]*(i)
e=e+(i)*(i)*w[z]
next
endif
if barindex>p3 then
c=0
d=0
for i=1 to p3
z=barindex-i+1
c=c+co[p3+p-i]*w[z]
d=d+co[p3+p-i]*w[z]*(i)
next
endif
alpha=(a*d-b*c)/(a*e-b*b)
beta=(c*e-b*d)/(a*e-b*b)
lowess=alpha*(p+1)+beta
if barindex<p3*2 then
lowess=undefined
endif
xx=1.8*AverageTrueRange[10](close)
lowess1=lowess+xx //superiore
lowess2=lowess-xx //inferiore
// Condizioni per entrare su posizioni long
IF low < lowess2 THEN
out = 1
elsIF high > lowess1 THEN
out = -1
else
out = 0
ENDIF
return out
i'm searching help to traslate this program to MT4 indicator and EA
it give 1 for buy order and -1 to sell order (stop and revers)
I must to have the possibility to set "p3".
I'd like to have EA for back test with these parameters:
1 set stop loss in pip
2 set trailing profit in pip
3 set target profit in pip
4 set p3
5 set time start and time end.
thank you in advance
------------------------------------------------------------
//p3=50
k=p3
de48=DPO[k*2](close)
if de48=de48[1] and de48[1]=de48[2] and de48[2]<>de48[3] then
flag=1
endif
n=(k*2)-4
p=(n/2)-1
d100=DPO[n](close)
moy100=close-d100
co=(moy100-moy100[1]+(close[p])/n)*n
if flag[1]=1 and flag[2]=0 then
hh=co[1]
endif
if flag[1]=1 then
co=hh
endif
n=p3 mod 2
p=(p3-n)/2
p3=(2*p)+1
once x=0
w=abs((p-x)/p)
w=w*w*w
w=(1-w)
w=w*w*w
x=x+1
if barindex=p3 then
a=0
b=0
e=0
for i=1 to p3
z=barindex-i+1
a=a+w[z]
b=b+w[z]*(i)
e=e+(i)*(i)*w[z]
next
endif
if barindex>p3 then
c=0
d=0
for i=1 to p3
z=barindex-i+1
c=c+co[p3+p-i]*w[z]
d=d+co[p3+p-i]*w[z]*(i)
next
endif
alpha=(a*d-b*c)/(a*e-b*b)
beta=(c*e-b*d)/(a*e-b*b)
lowess=alpha*(p+1)+beta
if barindex<p3*2 then
lowess=undefined
endif
xx=1.8*AverageTrueRange[10](close)
lowess1=lowess+xx //superiore
lowess2=lowess-xx //inferiore
// Condizioni per entrare su posizioni long
IF low < lowess2 THEN
out = 1
elsIF high > lowess1 THEN
out = -1
else
out = 0
ENDIF
return out