Help me with coding .. reverse ea signals

 

si i wanted to reverse the signal of this ea in order for it to open buy on sell arrow and sell on buy arrow ... i changed the code to do that .. opsell to opbuy ... ask to bid .. but ea doenst open trades at all .. any idea ? here is the code

 
  1. PLEASE, post your code as code using Alt+S or click on the icon </> from the editor line
  2. or post the mq5 file using  attach fileat the bottom of the edit window.
  3. If your code doesn't do what it should do, use the debugger here is how this tool works:
    https://www.metatrader5.com/en/metaeditor/help/development/debug // Code debugging
    https://www.mql5.com/en/articles/2041 // Error Handling and Logging in MQL5
    https://www.mql5.com/en/articles/272 // Tracing, Debugging and Structural Analysis of Source Code
    https://www.mql5.com/en/articles/35 // scrol down to: "Launching and Debuggin"

If you replace in the URL /en/by /de/you can read these articles in German.


Code debugging - Developing programs - MetaEditor Help
Code debugging - Developing programs - MetaEditor Help
  • www.metatrader5.com
MetaEditor has a built-in debugger allowing you to check a program execution step by step (by individual functions). Place breakpoints in the code...
 
Carl Schreiber #:
  1. PLEASE, post your code as code using Alt+S or click on the icon </> from the editor line
  2. or post the mq5 file using  attach fileat the bottom of the edit window.
  3. If your code doesn't do what it should do, use the debugger here is how this tool works:
    https://www.metatrader5.com/en/metaeditor/help/development/debug // Code debugging
    https://www.mql5.com/en/articles/2041 // Error Handling and Logging in MQL5
    https://www.mql5.com/en/articles/272 // Tracing, Debugging and Structural Analysis of Source Code
    https://www.mql5.com/en/articles/35 // scrol down to: "Launching and Debuggin"

If you replace in the URL /en/by /de/you can read these articles in German.


yes sorry for that .. problem is that i cant edit the topic !? anyidea ?

 
Forex Sniper #:

yes sorry for that .. problem is that i cant edit the topic !? anyidea ?

Did you check the log for any error?
 
_MAHA_ #:
Did you check the log for any error?

yes i get error 130 !

 
Forex Sniper #:

yes i get error 130 !

You can please trace the problem starting from here:

130

ERR_INVALID_STOPS

Invalid stops

That's only about open price, TP, SL and stop levels.
It could means that the stop-loss or take-profit levels are set too close to the current market price.

Each symbol and broker can have a different stop level.
- You can print all those numbers for crosscheck.

https://docs.mql4.com/constants/errorswarnings/errorcodes
https://docs.mql4.com/constants/environment_state/marketinfoconstants

Runtime Errors - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL4 Reference
Runtime Errors - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Runtime Errors - Codes of Errors and Warnings - Constants, Enumerations and Structures - MQL4 Reference
 
Forex Sniper #:

yes i get error 130 !

So you should change sl and tp (Perhaps by replacing '-' with '+' and vice versa) when you replace opsell to opbuy and vice versa.
 
Yohana Parmi #:

You can please trace the problem starting from here:

130

ERR_INVALID_STOPS

Invalid stops

That's only about open price, TP, SL and stop levels.
It could means that the stop-loss or take-profit levels are set too close to the current market price.

Each symbol and broker can have a different stop level.
- You can print all those numbers for crosscheck.

https://docs.mql4.com/constants/errorswarnings/errorcodes
https://docs.mql4.com/constants/environment_state/marketinfoconstants

ty will try

 
_MAHA_ #:
So you should change sl and tp ('-' replace with '+' and vice versa) when you replace opsell to opbuy and vice versa.

will give it a shot

 
_MAHA_ #:
So you should change sl and tp ('-' replace with '+' and vice versa) when you replace opsell to opbuy and vice versa.

so i tried to change them .. but i still get the error .. care to put your touch on the code ?

Files:
 
Forex Sniper #:

so i tried to change them .. but i still get the error .. care to put your touch on the code ?

Ok attach the original code without your changes
Reason: