'Parameters
asset : zipline.asset.Asset
The asset identifier.
dt : datetime64-like
Midnight of the day for which data is requested.
Returns
pd.Timestamp : The last know dt for the asset and dt;
NaT if no trade is found before the given dt.'

def get_last_traded_dt(self, asset, dt):

    try:
        return self.panel.loc[int(asset), :dt, 'close'].last_valid_index()
    except IndexError:
        return NaT
