Do you use deinit()?

 
If so, for what sort of things?
 
For example, to delete all graphic objects from charts.
 
blogzr3:
If so, for what sort of things?

To send an email telling the user what caused the EA to de-initialise and what time it happened at.

 
cloudbreaker:

To send an email telling the user what caused the EA to de-initialise and what time it happened at.

Is that just theoretical?


If there is a problem with the EA, it will just crash with a registers dump or something - I don't think it will run deinit(), send an email, and then shutdown nicely. Maybe your EAs are friendlier than mine :)

 

Another example : to close files.

 
blogzr3:

Is that just theoretical?


If there is a problem with the EA, it will just crash with a registers dump or something - I don't think it will run deinit(), send an email, and then shutdown nicely. Maybe your EAs are friendlier than mine :)

Nope. Been running away happily for ages. Very useful. If someone changes the account or period causing the EA to be disabled, it'll tell you. If someone recompiles it, it'll tell you. Likewise if the EA is removed from the chart or if the platform is closed. If there is a sudden power outage, then my EA will recover from a recovery file it maintains and email you to tell you it has reinitialised, along with all the parameters it has picked up.

 
Jacques366 wrote >>

Another example : to close files.

I also use it to write a summary on whatever I am writing into a file, and then close it.

 
cloudbreaker:

Nope. Been running away happily for ages. Very useful. If someone changes the account or period causing the EA to be disabled, it'll tell you. If someone recompiles it, it'll tell you. Likewise if the EA is removed from the chart or if the platform is closed.

That someone who did all those things to your EA is not you? Interesting, the thought hasn't occurred to me.. yet :)

If there is a sudden power outage, then my EA will recover from a recovery file it maintains and email you to tell you it has reinitialised, along with all the parameters it has picked up.

If there is a power outage, deinit() wouldn't be of much use, would it? As recovery would be the role of init() rather than deinit().

 
blogzr3:

That someone who did all those things to your EA is not you? Interesting, the thought hasn't occurred to me.. yet :)

If there is a power outage, deinit() wouldn't be of much use, would it? As recovery would be the role of init() rather than deinit().

I construct EAs for the company I work for. So other folks may be running them.

Regards the power outage, you are absolutely right that deinit() doesn't get a look-in. I just included that so you'd get a complete picture of how I use email to keep folks informed on the operational side of things (of course I use email to notify trading activities, profits, losses etc. too).

Reason: