function CEL_OnTimedBarsResolved(Source, EventID, cqg_timed_bars, cqg_error, varargin)

global m_UpdatesCount;

try
    m_UpdatesCount = m_UpdatesCount + 1;
    
    for i = 0:cqg_timed_bars.Count - 1

        RefreshTimedBars(cqg_timed_bars, i);

    end

    % Uncomment the next line to display the TimedBars or comment to hide them
    DisplayTimedBars(['Symbol "' upper(cqg_timed_bars.Request.Symbol) '" was Resolved from ' cqg_timed_bars.StartTimestamp ' to ' cqg_timed_bars.EndTimestamp]);
    
catch
    CEL_ShutDown;
    disp('An error occurred in CEL_OnTimedBarsResolved.m file.');
end