def diagbtrfly(self, lowstrike, midstrike, highstrike, expiry1, expiry2):
assert lowstrike < midstrike<EOL>assert midstrike < highstrike<EOL>assert pd.Timestamp(expiry1) < pd.Timestamp(expiry2)<EOL>_rows1 = {}<EOL>_rows2 = {}<EOL>_prices1 = {}<EOL>_prices2 = {}<EOL>_index = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>_metrics = pd.DataFrame(index=_index, columns=['<STR_LIT>'])<EOL>_errmsg = "<STR_LIT>"<EOL>_opttype = '<STR_LIT>'<EOL>_rows1[_opttype] = _relevant_rows(self.data, (midstrike, expiry1, _opttype),<EOL>_errmsg.format(expiry1, midstrike, _opttype))<EOL>_prices1[_opttype] = _getprice(_rows1[_opttype])<EOL>_rows2[_opttype] = _relevant_rows(self.data, (highstrike, expiry2, _opttype),<EOL>_errmsg.format(expiry2, highstrike, _opttype))<EOL>_prices2[_opttype] = _getprice(_rows2[_opttype])<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _prices1[_opttype]<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _prices2[_opttype]<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'], _metrics.loc['<STR_LIT>', '<STR_LIT>'] =_getkeys(_rows1[_opttype], ['<STR_LIT>', '<STR_LIT>'])<EOL>_opttype = '<STR_LIT>'<EOL>_rows1[_opttype] = _relevant_rows(self.data, (midstrike, expiry1, _opttype),<EOL>_errmsg.format(expiry1, midstrike, _opttype))<EOL>_prices1[_opttype] = _getprice(_rows1[_opttype])<EOL>_rows2[_opttype] = _relevant_rows(self.data, (lowstrike, expiry2, _opttype),<EOL>_errmsg.format(expiry2, lowstrike, _opttype))<EOL>_prices2[_opttype] = _getprice(_rows2[_opttype])<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _prices1[_opttype]<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _prices2[_opttype]<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _neartot = sum(_prices1.values())<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _fartot = sum(_prices2.values())<EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _neartot / _fartot <EOL>_metrics.loc['<STR_LIT>', '<STR_LIT>'] = _neartot - _fartot<EOL>return _metrics<EOL>
Metrics for evaluating a diagonal butterfly spread.

Parameters
------------
opttype : str ('call' or 'put')
    Type of option on which to collect data.
lowstrike : numeric
    Lower strike price. To be used for far put.
midstrike : numeric
    Middle strike price. To be used for near straddle.
    Typically at the money.
highstrike : numeric
    Higher strike price. To be used for far call.
expiry1 : date or date str (e.g. '2015-01-01')
    Earlier expiration date.
expiry2 : date or date str (e.g. '2015-01-01')
    Later expiration date.

Returns
------------
metrics : DataFrame
    Metrics for evaluating spread.