Stoploss set to 50Pips, however at testing and trading it is just 20Pips (???)

 

Hello all, 


So i wanted to make a simple EA, that I can insert into my charts when I want to sell/buy.

The StopLoss, in my EA is set at 50Pips, however when I test/trade it is always ~20Pips ...could someone be so kind and check it out? /give me a hint what am I doing wrong?

Please check these EAs with your mt4 (code?) and maybe give me some feedback.

Really appreciate it!

Snail

Files:
020---BUY.ex4  22 kb
020---BUY.mq4  12 kb
020---SELL.ex4  22 kb
020---SELL.mq4  12 kb
test.png  121 kb
 
snail03:

Hello all, 


So i wanted to make a simple EA, that I can insert into my charts when I want to sell/buy.

The StopLoss, in my EA is set at 50Pips, however when I test/trade it is always ~20Pips ...could someone be so kind and check it out? /give me a hint what am I doing wrong?

Please check these EAs with your mt4 (code?) and maybe give me some feedback.

Really appreciate it!

Snail

You have a trailing stop at 20 points which is triggered immediately.
 
Alain Verleyen:
You have a trailing stop at 20 points which is triggered immediately.

Hi,

@ Alain: many thanks, but the trailing stop is(should) be in the "positive"(profit) direction...not the "negative"(loss), or?

@ Anna: the spread is set to be a max.:3pips.

 
snail03:

Hi,

@ Alain: many thanks, but the trailing stop is(should) be in the "positive"(profit) direction...not the "negative"(loss), or?

@ Anna: the spread is set to be a max.:3pips.

I said you it's your trailing stop. There is no "but", it's not working, fix it.
 
Alain Verleyen:
I said you it's your trailing stop. There is no "but", it's not working, fix it.

yeey, thanks for telling me it is not working mate! I asked if someone could look at it and give me a hint of what am i doing wrong, not if that isn't working or not.

thanks anyways

 

snail, you got your answer.

Alain gave you correct hint, you dont believe? Just comment line 290 in 020 BUY EA, and you will see that orders will get your 50 SL.

The problem in your code is in TrailingStopTrail  this is the part you need to update (add some trigger).

 
snail03:

yeey, thanks for telling me it is not working mate! I asked if someone could look at it and give me a hint of what am i doing wrong, not if that isn't working or not.

thanks anyways

Forum on trading, automated trading systems and testing trading strategies


Welcome,

  • Usually people who can't code don't receive free help on this forum, though it could happen if you are lucky, be patient.
  • If you show your attempts and describe well your problem, you will most probably receive an answer from the community.
  • If you don't want to learn to code, nothing bad, you can either look at the Codebase if something free already exists, or in the Market for paid products (sometimes free also).
  • Finally, you also have the option to hire a programmer in the Freelance section.

Good luck.


Reason: