i would love to know how to enable algo trading via code.
I would also like to know how this could be done.
Follow script below:
//+------------------------------------------------------------------+ //| TestAlgoTrading.mq5 | //| Tiago Praxedes | //| tepraxedes2020@gmail.com | //+------------------------------------------------------------------+ #define MT_WMCMD_EXPERTS 32851 #define WM_COMMAND 0x0111 #define GA_ROOT 2 #include <WinAPI\winapi.mqh> //+------------------------------------------------------------------+ //| Toggle auto-trading button | //+------------------------------------------------------------------+ void AlgoTradingStatus(bool Enable) { bool Status = (bool) TerminalInfoInteger(TERMINAL_TRADE_ALLOWED); if(Enable != Status) { HANDLE hChart = (HANDLE) ChartGetInteger(ChartID(), CHART_WINDOW_HANDLE); PostMessageW(GetAncestor(hChart, GA_ROOT), WM_COMMAND, MT_WMCMD_EXPERTS, 0); } } //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- AlgoTradingStatus(false); } //+------------------------------------------------------------------+
It is working perfectly. Thanks a lot.
Hello,
Anyway to disable algo trading of current chart EA only?
Thank you
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
Can Someone please help Me in disabling Algo-Trading via Code?
Help Will be really really appreciated and By helping me you will help many other peoples too because there is no previous forum of any detail about doing it on MT5.