UninitializeReason

 

I notice that function UninitializeReason() define, learn from help:

REASON_REMOVE 1 Expert removed from chart.
REASON_RECOMPILE 2 Expert recompiled.
REASON_CHARTCHANGE 3 symbol or timeframe changed on the chart.
REASON_CHARTCLOSE 4 Chart closed.
REASON_PARAMETERS 5 Inputs parameters was changed by user.
REASON_ACCOUNT 6 Other account activated.


I want to use draw object to set price and time information for design some chart interactive indicator, what I need is:

1. keep the draw object position when chart close, include program exit and reopen;

2. If I delete the indicator, I want capture the indicator remove event, so I can delete the relate draw object in deinit function.

but it will return the same REASON_REMOVE in both situation.

It seems that REASON_CHARTCLOSE event is redundantly with REASON_REMOVE event in some way. (maybe, it like the windows OnClose event ?)

Could you redefine the event, statement a clear indicator DELETE event?

 
ok its out put