INNER CODE UNIT · Python
find_strangle
ldt9/PyOptionTrader · models/futures/short_strangle.py:325
def find_strangle(self, call_delta=0.16, put_delta=-0.16, order='SELL'):
'''
Get the specified delta call and put to trade at that expiration
Get only 1 contract of each
:param call_delta: delta of the call we want to order
:param put_delta: delta of the put we want to order
:param order: whether we are buying or selling the option
'''
try:
# Get the current IV of the chain expiration
nearestDTE = self.nearestDTE.strftime('%Y%m%d')
self.get_chain_iv(nearestDTE=nearestDTE)
# get the call strike to sell
callToTrade = self.get_strike(delta=call_delta, option_type='C')