OnDeinit in indicators

 

Why, after opening a chart, the indicators attached to the chart do not trigger deinit?

This is logical!

 

more details, but just a guess as to what you mean (about drag and drop from market overview to a chart with an indicator???)

 

For example, the indicator draws support and resistance zones for the last 3 days. Deinit respectively removes zones. In the evening I switch off the PC, in the morning I switch it on and voila, 4 zones are displayed (3 previous and one new).

I ask the deinit to be triggered before the init, and after releasing the indicator.

 
I wonder how the indicator will detect what needs to be deleted if what is to be deleted is not defined in the deinit ?
 
eevviill:


Please make sure that the deinit is triggered before the init, and after the indicator is detached.

So call it yourself - what's the problem?

void OnDeinit(const  int reazon)
{
// .........................
}
int OnInit(void)
  {
   string short_name;
// -------
    OnDeinit(0);
// -------
// .............................
//--- initialization done
   return(INIT_SUCCEEDED);
  }
 
eevviill:

For example, the indicator draws support and resistance zones for the last 3 days. Deinit respectively removes zones. In the evening I switch off the PC, in the morning I switch it on and voila, 4 zones are displayed (3 previous and one new).

I request that the deinit be triggered before the init, well, and after detaching the indicator.

In the 670 build - bug with the deinitialization reason when closing the terminal (returns 4 - chart is closed and 9 should - terminal is closed)

Wrote - fixed it, 711 build works fine.

 
It's another bug that's been around for years, from build to build. I've gotten used to it, I deinitialise during initialisation as described above.
 
eevviill:

For example, the indicator draws support and resistance zones for the last 3 days. Deinit respectively removes zones. In the evening I switch off the PC, in the morning I switch it on and voila, 4 zones are displayed (3 previous and one new).

I would ask deinit to trigger before the init, and after detaching the indicator.

IfI shut down my PC in the evening, it can be assumed that some shutdown will be started and the terminal will be killed as a process when shutting down the PC...

If terminal is closed then OnDeinit works fine and deletes objects ( 711 build)...

 

No, it doesn't. I turn off the terminal normally.

If Deinit is put into Init, it doesn't work either.

Only the custom object deletion function helped.

 
Count the total number of objects on the chart, maybe other schedules are clogged? There is a limited amount of time to perform deinitialisation and may not have time to go through all the objects.
 
Guys, if you want a blank screen before displaying an indicator/advisor/script, you'll have to clear it.
Reason: