# Stop Loss & Take Profit keep on changing value

16

hi everybody..

I'm working on a simple EA,. I realized that my SL & TP keep on changing after testing it on demo..

Initially, I set input parameters, SL =10 pips, TP = 10 pips..but it keep on changing and appear on a trade SL =9 pips, TP = 11 pips/ SL =8 pips, TP = 12 pips/ SL =11 pips, TP = 9 pips/ SL =12 pips, TP = 9 pips,...

please, can someone explain to me why is this happening,..and kindly solve my problem,.thanks

Moderator
10371

Slippage
Moderator
32028

GumRai:
Slippage
There is no slippage on demo account.
Moderator
32028

wayneb:

hi everybody..

I'm working on a simple EA,. I realized that my SL & TP keep on changing after testing it on demo..

Initially, I set input parameters, SL =10 pips, TP = 10 pips..but it keep on changing and appear on a trade SL =9 pips, TP = 11 pips/ SL =8 pips, TP = 12 pips/ SL =11 pips, TP = 9 pips/ SL =12 pips, TP = 9 pips,...

please, can someone explain to me why is this happening,..and kindly solve my problem,.thanks

How do you calculate these values 9-11/8-12/11-9, etc... Can you show your trades history ?
Moderator
10371

angevoyageur:
There is no slippage on demo account.

The OP does not use RefreshRates() in the code and it is quite possible that the loops could take some time to execute, therefore missing ticks.

So, on demo, a trade will be placed at the Ask price loaded when start() is called, no matter whether ticks have been missed or not?

16

angevoyageur:
How do you calculate these values 9-11/8-12/11-9, etc... Can you show your trades history ?
yes sure..
16

GumRai:

The OP does not use RefreshRates() in the code and it is quite possible that the loops could take some time to execute, therefore missing ticks.

So, on demo, a trade will be placed at the Ask price loaded when start() is called, no matter whether ticks have been missed or not?

Do you propose reducing slippage or no slippage at all?
Moderator
32028

wayneb:
yes sure..
?
Moderator
32028

GumRai: