Hi Everyone!
Do you know if it is possible to create an indicator or expert or anything else that would disable an expert advisor operating on a Meta Trader 5 chart under certain conditions?
This is the request/scenario. I am running an Expert Advisor on a chart. Some time later a Bill Williams Reversal Fractal appears on chart. Ideally I would like the Expert Advisor to be removed preventing new trades from being opened. Is this even possible?
This scenario is ideal but I am also open to the idea that this might not be possible so the other question is can auto trading be disabled entirely rather than just on the current chart?
Appreciate any input regarding this.
Kind regards, Shane
You can read this link
- 2011.01.04
- www.mql5.com
Thank you guys for the reply I appreciate it!
I am looking for though complete automation of this manual process shown in the image attached.
It needs to have basic conditions attached to this also as described in my original post.
I am not looking to run more than one EA, just want to be able to close the one that i running automatically when conditions happen.
Hi Everyone!
Do you know if it is possible to create an indicator or expert or anything else that would disable an expert advisor operating on a Meta Trader 5 chart under certain conditions?
This is the request/scenario. I am running an Expert Advisor on a chart. Some time later a Bill Williams Reversal Fractal appears on chart. Ideally I would like the Expert Advisor to be removed preventing new trades from being opened. Is this even possible?
This scenario is ideal but I am also open to the idea that this might not be possible so the other question is can auto trading be disabled entirely rather than just on the current chart?
Appreciate any input regarding this.
Kind regards, Shane
Why not have the current expert your are using coded to detect such scenario and will be automatically paused (no trading but not removed from chart) while bill Williams conditions are true....of course this is only possible if you have the expert adviser source code. Well just another thought...
Here is a demo script to show how to control the AutoTrading button programatically.
//+------------------------------------------------------------------+ //| AutoTrading.mq5 | //| Copyright © 2018, Amr Ali | //| https://www.mql5.com/en/users/amrali | //+------------------------------------------------------------------+ #property script_show_inputs //--- input parameters input bool InpEnableAutoButton = false; // Enable AutoTrading Button //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #define KEYEVENTF_KEYUP 0x0002 #include <WinAPI\winapi.mqh> #include <VirtualKeys.mqh> //+------------------------------------------------------------------+ //| script start function | //+------------------------------------------------------------------+ void OnStart() { //--- disable the 'auto-trading' button if(!InpEnableAutoButton && TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)) { Simulate_Ctrl_E(); } } //--- enable the 'auto-trading' button if(InpEnableAutoButton && !TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)) { Simulate_Ctrl_E(); } } //+------------------------------------------------------------------+ //| Simulate 'Ctrl+E' keystroke to toggle the 'auto-trading' button | //+------------------------------------------------------------------+ void Simulate_Ctrl_E() { keybd_event(VK_CONTROL,0x9d,0,0); keybd_event((uchar)VkKeyScanW('E'),0x92,0,0); keybd_event((uchar)VkKeyScanW('E'),0x92,KEYEVENTF_KEYUP,0); keybd_event(VK_CONTROL,0x9d,KEYEVENTF_KEYUP,0); } //+------------------------------------------------------------------+
ExpertRemove
The function stops an Expert Advisor and unloads it from a chart.
https://www.mql5.com/en/docs/common/expertremove
//+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //--- if(floating_profit<-1000) { Alert("The expert advisor will be unloaded"); ExpertRemove(); } }
- www.mql5.com
Thanks all for the suggestions.
The EA is purchased as is from the vendor.
I could approach them and ask for a personal project but they may not be keen on altering their code as a one off task.
I was hoping I might be able to run something separately to the EA, keeping in mind this is not changing the EA it is only stopping it from continuing.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Everyone!
Do you know if it is possible to create an indicator or expert or anything else that would disable an expert advisor operating on a Meta Trader 5 chart under certain conditions?
This is the request/scenario. I am running an Expert Advisor on a chart. Some time later a Bill Williams Reversal Fractal appears on chart. Ideally I would like the Expert Advisor to be removed preventing new trades from being opened. Is this even possible?
This scenario is ideal but I am also open to the idea that this might not be possible so the other question is can auto trading be disabled entirely rather than just on the current chart?
Appreciate any input regarding this.
Kind regards, Shane