function CEL_StartUp(Sym)
clc;
global m_CEL;
global m_Symbol;

% Checking correctness of arguments.
if nargin < 1
   error('Insufficient input arguments.');
elseif nargin > 1
   error('Too many input arguments.');
end
if isempty(Sym)
   error('Incorrect input argument.');
else
   m_Symbol = Sym;
end
    
try 
    % Creating CQGCEL object.
    m_CEL = actxserver('CQG.CQGCEL.4');
    % Changing APIConfiguration of CQGCEL object.
    m_APIConfig = m_CEL.get('APIConfiguration');
    m_APIConfig.set('ReadyStatusCheck', 'rscOff');
    m_APIConfig.set('UseOrderSide', true);
    m_APIConfig.set('UsedFromATLClient', true);
    m_APIConfig.set('CollectionsThrowException', false);
    % Specifies that Quotes and props parameters in InstrumentChanged event
    % contain collections with old values.
    m_APIConfig.set('NewInstrumentChangeMode', true);
    
    % Registering callback listeners.
    m_CEL.registerevent({'DataConnectionStatusChanged' 'CEL_OnDataConnectionStatusChanged'});
    m_CEL.registerevent({'GWConnectionStatusChanged' 'CEL_OnGWConnectionStatusChanged'});
    m_CEL.registerevent({'CELStarted' 'CEL_OnCELStarted'});
    m_CEL.registerevent({'DataError' 'CEL_OnDataError'});
    m_CEL.registerevent({'InstrumentSubscribed' 'CEL_OnInstrumentSubscribed'});
    m_CEL.registerevent({'InstrumentChanged' 'CEL_OnInstrumentChanged'});
    m_CEL.registerevent({'IncorrectSymbol' 'CEL_OnIncorrectSymbol'});
    m_CEL.registerevent({'AccountChanged' 'CEL_OnAccountChanged'});
    m_CEL.registerevent({'LineTimeChanged' 'CEL_OnLineTimeChanged'});
    m_CEL.registerevent({'OrderChanged' 'CEL_OrderChanged'});

    %Starting CQGCEL object.
    m_CEL.Startup;
catch
    disp('An error occurred in CEL_StartUp.m file.');
end