(Options) find contract by delta

Posted By: jzastrow

(Options) find contract by delta - 02/08/18 09:02

Is there some hidden function which allows selecting an option close to a specified delta?
Implemented as a binary search would be a lot faster than simply looping over all options.
Posted By: jcl

Re: (Options) find contract by delta - 02/08/18 09:45

No, a binary search won't do because Delta is not a stored value. It must be calculated. Go through all the options and call

var Delta;
contractVal(Contract,Price,HistVol,0,Yield,&Delta);

Then select the contract closest to the specified delta.
Posted By: Zheka

Re: (Options) find contract by delta - 02/08/18 12:41

I once had a suggestion to add several greeks to the Contract struct. It would be quite convenient to store everything in one place-both for historical testing and in RT. Also, IB streams greeks via API. Getting them ready would allow searching much faster than doing numerous calculations in R.
But IB plug-in should allow for that.
© 2024 lite-C Forums