| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| MonitorEA https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=4854 |
Page 1 of 1 |
| Author: | renexxxx [ Sat Aug 06, 2016 8:14 am ] |
| Post subject: | MonitorEA |
This is a little spin-off project, to partly address a requirement that was discussed in the Stuck in loop and stuck in pause manager??? MonitorEA collects PINGs, sent by other charts, with the purpose of being able to detect that one of these other charts has stopped running (for whatever reason). An EA can stop PINGing if (1) it crashed with a runtime error (eg. zero divide) (2) it is running out or memory (3) it is stuck in an endless loop (4) ... others. Since each chart has only one processing thread, code in the OnTimer() event handler can not run if the thread is stuck in the OnTick() event handler, and vice versa. It is important to understand that this MonitorEA has a limited use case: It will NOT help you if:
How does it work and what does it do? It is assumed that the EA's to be monitored, are broadcasting a periodic PING message to all the other charts. An example of how this is done can be seen inside the RogueEA.mq4 file (attached), It only requires a few additional lines, particularly: Code: Select all Code attached. Have fun. Update 2016.08.07 There are two small changes to both RogueEA and MonitorEA: RogueEA wasn't sending the full 64-bytes of the long chartID (i.e. the StringFormat was %ld, but should be %I64d). Those 4 early birds should re-download both RogueEA and MonitorEA. It is entirely possible that you would have seen and corrected this already yourself. |
|
| Author: | tomele [ Sat Aug 06, 2016 10:14 am ] |
| Post subject: | MonitorEA |
Hi Rene, thanks for another fantastic masterpiece from you. I will test this along with my Billybots. |
|
| Author: | Boulder [ Sat Aug 06, 2016 12:54 pm ] |
| Post subject: | MonitorEA |
Brilliant stuff Rene.. ![]() |
|
| Author: | WhoKnows [ Mon Aug 08, 2016 11:47 am ] |
| Post subject: | MonitorEA |
Thanks again Rene, I see the Monitor EA is growing up very fast. I honestly think it is more than that. I could see that in all my cases with EAs being stuck and looping, as explained in the thread you refer to, that there was considerable time between an EA being stuck and the crash of the Empty4 platform. There were even cases where an EA was frozen without crashing Empty4 for two days. I think most users would not notice a problem before the Empty4 platform itself crashes. Having this ping system might prevent losing your shirt when the market moves away while the EA is stuck/frozen/looping/etc. Certainly people with looping alerts like 'Invalid Ticket' and 'failed OrderClose' should consider adding this. As discussed, I will be moving to a VPS based trading but I might still add 'the ping' as extra security. Why not just add it to every EA? But...too bad it is not calling for 'Mama' anymore like the first version. I loved the humor in that one. Still saved a screenshot from my testing last Friday. So I add it here for the sake of posterity. Cheers, Peter |
|
| Author: | Radar [ Sat Aug 13, 2016 7:48 am ] |
| Post subject: | MonitorEA |
Hey Renexxxx, Beautiful work! Just a couple of ideas... 1. To prevent Mon from restarting a manually stopped EA (client)... 1a. Have the client create a GV with the same naming format to the Ping during de-init. 1b. Have Mon look for the GV and de-register the client. 1c. In the unfortunate circumstance where automatically closing a client/chart causes de-init to trigger and create the GV, have Mon create a flag when restarting (restarting(ChartId, EAName, Symbol)) so that it knows to delete the GV without acting on it. 2. You could delay deleting temporary templates by waiting for x number of pings from the restarted client before calling the DeleteFileW routine (and also remove the restarting flag). I would code these myself, but they are way beyond my level of incompetence Have fun! Radar =8^) |
|
| Author: | renexxxx [ Sat Aug 13, 2016 8:37 am ] |
| Post subject: | MonitorEA |
Why not create a little deregister-event, that the client/chart sends OnDeinit(). The code for sending events is already there and the MonitorEA just needs to also listen for the deregister event (inside his OnChartEvent()) and run the delPing() function). I will add this to the new version. MonitorEA can also run DeleteFileW when the deregister event is received. One thing to keep in mind though, is that OnDeinit() is also run if/when the user hits F7 and presses OK on the Expert Properties panel. But that's OK, MonitorEA would quickly deregister the chart, delete the template (if it exists) and as soon as the client/chart starts sending new PINGs again, it will re-register the chart. No big deal. R. |
|
| Author: | renexxxx [ Sun Aug 14, 2016 6:03 am ] |
| Post subject: | MonitorEA |
I have made a few changes to MonitorEA. Update is in Post 1. In the end, it wasn't necessary to send a deregister event from RogueEA to inform MonitorEA that it can stop worrying about that particular chart. Instead, MonitorEA goes through all its known charts, and only sends alerts if it hasn't received a PING from charts that still exist. If it still has a chartID in its list of charts, that was closed, it simply removes that chartID from its list, so to not worry about that chart anymore. The other issue, of the templates not being deleted, has also been resolved. It just does a WINAPI equivalent of a "dir templates\*_restart.tpl', and deletes each template for which there is no open chart. Let me know if you find any problems. |
|
| Author: | avan1984 [ Mon Jun 24, 2019 8:24 pm ] |
| Post subject: | MonitorEA |
why i cant download the link of the ea that closes on high impact news |
|
| Author: | SteveHopwood [ Mon Jun 24, 2019 9:45 pm ] |
| Post subject: | MonitorEA |
I have sent you my Welcome message and you will find everything here is available to you. |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|