Reply

Move to Break Even not working with ATR range

5 replies

ddilbeck

Subscriber, bbp_participant, community, 21 replies.

Visit profile

10 years ago #111540

I have created an EA to place two trades once my criteria is met.  It is placing both trades, but it seems to automatically move the stop loss of one of the trades to break even immediately after it is in profit rather then what I have specified in the order entry rules (1*ATR(14))  I have attached a screen shot of the two order entry rules. The first has a profit target of 1*ATR(14) and seems to be working correctly. The second should move to break even only when price has moved (1*ATR(14)), then I have other rules to trail the remaining order.  I have tested it using the strategy tester in MT4 and it seems to work good there, but when I have it opening live orders I get the undesirable result stated in the beginning of this post. Any advice would be great.

 

 

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #122515

Hello,

 

in my test it works (demo account trading) – it places SL to BE only after it reached 1 * ATR(10), not immediately when it is in profit.

 

Mark

Mark
StrategyQuant architect

0

ddilbeck

Subscriber, bbp_participant, community, 21 replies.

Visit profile

10 years ago #122528

Mark, 

Thanks for your reply.  I have had the EA running for 24 hours and it seems that most of the time the breakeven is activating almost immediately after the order is opened.  There were a few trades that performed as expected.  These were ones that the price went in the direction of the trade and did not retrace back to the entry price.  However, most of them do at some point retrace a bit so I’m getting exited out of the of the overall trade too early.  I have looked in the “MT4 journal” when this occurs and there is an error message stating that modification of order failed [invalid parameters]  I will post the whole strategy here and maybe you could test it how I have it compiled and maybe you can reproduce the error. Then we can troubleshoot from there.  Like I said, when I use the strategy tester on my MT4 platform the EA performs as expected, but I’m not getting the desired result running on a live demo account.  

 

Thanks!

 

P.S. You will need two custom indicators that I am using for this strategy, I will post those as well.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #122547

Hello,

 

I wasn’t bale to simulate the problem yet, but I was recently solving a similar problem and it was that the EA was running on multiple symbols with the same magic number.

Do you run your EA on multiple symbols? You should then use an unique magic number for each EA.

 

Also, there was one bug in a code, I’m attaching a patch. Please copy this file to EA Wizard/code/Mql_MT4 and overwrite the old one.

 

Mark

 

Mark
StrategyQuant architect

0

ddilbeck

Subscriber, bbp_participant, community, 21 replies.

Visit profile

10 years ago #122548

Yes Mark, I do use the EA for multiple symbols. After I apply the patch you provided, will I be able to run on multiple symbols or will I have to create an EA with unique magic numbers for each currency pair? Thanks for your help

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #122757

to be on a safe side you should use unique magic number for each symbol.

 

Mark

Mark
StrategyQuant architect

0

Viewing 5 replies - 1 through 5 (of 5 total)