function CEL_ShutDown()

global m_CEL;
global m_OrderID;

try
    % Cancelling order if it wasn't filled within 10 seconds.
    if ~strcmp(m_OrderID, '')
        order = m_CEL.Orders.ItemByGuid(m_OrderID);
        if (order.get('CanBeCanceled'))
            order.Cancel;
            disp (['Canceling the order with ''', m_OrderID, ''' GUID.']);
        end
    end
    
    % Shutting down CQGCEL object.
    m_CEL.Shutdown;
catch
    disp('An error occurred in CEL_ShutDown.m file.');
end