Thanks for sharing. I did something similar a year back but eventually decided to embed all lib functions in every EA due to weird issues. I suspect that it is related to concurrency. When Two or more EAs used the lib in the same terminal, variables became mixed and the executions somehow didn't go through.
I distinctively remember some functions couldn't execute in MQH file, and all EA settings (Allow live trading, allow short/long/both orders, etc) didn't apply to function calls in MQH file.
In retrospect, that was an early beta version and I've since discovered a lot of bugs. I may release a more polished version in the future, but not until I'm confident that it works well.
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
While coding my own experts, I realized that the process for opening/closing orders, etc. is pretty much the same every time, and I kept reusing the same code every time I wanted to try a new strategy.
Instead of having to write new code each time to open and close orders, I decided to write an include file with functions that will do it automatically, and keep track of the state of opened/closed orders, trailing stops, adding to profitable positions and hedging.
The end result is that it takes minutes to code an EA to try out a new strategy using different indicators. That way, the programmer can concentrate on coding buy/sell logic instead of dealing with routine actions.
Try it out, modify it and let me know if you like it or have any suggestions.