Edited as my description was not clear. Sorry if I put you on the wrong leg.
Do you know if a 'management EA' exist which:
- can send you a message (thinking of mobile push alert) that one of your EA's has crashed but the platform is still responsive? Or similarly that your EAs has entered pause but did not reactivate itself.
- or even more ideal a management EA which would restart your EAs that got frozen
The reason I ask this is because I have regularly a frozen RnR, Dotty or other EAs.
I don't blame the code of RnR or Dotty. It is just that EAs can get into a loop from the 'invalid ticket (that already was closed before)' syndrome. THe EA keeps pushing warnings, and within hours the platform grows into 1.5GB in memory and needs Windows taskmanager to have it killed.
It might be that you will never be able to prevent the freezing problem happening in CrapMT. I also found that freezing is highly dependent on the broker. I found that an EA might get frozen once a week with one broker, while the same EA has a 100% chance to become frozen within hours at other brokers. It even might partly be the crappy internet that I have (4.5 km via copper from the exchange).
In a similar situation, you may have an EA e.g. Dotty going into a 'pause' due to a spread widening, and not leaving the 'pause mode' after the delay.
In these cases you may lose a lot of money if the market moves away without the EA working.
[b]
At the time just after one chart/EA on the platform gets itself stuck, the other EAs/charts appear to be still working. At least to my observations. The affected chart/EA is stopped, but I see the clock on the other EAs/charts on the platform still ticking over. The platform at this time is still responsive except that the constant warning about 'invalid ticket' at 4 per second is highly irritable.[/b]
I imagine that it would be possible to code a 'master/manager EA' which assesses the individual EAs on the platform (e.g. via the time-stamp or an incrementing variable of the individual slaves). It could e.g. subtract the values of each magic/tradingEA every 5 minutes, and notify you if a slave stopped working (subtraction would result zero).
The 'EA manager would then send you an Email?/push a notification that a certain EA/magic was found to be frozen. Then you would know that you need to check your computer or VPS.
Or even more ideal would be a 'EA manager' which could reactivate the frozen slave, by restarting it after 5 minutes.
I tried to find if something like this already exists (I can't be the first with this thought), but no luck yet.
Do you have any ideas?
Stuck in loop and stuck in pause manager???
-
WhoKnows
- Trader
- Posts: 102
- Joined: Wed Mar 19, 2014 11:57 pm
- Location: North Brisbane, Australia
Stuck in loop and stuck in pause manager???
Last edited by WhoKnows on Wed Aug 03, 2016 3:52 am, edited 2 times in total.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Stuck in loop and stuck in pause manager???
It sounds that you are after a process watchdog monitor type of application. If/when the Empty4 terminal has crashed due to excessive memory and/or CPU usage, it doesn't help to have an EA or indicator running to alert you to that -- as this won't work either. A quick Google search brought up this KIWI application restarter, but I'm sure that are other similar applications.WhoKnows » Tue Aug 02, 2016 9:24 pm wrote:Do you have any ideas?
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Stuck in loop and stuck in pause manager???
Hi,
maybe you could set something up that "pings" you every hour. As soon as the ping is missing, you know that something is wrong.
maybe you could set something up that "pings" you every hour. As soon as the ping is missing, you know that something is wrong.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
-
WhoKnows
- Trader
- Posts: 102
- Joined: Wed Mar 19, 2014 11:57 pm
- Location: North Brisbane, Australia
Stuck in loop and stuck in pause manager???
Thanks Renexxxx,renexxxx » Tue Aug 02, 2016 9:50 pm wrote:It sounds that you are after a process watchdog monitor type of application. If/when the Empty4 terminal has crashed due to excessive memory and/or CPU usage, it doesn't help to have an EA or indicator running to alert you to that -- as this won't work either. A quick Google search brought up this KIWI application restarter, but I'm sure that are other similar applications.WhoKnows » Tue Aug 02, 2016 9:24 pm wrote:Do you have any ideas?
My description above of the problem was not good enough. I will edit that post.
I would like to use the time between the moment that one of the EAs starts looping but the platform is still working (only 1EA stuck) ... and the point hours later when the whole platform is unresponsive.
First, I will try that kiwi monitor, thanks for the tip. Did not think about an approach using a process monitor.
I do know that Empty4 will start to use more memory when an individual EA is in a loop until it gets to a point that it becomes unresponsive. Maybe a hard restart when MT uses more than 30MB? memory would be an option.
However what I really would like is a monitor that would warn me as soon after an EA starts looping or is paused ... before the platform crashes which might be hours later.
When I look at my Empty4 instance with 5 EAs running I see the following:
- 1 EA of the 5 EAs gets an 'invalid ticket' warning, and I see the clock of this EA has stopped.
- The other 4EAs on the same Empty4 are still working perfectly with their clock ticking over.
Would it not be possible for a management EA that looks at other EAs (like the basket EA manager) to see that one of the EAs that it is monitoring has stopped... in this window of time that only one EA is affected an the platform still works? And then push a warning to the user.
As far as I can see it the platform still works when one EA of the 5 EAs freezes. Would this provide a window of opportunity?
It is only later after hours? that the whole platform becomes unresponsive. At that time a 'basket type manager' would of course not work anymore.
But maybe it does not make sense what I think how it could work.
- rapple
- Trader
- Posts: 277
- Joined: Fri Feb 21, 2014 10:56 pm
- Location: Sydney, Australia
Stuck in loop and stuck in pause manager???
Hi WhoKnows
Hope we can get something up and running.
I am running Dotty on BEEKS vps and then use a local Empty4 instance to monitor progress only (use Steve's Position Monitoring Indicator and Rene's TradeChart, TradeReport). However as you state this does not tell me if the EA is in trouble.
BEEKS does have a auto-restart if the platform crashes but this would not work for a stuck EA.
Cheers Richard
Hope we can get something up and running.
I am running Dotty on BEEKS vps and then use a local Empty4 instance to monitor progress only (use Steve's Position Monitoring Indicator and Rene's TradeChart, TradeReport). However as you state this does not tell me if the EA is in trouble.
BEEKS does have a auto-restart if the platform crashes but this would not work for a stuck EA.
Cheers Richard
-
WhoKnows
- Trader
- Posts: 102
- Joined: Wed Mar 19, 2014 11:57 pm
- Location: North Brisbane, Australia
Stuck in loop and stuck in pause manager???
Got a new example of a platform running with 4EAs working, and 1EA stuck in a loop.
I will update the sequence in this post. The times quoted are the local time (with trade times converted to local time for easier reading)
13.44: the stuck EA started giving alerts (error 4051) at 13.44. Alert window cannot be closed as it just keeps popping up. Found that the second EA with magic 502 in a Empty4 holding 5 identical EAs with different setfiles was stuck with its clock stopped. The spread indicator also is frozen. The chart still moves forward and the price line goes up and down but THIS EA of course won't take any trades.
The Empty4 instance used about 25MB at that time. I will denote this as 13.44 25MB below.
16.32: the alert window is still pushing the same alert. The same EA still stuck.
However I see the other EAs in this Empty4 platform still making trades. Just saw a lot of movement on a chart as trades were closed and new opened.
This forms part of the danger of this situation. How would you even know that one of your platform EAs is stuck with an unknown position in the market?
13.44 25MB - 1EA in platform of 5 stuck in loop (502 stuck)
16.39 32MB - other EAs still taking and closing trades after 3 hours (501, 503, 504, 506 working)
17.43 34MB - other EAs still taking and closing trades after 4 hours (501, 503, 504, 506 working)
19.27 41MB - still as above
20.57 35MB - still as above. Alert window keeps giving alerts at couple per second. I guess this one is not going to die. Don't know if that is because error is different then the 'invalid ticket error I had before.
Two other MT4s are now reaching 70MB but can't see any stuck EAs there.
I will update the sequence in this post. The times quoted are the local time (with trade times converted to local time for easier reading)
13.44: the stuck EA started giving alerts (error 4051) at 13.44. Alert window cannot be closed as it just keeps popping up. Found that the second EA with magic 502 in a Empty4 holding 5 identical EAs with different setfiles was stuck with its clock stopped. The spread indicator also is frozen. The chart still moves forward and the price line goes up and down but THIS EA of course won't take any trades.
The Empty4 instance used about 25MB at that time. I will denote this as 13.44 25MB below.
16.32: the alert window is still pushing the same alert. The same EA still stuck.
However I see the other EAs in this Empty4 platform still making trades. Just saw a lot of movement on a chart as trades were closed and new opened.
This forms part of the danger of this situation. How would you even know that one of your platform EAs is stuck with an unknown position in the market?
13.44 25MB - 1EA in platform of 5 stuck in loop (502 stuck)
16.39 32MB - other EAs still taking and closing trades after 3 hours (501, 503, 504, 506 working)
17.43 34MB - other EAs still taking and closing trades after 4 hours (501, 503, 504, 506 working)
19.27 41MB - still as above
20.57 35MB - still as above. Alert window keeps giving alerts at couple per second. I guess this one is not going to die. Don't know if that is because error is different then the 'invalid ticket error I had before.
Two other MT4s are now reaching 70MB but can't see any stuck EAs there.
Last edited by WhoKnows on Wed Aug 03, 2016 11:18 am, edited 2 times in total.
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Stuck in loop and stuck in pause manager???
Hi WhoKnows,
Every chart in Empty4 is running in its own process thread. This (single) thread, does everything: It runs the OnTick(), OnTimer() and OnChartEvent() event handlers. If this (single) thread has stopped (for whatever reason) the EA stops performing further actions. Since each chart has its own thread, it is perfectly feasible that the other charts are happily continuing to function and be totally oblivious to the fact that one chart has stopped running.
I'm not aware of the existence of a chart (or thread) interrogator, that can be run from another chart (thread). What you CAN do though -- and that was already suggested by Thomas -- is, send periodical push notifications to your phone or email, from within the OnTimer() event handler. If you schedule the OnTimer() for instance every 5 minutes, you know that the thread that runs this OnTimer() event handler is stopped if you haven't received a push notification for more than 5 minutes. In order to implement this, you will need to edit the code of the EA you are running (basically, add the EventSetTimer( pingtime ) in the OnInit() and create/edit the OnTimer() event handler with a call to SendNofication( " .... ") )
Hope this is an answer to your problem.
Every chart in Empty4 is running in its own process thread. This (single) thread, does everything: It runs the OnTick(), OnTimer() and OnChartEvent() event handlers. If this (single) thread has stopped (for whatever reason) the EA stops performing further actions. Since each chart has its own thread, it is perfectly feasible that the other charts are happily continuing to function and be totally oblivious to the fact that one chart has stopped running.
I'm not aware of the existence of a chart (or thread) interrogator, that can be run from another chart (thread). What you CAN do though -- and that was already suggested by Thomas -- is, send periodical push notifications to your phone or email, from within the OnTimer() event handler. If you schedule the OnTimer() for instance every 5 minutes, you know that the thread that runs this OnTimer() event handler is stopped if you haven't received a push notification for more than 5 minutes. In order to implement this, you will need to edit the code of the EA you are running (basically, add the EventSetTimer( pingtime ) in the OnInit() and create/edit the OnTimer() event handler with a call to SendNofication( " .... ") )
Hope this is an answer to your problem.
-
WhoKnows
- Trader
- Posts: 102
- Joined: Wed Mar 19, 2014 11:57 pm
- Location: North Brisbane, Australia
Stuck in loop and stuck in pause manager???
Thanks Renexxxx and Tomele,
I did not know about every chart having its own thread. Your explanation about separate threads makes sense, thanks for the information.
It is time to get a good book about Empty4 programming and start coding, starting with the ping approach suggested by Tomele and you.
I will have to evaluate though if this will work practically if I would have more EAs running 24/7. In the ideal world I would want to be notified (or even awaken) when something doesn't work rather than assessing every x minutes if a ping arrived from the live EAs. I might need a ping detector then
... if such a thing exist.
Just getting a strange idea...
- could you program a basket manager to notify you if a magic has not sent any trade in the last xx minutes?
Time to do some study,
Thanks for your input.
I did not know about every chart having its own thread. Your explanation about separate threads makes sense, thanks for the information.
It is time to get a good book about Empty4 programming and start coding, starting with the ping approach suggested by Tomele and you.
I will have to evaluate though if this will work practically if I would have more EAs running 24/7. In the ideal world I would want to be notified (or even awaken) when something doesn't work rather than assessing every x minutes if a ping arrived from the live EAs. I might need a ping detector then
Just getting a strange idea...
- could you program a basket manager to notify you if a magic has not sent any trade in the last xx minutes?
Time to do some study,
Thanks for your input.
Last edited by WhoKnows on Wed Aug 03, 2016 10:24 am, edited 1 time in total.
- tomele
- Administrator
- Posts: 1208
- Joined: Tue May 17, 2016 3:40 pm
- Location: Germany, Forest of Odes, Defending the Limes
Stuck in loop and stuck in pause manager???
Hi,
basket managers basically work in this way: They look at the existing trades and modify them. They dont know what the other threads are doing. But threads can talk to each other through global variables.
Here are two approaches to what you want to achieve:
1. You could build an EA that looks at the existing trades and alarms you when the trades of a given other EA (identified by magic number or trade comment) havent changed for a given period.
2. Your EAs could update global variables periodically to the current date/time. If one EA stops working, it will stop updating this variable. An EA that observes these variables could then alarm you.
basket managers basically work in this way: They look at the existing trades and modify them. They dont know what the other threads are doing. But threads can talk to each other through global variables.
Here are two approaches to what you want to achieve:
1. You could build an EA that looks at the existing trades and alarms you when the trades of a given other EA (identified by magic number or trade comment) havent changed for a given period.
2. Your EAs could update global variables periodically to the current date/time. If one EA stops working, it will stop updating this variable. An EA that observes these variables could then alarm you.
Happy pippin, Thomas 
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so. (Mark Twain)
Keep the coder going: Donate
- renexxxx
- Trader
- Posts: 860
- Joined: Sat Dec 31, 2011 3:48 am
Stuck in loop and stuck in pause manager???
Or, alternatively, your EA could periodically broadcast a custom event, saying "I'm still alive". That custom event can be picked up by the monitoring EA, that in turn raises the alarm bells if it hasn't received an event from your EA for x minutes.tomele » Wed Aug 03, 2016 8:24 pm wrote: 2. Your EAs could update global variables periodically to the current date/time. If one EA stops working, it will stop updating this variable. An EA that observes these variables could then alarm you.