after Error Function, my robot stop following the set rules

 

Hello Guys. am new and i need your help.

i wrote an EA using Candlestick open and close to take a Buy or Sell trade.

And it was working fine. then i tried working with "error functions" and everything went wrong

my Comment, cant display on terminal screen, the E takes trade on random not following the set rules.

i need help and more exposure.

Thanks.

Files:
 

Hi, use the program in strict verification mode

#property strict

https://docs.mql4.com/basis/preprosessor/compilation

You have a lot of bugs in your code

Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference
Program Properties (#property) - Preprocessor - Language Basics - MQL4 Reference
  • docs.mql4.com
Every MQL4-program allows to specify additional specific parameters named #property that help client terminal in proper servicing for programs without the necessity to launch them explicitly. This concerns external settings of indicators, first of all. Properties described in included files are completely ignored. Properties must be specified...
 
Pavel Shutovskiy:

Hi, use the program in strict verification mode

https://docs.mql4.com/basis/preprosessor/compilation

You have a lot of bugs in your code

Wow that's something else, thanks for the hint.

 
i need help in debugging my code... i can't see the problem. 
 
  1. Use the debugger and step through your code, set breakpoints in the code, examine variable values.
  2. Help you with what? Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.
 
William Roeder:
  1. Use the debugger and step through your code, set breakpoints in the code, examine variable values.
  2. Help you with what? Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

cant you see the attached file?

 
  1. No, because you have not attached one, here.
  2. Fix your compile errors and warnings first. You can't debug if it doesn't compile
  3. Don't double post! You already had another thread open.

              General rules and best pratices of the Forum. - General - MQL5 programming forum

 
William Roeder:
  1. No, because you have not attached one, here.
  2. Fix your compile errors and warnings first. You can't debug if it doesn't compile
  3. Don't double post! You already had another thread open.

              General rules and best pratices of the Forum. - General - MQL5 programming forum

I fixed it. thanks for the insights.

Reason: