Entries are distorted 5pips too high?

 

Anybody can help me with this? I have made my first very basic EA and in strategy tester was working fine. However, now when applying to live chart both my buy and sell entries are about 5pips too high. EA code is attached and picture shows the basic idea of strategy. based on a 13 pip distance from moving average (central dotted line) up and down as measure of volatility (upper and lower dotted lines). idea is when price hits those line i expect it to move back towards the MA. as i said this is a test for me to learn.

to repeat: problem is for my sell orders they don't open at upper line but upper line + about 5pips. and my buy orders don't open at lower line but 5 pips above lower line...??? it worked fine in strategy testing didn't have this problem.

anyone know what to do?

cheers and happy trading to you all! 

 
Spread?
 
Marco vd Heijden:
Spread?
nopes. its on the eur/usd spread is about 1.5. and my max allowed slippage is 3.
 
master_dude:

Anybody can help me with this? I have made my first very basic EA and in strategy tester was working fine. However, now when applying to live chart both my buy and sell entries are about 5pips too high. EA code is attached and picture shows the basic idea of strategy. based on a 13 pip distance from moving average (central dotted line) up and down as measure of volatility (upper and lower dotted lines). idea is when price hits those line i expect it to move back towards the MA. as i said this is a test for me to learn.

to repeat: problem is for my sell orders they don't open at upper line but upper line + about 5pips. and my buy orders don't open at lower line but 5 pips above lower line...??? it worked fine in strategy testing didn't have this problem.

anyone know what to do?

cheers and happy trading to you all! 

Your EA settings (MA, distance) are probably different of what you see on your chart.
 
Alain Verleyen:
Your EA settings (MA, distance) are probably different of what you see on your chart.
you where right. i figured it out. lame mistake. the indicator i was using to graphically match my ea was using a smoothed MA and not the simple one as in the EA. :/ you live and you learn
Reason: