Find the IV for this...

Discussion in 'Options' started by thecoder, Nov 14, 2021.

  1. thecoder

    thecoder

    As said, only ITM options with high strikes are affected.
    Do you mean to use OTM options for calculating the IV of ITM options? Is there such a way?
     
    #21     Nov 15, 2021
  2. thecoder

    thecoder

    Hmm. since we don't have the s (ie. IV), we can't solve for u (ie. u = r - q).
    This means we have to use another iterative method (ie. interval bisection etc.)...
    Fk'it!
     
    #22     Nov 15, 2021
  3. thecoder

    thecoder

    I tried this (ie. other prices), but it doesn't work. I mean it works thru, but produces a wrong result (like IV=300% instead of 800% or so.).
    This means, one has to find a value for r that's fitting the bill. I'm still working on this...
    That is:
    In the Bid/Ask is the Dividend and/or Interest rate included. The task is to figure out their parts (ie. r and q, or u = r - q). Then it should work, IMO.
     
    #23     Nov 15, 2021
  4. thecoder

    thecoder

    Breakthrough!
    Like I said & suspected: with a fitting r param it finally works! Yippeyeah!
    As said, trying other prices does produce wrong IV, but with an "artificially correct" r (the risk-free-rate) it finally gives the right result.

    Log output of my test pgm with manually providing r=19% (this will later be automated), using interval halving):
    Code:
    Params: fC=0 Last=93.40 Bid=95.20 Ask=95.40 S=4.40 K=100.00 DTE=6.000000(t=0.016438) rPct=19.000000(r=0.190000) qPct=0.000000(q=0.000000) DaysInYear=365.000000 MaxSteps=200 ErrPct=0.000001
    Pr=95.300000
    DBG: via P/C parity: rawCall=0.0118415 Call=0.0118415
    rawOppositePrem=0.011842
    s=xSigma=50.0000000 Pr=95.3000000
    BSM : C=4.3744872 P=99.6626457 rawC=4.3744872 rawP=99.6626457 C2=4.3744872 rawC2=4.3744872 P2=99.6626457 rawP2=99.6626457 : S=4.400000 K=100.000000 t=0.0164384 s=50.0000000 r=0.1900000 q=0.0000000 : st=6.4106076 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=3.2053038 z2=-3.6920662 z0=-0.4867623 z1=2.7185415 p2=0.00011121978903873833881624233477 p0=0.31321338192790778621760888755787 p1=0.99672147838934709387654492518394 dp=0.9966103 dp*S=4.3850851 dp*K=99.6610259 : TEST z=z0=-0.48676233657509608248443143396766 --> sx=50.10009118302837713421205023678340
    BSM : C=2.7376749 P=98.0258334 rawC=2.7376749 rawP=98.0258334 C2=2.7376749 rawC2=2.7376749 P2=98.0258334 rawP2=98.0258334 : S=4.400000 K=100.000000 t=0.0164384 s=25.0000000 r=0.1900000 q=0.0000000 : st=3.2053038 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=1.6026519 z2=-2.5761766 z0=-0.9735247 z1=0.6291272 p2=0.00499498064431417722699481365201 p0=0.16514630182684834870058404598936 p1=0.73536712042487704986491042769003 dp=0.7303721 dp*S=3.2136374 dp*K=73.0372140 : TEST z=z0=-0.97352467315019216496886286793533 --> sx=25.05004559151418856710602511839170
    BSM : C=0.2556779 P=95.5438364 rawC=0.2556779 rawP=95.5438364 C2=0.2556779 rawC2=0.2556779 P2=95.5438364 rawP2=95.5438364 : S=4.400000 K=100.000000 t=0.0164384 s=12.5000000 r=0.1900000 q=0.0000000 : st=1.6026519 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.8013260 z2=-2.7483753 z0=-1.9470493 z1=-1.1457234 p2=0.00299457057348560972309843564165 p0=0.02576440945843707565235218559518 p1=0.12595481123841102821391164934273 dp=0.1229602 dp*S=0.5410251 dp*K=12.2960241 : TEST z=z0=-1.94704934630038432993772573587066 --> sx=12.52502279575709428355301255919585
    BSM : C=0.0001774 P=95.2883359 rawC=0.0001774 rawP=95.2883359 C2=0.0001774 rawC2=0.0001774 P2=95.2883359 rawP2=95.2883359 : S=4.400000 K=100.000000 t=0.0164384 s=6.2500000 r=0.1900000 q=0.0000000 : st=0.8013260 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.4006630 z2=-4.2947617 z0=-3.8940987 z1=-3.4934357 p2=0.00000874405518358365102873919206 p0=0.00004928225880295404983180707070 p1=0.00023842388888573192405606615552 dp=0.0002297 dp*S=0.0010106 dp*K=0.0229680 : TEST z=z0=-3.89409869260076865987545147174131 --> sx=6.26251139787854714177650627959792
    BSM : C=0.0320757 P=95.3202342 rawC=0.0320757 rawP=95.3202342 C2=0.0320757 rawC2=0.0320757 P2=95.3202342 rawP2=95.3202342 : S=4.400000 K=100.000000 t=0.0164384 s=9.3750000 r=0.1900000 q=0.0000000 : st=1.2019889 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.6009945 z2=-3.1970603 z0=-2.5960658 z1=-1.9950713 p2=0.00069417959147382180679075602825 p0=0.00471490031143666297585442803708 p1=0.02301755048006957096685606845021 dp=0.0223234 dp*S=0.0982228 dp*K=2.2323371 : TEST z=z0=-2.59606579506717910651135416966184 --> sx=9.39376709681782071266475941939689
    BSM : C=0.0047550 P=95.2929135 rawC=0.0047550 rawP=95.2929135 C2=0.0047550 rawC2=0.0047550 P2=95.2929135 rawP2=95.2929135 : S=4.400000 K=100.000000 t=0.0164384 s=7.8125000 r=0.1900000 q=0.0000000 : st=1.0016574 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5008287 z2=-3.6161077 z0=-3.1152790 z1=-2.6144502 p2=0.00014953300757867315552186726624 p0=0.00091885513745933170199654826948 p1=0.00446855899136222600460249809728 dp=0.0043190 dp*S=0.0190037 dp*K=0.4319026 : TEST z=z0=-3.11527895408061492781362500359421 --> sx=7.82813924734818392678695198050320
    BSM : C=0.0138460 P=95.3020045 rawC=0.0138460 rawP=95.3020045 C2=0.0138460 rawC2=0.0138460 P2=95.3020045 rawP2=95.3020045 : S=4.400000 K=100.000000 t=0.0164384 s=8.5937500 r=0.1900000 q=0.0000000 : st=1.1018232 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5509116 z2=-3.3829834 z0=-2.8320718 z1=-2.2811602 p2=0.00035851486856182247071021806928 p0=0.00231237330082387836723174789899 p1=0.01126948500267860558531757275702 dp=0.0109110 dp*S=0.0480083 dp*K=1.0910970 : TEST z=z0=-2.83207177643692266182616490421964 --> sx=8.61095317208300231950901526545294
    BSM : C=0.0083926 P=95.2965511 rawC=0.0083926 rawP=95.2965511 C2=0.0083926 rawC2=0.0083926 P2=95.2965511 rawP2=95.2965511 : S=4.400000 K=100.000000 t=0.0164384 s=8.2031250 r=0.1900000 q=0.0000000 : st=1.0517403 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5258702 z2=-3.4928025 z0=-2.9669323 z1=-2.4410622 p2=0.00023898994456148246788920741501 p0=0.00150393572608433664342282576332 p1=0.00732206657079282672673063714353 dp=0.0070831 dp*S=0.0311655 dp*K=0.7083077 : TEST z=z0=-2.96693233721963326473929078996861 --> sx=8.21954620971559312293114318848097
    BSM : C=0.0108632 P=95.2990216 rawC=0.0108632 rawP=95.2990216 C2=0.0108632 rawC2=0.0108632 P2=95.2990216 rawP2=95.2990216 : S=4.400000 K=100.000000 t=0.0164384 s=8.3984375 r=0.1900000 q=0.0000000 : st=1.0767818 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5383909 z2=-3.4363248 z0=-2.8979339 z1=-2.3595430 p2=0.00029483181004206728730368536340 p0=0.00187814867249591128288768726584 p1=0.00914872925123400148749060190045 dp=0.0088539 dp*S=0.0389571 dp*K=0.8853897 : TEST z=z0=-2.89793391077266504918946710134264 --> sx=8.41524969089929772165376009596116
    BSM : C=0.0122869 P=95.3004453 rawC=0.0122869 rawP=95.3004453 C2=0.0122869 rawC2=0.0122869 P2=95.3004453 rawP2=95.3004453 : S=4.400000 K=100.000000 t=0.0164384 s=8.4960938 r=0.1900000 q=0.0000000 : st=1.0893025 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5446512 z2=-3.4092756 z0=-2.8646243 z1=-2.3199731 p2=0.00032567824752568235910886451645 p0=0.00208752113576423950990455791210 p1=0.01017116655823473763613044862364 dp=0.0098455 dp*S=0.0433201 dp*K=0.9845488 : TEST z=z0=-2.86462432559137004884838861862306 --> sx=8.51310143149115002014770681171285
    BSM : C=0.0115585 P=95.2997170 rawC=0.0115585 rawP=95.2997170 C2=0.0115585 rawC2=0.0115585 P2=95.2997170 rawP2=95.2997170 : S=4.400000 K=100.000000 t=0.0164384 s=8.4472656 r=0.1900000 q=0.0000000 : st=1.0830421 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5415211 z2=-3.4227039 z0=-2.8811828 z1=-2.3396618 p2=0.00031000787907027135717301369322 p0=0.00198092865181913893807622017995 p1=0.00965060478541428421969151918436 dp=0.0093406 dp*S=0.0410986 dp*K=0.9340597 : TEST z=z0=-2.88118284770461496229268516522382 --> sx=8.46417556119522387046705258484280
    BSM : C=0.0119185 P=95.3000770 rawC=0.0119185 rawP=95.3000770 C2=0.0119185 rawC2=0.0119185 P2=95.3000770 rawP2=95.3000770 : S=4.400000 K=100.000000 t=0.0164384 s=8.4716797 r=0.1900000 q=0.0000000 : st=1.0861723 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5430861 z2=-3.4159659 z0=-2.8728797 z1=-2.3297936 p2=0.00031778105756940974160537627391 p0=0.00203374467192303333483265059822 p1=0.00990853179501550234103794678742 dp=0.0095908 dp*S=0.0421993 dp*K=0.9590751 : TEST z=z0=-2.87287972710604258487661344378949 --> sx=8.48863849634318694617474143626623
    BSM : C=0.0117375 P=95.2998960 rawC=0.0117375 rawP=95.2998960 C2=0.0117375 rawC2=0.0117375 P2=95.2998960 rawP2=95.2998960 : S=4.400000 K=100.000000 t=0.0164384 s=8.4594727 r=0.1900000 q=0.0000000 : st=1.0846072 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5423036 z2=-3.4193289 z0=-2.8770253 z1=-2.3347217 p2=0.00031387899321542536983271898254 p0=0.00200721705943511202047645214375 p1=0.00977898206192089311018268704689 dp=0.0094651 dp*S=0.0416465 dp*K=0.9465103 : TEST z=z0=-2.87702529669782619591369976497219 --> sx=8.47640702876920540832089701055452
    BSM : C=0.0118278 P=95.2999862 rawC=0.0118278 rawP=95.2999862 C2=0.0118278 rawC2=0.0118278 P2=95.2999862 rawP2=95.2999862 : S=4.400000 K=100.000000 t=0.0164384 s=8.4655762 r=0.1900000 q=0.0000000 : st=1.0853897 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5426949 z2=-3.4176459 z0=-2.8749510 z1=-2.3322561 p2=0.00031582615326526924503375282072 p0=0.00202045090816948253831068782471 p1=0.00984361008994575858413629554367 dp=0.0095278 dp*S=0.0419222 dp*K=0.9527784 : TEST z=z0=-2.87495101746444636477487155623578 --> sx=8.48252276255619617681413835441617
    BSM : C=0.0118731 P=95.3000316 rawC=0.0118731 rawP=95.3000316 C2=0.0118731 rawC2=0.0118731 P2=95.3000316 rawP2=95.3000316 : S=4.400000 K=100.000000 t=0.0164384 s=8.4686279 r=0.1900000 q=0.0000000 : st=1.0857810 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5428905 z2=-3.4168055 z0=-2.8739150 z1=-2.3310245 p2=0.00031680263697192573269477422482 p0=0.00202709029357999486928819388165 p1=0.00987603419778541747188309318783 dp=0.0095592 dp*S=0.0420606 dp*K=0.9559232 : TEST z=z0=-2.87391499907977449198258346196866 --> sx=8.48558062944969156149443989534120
    BSM : C=0.0118504 P=95.3000089 rawC=0.0118504 rawP=95.3000089 C2=0.0118504 rawC2=0.0118504 P2=95.3000089 rawP2=95.3000089 : S=4.400000 K=100.000000 t=0.0164384 s=8.4671021 r=0.1900000 q=0.0000000 : st=1.0855854 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5427927 z2=-3.4172256 z0=-2.8744329 z1=-2.3316402 p2=0.00031631415305871272503415725375 p0=0.00202376872764322058738037379833 p1=0.00985981296206964779520014185987 dp=0.0095435 dp*S=0.0419914 dp*K=0.9543499 : TEST z=z0=-2.87443291492030067219194677807792 --> sx=8.48405169600294387002165086286709
    BSM : C=0.0118391 P=95.2999975 rawC=0.0118391 rawP=95.2999975 C2=0.0118391 rawC2=0.0118391 P2=95.2999975 rawP2=95.2999975 : S=4.400000 K=100.000000 t=0.0164384 s=8.4663391 r=0.1900000 q=0.0000000 : st=1.0854876 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5427438 z2=-3.4174357 z0=-2.8746919 z1=-2.3319482 p2=0.00031607009265347392424835848423 p0=0.00202210934970919586212145802051 p1=0.00985170923110640741932227115729 dp=0.0095356 dp*S=0.0419568 dp*K=0.9535639 : TEST z=z0=-2.87469194284811181954591985387992 --> sx=8.48328722927957002298421373964743
    BSM : C=0.0118447 P=95.3000032 rawC=0.0118447 rawP=95.3000032 C2=0.0118447 rawC2=0.0118447 P2=95.3000032 rawP2=95.3000032 : S=4.400000 K=100.000000 t=0.0164384 s=8.4667206 r=0.1900000 q=0.0000000 : st=1.0855365 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5427682 z2=-3.4173307 z0=-2.8745624 z1=-2.3317942 p2=0.00031619210772815638981272923225 p0=0.00202293892161307467818416594429 p1=0.00985576052279422214186764550359 dp=0.0095396 dp*S=0.0419741 dp*K=0.9539568 : TEST z=z0=-2.87456242304892965635891577402816 --> sx=8.48366946264125694650293230125726
    BSM : C=0.0118419 P=95.3000004 rawC=0.0118419 rawP=95.3000004 C2=0.0118419 rawC2=0.0118419 P2=95.3000004 rawP2=95.3000004 : S=4.400000 K=100.000000 t=0.0164384 s=8.4665298 r=0.1900000 q=0.0000000 : st=1.0855120 rt=0.0031233 qt=0.0000000 u=0.1900000 exp_mqt=1.0000000 exp_mrt=0.9968816 ut=0.0031233 z=0.5427560 z2=-3.4173832 z0=-2.8746272 z1=-2.3318712 p2=0.00031613109640893182188808863131 p0=0.00202252410639708218886324841979 p1=0.00985373473351042232981286672633 dp=0.0095376 dp*S=0.0419655 dp*K=0.9537604 : TEST z=z0=-2.87462718148960299732221079782590 --> sx=8.48347834596041348430989215145814
    BREAK #3
    --> Pr=95.300000   IV = s * 100 = 846.652985%  cSteps=19  Pr_last=95.300000
    
     
    Last edited: Nov 15, 2021
    #24     Nov 15, 2021
  5. thecoder

    thecoder

    Hmm. but after optimizing (reducing r so far that it still works) it gives an IMO unrealistic low IV like 325%.
    Back to the drawing board...
     
    #25     Nov 15, 2021
  6. thecoder

    thecoder

    I finally managed to solve this nasty problem of IV_finder! More info shortly...
     
    #26     Nov 16, 2021
  7. thecoder

    thecoder

    Ok, my new IV_finder algorithm computes these IVs for the Put table in posting https://www.elitetrader.com/et/threads/find-the-iv-for-this.362833/#post-5488922
    using Spot=4.40 and DTE=6 :
    Code:
    K=0.50  Pr=0.040000  :  IV=1062.79%  cSteps=28  Pr_last=0.040000
    K=1.50  Pr=0.040000  :  IV=528.83%  cSteps=31  Pr_last=0.040000
    K=2.00  Pr=0.040000  :  IV=400.11%  cSteps=32  Pr_last=0.040000
    K=2.50  Pr=0.055000  :  IV=325.20%  cSteps=32  Pr_last=0.055000
    K=3.00  Pr=0.040000  :  IV=218.73%  cSteps=33  Pr_last=0.040000
    K=3.50  Pr=0.050000  :  IV=156.81%  cSteps=33  Pr_last=0.050000
    K=4.00  Pr=0.125000  :  IV=130.98%  cSteps=31  Pr_last=0.125000
    K=4.50  Pr=0.375000  :  IV=141.90%  cSteps=22  Pr_last=0.375000
    K=5.00  Pr=0.750000  :  IV=157.03%  cSteps=29  Pr_last=0.750000
    K=5.50  Pr=1.175000  :  IV=163.07%  cSteps=29  Pr_last=1.175000
    K=7.50  Pr=3.100000  :  IV=78.12%  cSteps=7  Pr_last=3.100000
    K=10.00  Pr=5.600000  :  IV=78.12%  cSteps=7  Pr_last=5.600000
    K=12.50  Pr=8.100000  :  IV=156.25%  cSteps=6  Pr_last=8.100000
    K=15.00  Pr=10.600000  :  IV=156.25%  cSteps=6  Pr_last=10.600000
    K=17.50  Pr=13.100000  :  IV=156.25%  cSteps=6  Pr_last=13.100000
    K=20.00  Pr=15.600000  :  IV=156.25%  cSteps=6  Pr_last=15.600000
    K=22.50  Pr=18.100000  :  IV=156.25%  cSteps=6  Pr_last=18.100000
    K=25.00  Pr=20.600000  :  IV=156.25%  cSteps=6  Pr_last=20.600000
    K=27.50  Pr=23.100000  :  IV=156.25%  cSteps=6  Pr_last=23.100000
    K=30.00  Pr=25.600000  :  IV=156.25%  cSteps=6  Pr_last=25.600000
    K=32.50  Pr=28.100009  :  IV=361.33%  cSteps=10  Pr_last=28.100009
    K=35.00  Pr=30.600026  :  IV=393.68%  cSteps=14  Pr_last=30.600027
    K=37.50  Pr=33.100000  :  IV=312.50%  cSteps=5  Pr_last=33.100000
    K=40.00  Pr=35.600015  :  IV=404.66%  cSteps=14  Pr_last=35.600015
    K=42.50  Pr=38.100018  :  IV=417.48%  cSteps=12  Pr_last=38.100017
    K=45.00  Pr=40.600031  :  IV=439.45%  cSteps=10  Pr_last=40.600031
    K=47.50  Pr=43.200000  :  IV=893.13%  cSteps=23  Pr_last=43.200000
    K=50.00  Pr=45.600039  :  IV=462.65%  cSteps=13  Pr_last=45.600039
    K=52.50  Pr=48.550000  :  IV=1215.17%  cSteps=23  Pr_last=48.550000
    K=55.00  Pr=50.600020  :  IV=462.65%  cSteps=13  Pr_last=50.600020
    K=57.50  Pr=53.750000  :  IV=1355.86%  cSteps=18  Pr_last=53.750000
    K=60.00  Pr=55.600044  :  IV=496.22%  cSteps=14  Pr_last=55.600044
    K=62.50  Pr=58.100032  :  IV=495.61%  cSteps=12  Pr_last=58.100032
    K=65.00  Pr=60.600054  :  IV=515.14%  cSteps=12  Pr_last=60.600054
    K=67.50  Pr=63.113695  :  IV=773.52%  cSteps=20  Pr_last=63.113696
    K=72.50  Pr=68.146686  :  IV=904.41%  cSteps=21  Pr_last=68.146685
    K=80.00  Pr=75.672335  :  IV=981.12%  cSteps=21  Pr_last=75.672336
    K=100.00  Pr=95.771229  :  IV=1170.18%  cSteps=22  Pr_last=95.771229
    
    Now, I finally can replace YahooFinance's buggy IVs with the result of this new algorithm.

    Hey giant YahooFinance! You can license my algorithm to fix the tons of buggy and/or missing IVs in your data... :)
     
    Last edited: Nov 16, 2021
    #27     Nov 16, 2021
  8. traider

    traider

    Is the fair put production ready ? My investors are getting impatient. They have been punting on RIVN while waiting for your breakthrough.
     
    #28     Nov 16, 2021
  9. newwurldmn

    newwurldmn

    goldman started quoting them this year. There was a well known poster here who worked there and has since disappeared. I think he stole the idea from thecoder.
     
    #29     Nov 16, 2021
  10. thecoder

    thecoder

    traider, FairPut is not for sale. It'll first be tested in virtual environment (ie. an exchange). It's private, not public yet.
    You can stop with your silly jokes about it.
     
    Last edited: Nov 16, 2021
    #30     Nov 16, 2021