MQL4 Reference
Checkup
UninitializeReason
| int UninitializeReason( |
) |
Returns the code of the uninitialization reason for the experts, custom indicators, and scripts.
The returned values can be ones of Uninitialize reason codes.
This function can also be called in function init() to analyze the reasons for deinitialization of the previour launch.
Sample:
// this is example
int deinit()
{
switch(UninitializeReason())
{
case REASON_CHARTCLOSE:
case REASON_REMOVE: CleanUp(); break; // cleaning up and deallocation of all resources.
case REASON_RECOMPILE:
case REASON_CHARTCHANGE:
case REASON_PARAMETERS:
case REASON_ACCOUNT: StoreData(); break; // prepare to restart
}
//...
}
|
|
|