'Concatenates all of the separate equities DataFrames
into a single DataFrame that is time ordered, allowing tick
data events to be added to the queue in a chronological fashion.
Note that this is an idealised situation, utilised solely for
backtesting. In live trading ticks may arrive "out of order".'

def _merge_sort_ticker_data(self):

    df = pd.concat(self.tickers_data.values()).sort_index()
    start = None
    end = None
    if (self.start_date is not None):
        start = df.index.searchsorted(self.start_date)
    if (self.end_date is not None):
        end = df.index.searchsorted(self.end_date)
    df['colFromIndex'] = df.index
    df = df.sort_values(by=['colFromIndex', 'Ticker'])
    if ((start is None) and (end is None)):
        return df.iterrows()
    elif ((start is not None) and (end is None)):
        return df.ix[start:].iterrows()
    elif ((start is None) and (end is not None)):
        return df.ix[:end].iterrows()
    else:
        return df.ix[start:end].iterrows()
