function CEL_OnCELStarted(Source, EventID, varargin)

global m_CEL;
global m_Symbol1;
global m_Symbol2;

try
    % Informing about CQGCEL startup and requesting last 300 daily closes for given symbols.
    disp ('CEL is started.');
    disp ('Requesting daily expressions.');
    
    req = m_CEL.CreateExpressionRequest();
    
    req.AddSubExpression(['Close(', m_Symbol1, ')'],'ts1');
    req.AddSubExpression(['Close(', m_Symbol2, ')'],'ts2');
    req.RangeStart = int32(0);
    req.RangeEnd = int32(-300);
    req.HistoricalPeriod = 'hpDaily';
    req.UpdatesEnabled = true;
    
    m_CEL.RequestExpression(req);
catch
    CEL_ShutDown;
    disp('An error occurred in CEL_OnCELStarted.m file.');
end