Reverse logic code

 

I have a what would be considered a simple MA EA and I would like to have the EA trade with reverse logic. In other words, I would like the EA to buy when a sell signal is triggered and vice-versa. Is this a line in the code that can be added to do this and if so, would some one post it here as I would like to input the code myself using Meta Editor as I am a complete noob and would like to get acclimated to running Meta Editor and mql4. Thanks.


Jim

 

Generally, u need to 'reverse' the cmd parameter in each usage of OrderSend()... Whether or not this is sufficient depends on how the specific EA is designed.

p.s. if you are trying to turn an unprofitable EA into a profitable one by reversing all orders then you should read this -> https://www.mql5.com/en/forum/130589.

Reason: