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.
- Debugging Code with GDB, anyone tried?
- Strategy Tester - EA trading other currency pair than the Symbol in the ST
- EA doesn't work with cryptocurrency but work on Forex
- 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.
- Of course it can work. The EA, can create and use a class.
- "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 ArticlesAlways use strict. Fixing the warnings will save you hours of debugging.
- 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:
Thanks for the info. - 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.
- Of course it can work. The EA, can create and use a class.
- "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 ArticlesAlways use strict. Fixing the warnings will save you hours of debugging.
- 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.
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) .
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register