OrderSend in Class file called from EA?

 
Hi fellow coders,

I have a EA that then references a class file called Orders.  Orders then calls the OrderSend function.  Strategy tester acknowledged OrderSend commands in the class file just fine but I think when running in auto trade mode the OrderSend must be in the EA because no orders are being submitted and I get the basic “OrderSend failed with error #0”

My questions are:

1- can an EA be inherited by a class file?  This will allow me to keep my architecture without rewriting my order logic in the EA.

2 - is it confirmed that submitting a OrderSend command within a class file that was launched from an EA will not work?

Your help is appreciated.  
 
  1. No, an EA is 2+ functions OnInit/OnTick/…. It is not a class, so it can't be inherited from a class. The EA can create and use any class.

  2. Of course it can work. The EA, can create and use a class.

  3. "error #0" is no error. Check your return codes for errors, and report them including GLE/LE and your variable values. Don't look at GLE/LE unless you have an error. Don't just silence the compiler, it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

    Always use strict. Fixing the warnings will save you hours of debugging.

  4. 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. No, an EA is 2+ functions OnInit/OnTick/…. It is not a class, so it can't be inherited from a class. The EA can create and use any class.

  2. Of course it can work. The EA, can create and use a class.

  3. "error #0" is no error. Check your return codes for errors, and report them including GLE/LE and your variable values. Don't look at GLE/LE unless you have an error. Don't just silence the compiler, it is trying to help you.
              What are Function return values ? How do I use them ? - MQL4 programming forum
              Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles

    Always use strict. Fixing the warnings will save you hours of debugging.

  4. 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.
Thanks for the info.  

1- thanks for confirming my thoughts here

2 - ok will run a simple sample set of code to see.  I do know that when my EA sends a OrderSend it works,  just not in a class but will further test

3 - Will post all the values used and return values if necessary

4 - lol :) you took my “thank you for your help”. way beyond its context.  The comment was for anyone who would help with answering the post, not writing my code which is why I didn’t post any.  I’ve been a C#, C++ developer and database architect for over 20 years.  Just looking for a deeper understanding of MQL4 architecture beyond the documentation...tips and tricks.... no amateurs here.   thanks for your help (not coding help) .
Reason: