I have worked out why it did not work as expected, was to do with, on FX sometimes if you save something wrong, it then won't work when correct, so I closed/deleted, and started from fresh. This time all worked, I then recreated and changed a few words to be able to switch Algo Trading back on, I will add this code below.
1 = SetAlgoTradingFo(true);
2=#include <WinUser32.mqh>
#import "user32.dll"
int GetAncestor(int, int);
#define MT4_WMCMD_EXPERTS 33020
#import
(this is the same deactivate)
3= void SetAlgoTradingFo(bool falseTrue) {
//--- getting the current status
bool currentStatus = IsTradeAllowed();
//--- if the current status is equal to input falseTrue then, no need to toggle auto-trading
if(currentStatus != falseTrue) {
//--- Toggle Auto-Trading
int main = GetAncestor(WindowHandle(Symbol(), Period()), 2/GA_ROOT/);
PostMessageA(main, WM_COMMAND, MT4_WMCMD_EXPERTS, 0 );//Toggle Expert Advisor button
}
}
(is slightly different to disable and I called this block a different name)