Download MetaTrader 5

Please help me to edit code to reverse trades of an EA (buy>>sell and sell>>buy)

To add comments, please log in or register
Interested in Signals activity? Come and track!
fxliving
303
fxliving 2016.09.22 21:23 

Hi

I have a mql4 EA so I have the source

Please how to add 1 variable, that, if true, ALL shorts become longs, and all longs, shorts?

So where it would have long, it shorts, and where it would have short, it longs.

We don't touch TP, SL, and other rules. 

Thank you for your help! 

Marco vd Heijden
Moderator
4700
Marco vd Heijden 2016.09.22 21:32  
fxliving:

Hi

I have a mql4 EA so I have the source

Please how to add 1 variable, that, if true, ALL shorts become longs, and all longs, shorts?

So where it would have long, it shorts, and where it would have short, it longs.

We don't touch TP, SL, and other rules. 

Thank you for your help! 

Change

OP_BUY to OP_SELL
OP_SELL to OP_BUY

And change

Bid to Ask
and
Ask to Bid

In the OrderSend Function.

Note that if you put in TP/SL levels they will also have to be processed in reverse order.

Without code this is all we can do for you.

fxliving
303
fxliving 2016.09.22 22:57  

Thanks, I strictly did it, hope it will work.

I understand for TP SL but this is not an issue.

 Will let you know in 24 hours from now :)

Thanks again! 

fxliving
303
fxliving 2016.09.23 22:19  

Hi friend

I did and it doesnt work, it still long where it has to long, and short where it has to short :(


I replaced exactly like you said.

Thanks for your help. 

Biantoro Kunarto
14897
Biantoro Kunarto 2016.09.24 09:00  
 You need to put your code here, so other people can help you
Jose Francisco Casado Fernandez
2408
Jose Francisco Casado Fernandez 2016.09.24 14:19  
It depends on EA code. It's very difficult to change only one or two lines and all ok in your EA. Regards.
To add comments, please log in or register