Thanks sharing your experience.
Beside using existing libraries "that were pretty well thought out over a decade ago", which of course would be very useful, may I ask what you will have more with C# than with mql ? I am interested by actual useful information and not at all by an "opinion war" about the "best" coding language.
Thanks sharing your experience.
I believe it is speed and the direct communication with the server.
<off-topic message removed>.
I believe it is speed and the direct communication with the server.
Forum on trading, automated trading systems and testing trading strategies
C# expert advisors, don't waste your time
Alain Verleyen, 2016.11.27 15:10
Beside using existing libraries "that were pretty well thought out over a decade ago", which of course would be very useful, may I ask what you will have more with C# than with mql ? I am interested by actual useful information and not at all by an "opinion war" about the "best" coding language.Thanks sharing your experience.
Garbage collection, error handling, memory management, synchronous or async programming, events, delegates, lambdas, specialized libraries for math, charting, and anything else you might want in order to view data in any way you want, and... integrating with other systems without hacks and wrapper code. Basically, you could focus on the strategy and how best to implement it, instead of reinventing boilerplate code like "map reduce" or doing error handling by checking a global variable for an error code. handling errors that way means you can't reliably do any kind of async code because who knows which thread changed the global "last error" you know?
Garbage collection, error handling, memory management, synchronous or async programming, events, delegates, lambdas, specialized libraries for math, charting, and anything else you might want in order to view data in any way you want, and... integrating with other systems without hacks and wrapper code. Basically, you could focus on the strategy and how best to implement it, instead of reinventing boilerplate code like "map reduce" or doing error handling by checking a global variable for an error code. handling errors that way means you can't reliably do any kind of async code because who knows which thread changed the global "last error" you know?
Of course there could be improvements to mql (see above). But all what you say is existing in CTrader right, why you are trying to use MT4/MT5 and "waste your time using C# with them " ? Why are most brokers using MT4/MT5 and not CTrader and it's C# ? There is a lot of things I don't understand or want to be improved in MT4/MT5 but it's Metaquotes software, it's their business and their decision, and as far as I can see they are still very successful. So it's always stunning me to see people asking "why I don't have this feature or this one with mql (or MTx)". Do you understand the implications for a company to develop a language supporting all these features, to embed it in their platform, to support it...? While most people already complaint about mql5 complexity in face of mql4 ?
- Garbage collection is useless in a managed environment like MT platforms (the platform is the garbage collector).
- Error handling : I do agree there could be at least more possibilities that the limited "GetLasterrror".
- Memory Management : Not sure what you mean exactly ? But in all cases it seems to me a trading platform could only have minimum memory management as security is an issue.
- Asynchronous : agree. But we can live without it. We already have asynchronous trading orders, and that's the main thig in a trading platform.
- Events : already there. In MQ way of course.
- Delegate, lambdas : really ?
- Specialized libraries for math. There is already a lot.
- Charting : What do you mean exactly ?
Why would Metatrader expose a standard client API ? What would be their advantage ? They are monopolizing te market, why would they open their platform ? If you have convincing arguments, just contact Metaquotes, they will certainly be grateful to implement something which can profit their business.
If I learned something from live it's how it's useless to complain about things you don't have any control on.
Why would Metatrader expose a standard client API ? What would be their advantage ? They are monopolizing te market, why would they open their platform ? If you have convincing arguments, just contact Metaquotes, they will certainly be grateful to implement something which can profit their business.
If I learned something from live it's how it's useless to complain about things you don't have any control on.
Of course there could be improvements to mql (see above). But all what you say is existing in CTrader right, why you are trying to use MT4/MT5 and "waste your time using C# with them " ? Why are most brokers using MT4/MT5 and not CTrader and it's C# ? There is a lot of things I don't understand or want to be improved in MT4/MT5 but it's Metaquotes software, it's their business and their decision, and as far as I can see they are still very successful. So it's always stunning me to see people asking "why I don't have this feature or this one with mql (or MTx)". Do you understand the implications for a company to develop a language supporting all these features, to embed it in their platform, to support it...? While most people already complaint about mql5 complexity in face of mql4 ?
- Garbage collection is useless in a managed environment like MT platforms (the platform is the garbage collector).
- Error handling : I do agree there could be at least more possibilities that the limited "GetLasterrror".
- Memory Management : Not sure what you mean exactly ? But in all cases it seems to me a trading platform could only have minimum memory management as security is an issue.
- Asynchronous : agree. But we can live without it. We already have asynchronous trading orders, and that's the main thig in a trading platform.
- Events : already there. In MQ way of course.
- Delegate, lambdas : really ?
- Specialized libraries for math. There is already a lot.
- Charting : What do you mean exactly ?
Why would Metatrader expose a standard client API ? What would be their advantage ? They are monopolizing te market, why would they open their platform ? If you have convincing arguments, just contact Metaquotes, they will certainly be grateful to implement something which can profit their business.
If I learned something from live it's how it's useless to complain about things you don't have any control on.
Lol, I know. That's why the title of the thread advises people to stop trying to use bridges and just code in mql. I already found an open source project that's gaining traction, let's me code in C#, let's me backtest with multiple time frames and currencies simultaneously, let's me store my projects in their cloud or run them privately, and let's me trade fx and equities through three well known and reputable brokers. Metaquotes can do what they want to do, I like a lot of things they've done, but I'm going to try writing software for this other platform because I believe it will be easier for me to create reliable programs that give the results I want. I'll still use metatrader, and probably still make scripts (macros) for doing simple things, just won't be trying to do technical analysis on it.
Sure, do what is best for you.
But I can't agree if your conclusion is something about technical analysis cannot be done with mql. Maybe I am lacking of imagination.
Sure, do what is best for you.
But I can't agree if your conclusion is something about technical analysis cannot be done with mql. Maybe I am lacking of imagination.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've spent a lot of time looking around at different options for writing expert advisors in C# and I can tell you with certainty that all of the available solutions are terrible. Wasting your time attempting to write expert advisors in any language besides MQL is a terrible idea. I know, you want to use a modern programming language that lets you do routine things without rewriting common algorithms that were pretty well thought out over a decade ago, well too bad. You're stuck using this domain specific language, with all it's limitations and bugs, and the only solutions out there are basically wrappers that pass information back to MQL functions anyway. Skip the whole mess of debugging the language you choose, the wrapper layer, and then the MQL layer, just to get Linq, third party libraries that work, garbage collection, expert systems, etc. oh... and Try {} Catch {}, you don't need any of that.
Basically, there are two flavors of wrapper out there in any sort of useful state:
1. Create a server wrapping every MQL function in an expert advisor, script, or indicator, then have the C# expert advisor post messages that the MQL code reads and executes in a loop.
2. Create an unmanaged dll exporting every MQL function, call those unmanaged functions in managed code and deal with marshaling, disposing, and basically managing the unmanaged code... but hey, you're still going to need an expert advisor, script, or indicator that loads the unmanaged dll and initiates the whole process so... basically messages and loops that end up in MQL again.
You just can't escape the DSL here, so stop trying. There is no client API, no UI plugin system, no UI extension system. You can just create unmanaged C++ dll and consume them in your MQL expert advisors. Don't cry, that's just how it is, and the deeper you look the more you can see that it is completely intentional. You will write code, and you will be locked into this platform, end of story.
If you want a trading platform that allows you to code in C# and trade with reputable brokers, just google it. If you love Metatrader, learn it's language.