I see that it is most often used in cycles in the latest indicators. Shoveling the branches that were raised on this occasion. Someone writes that this function is not needed at all. Someone writes the type needed. As for me, there is no reason to check whether the program is closed, because if it is closed, then it will close and why check it?
Because for me, as I see now, this function has no use, but still I use it, the question arose why do they use it at all?
My thoughts are:
For example, there is a function that opens orders in the standard library. At the beginning, IsStopped () is checked. What for? After all, if, for example, when the program is running and the queue has reached the point where this check takes place, the check:
bool CTrade::OrderOpen(const string symbol,const ENUM_ORDER_TYPE order_type,const double volume,const double limit_price,
const double price,const double sl,const double tp,
ENUM_ORDER_TYPE_TIME type_time,const datetime expiration,const string comment)
//--- check stopped
the program execution will end and the order will not be sent. Then why do we need this 2 (3) extra lines of code? After all, whatever you say, the program will not continue to run because it is already closing.. (if it closes).