1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

BBpricer - a tool for M3 and Bearish Butterfly traders

Discussion in 'Options' started by uwe, Apr 13, 2015.

  1. uwe

    uwe Well-Known Member

    I'm trading the Bearish Butterfly (and occasionally the M3). Usually I calculated the mid price for the Butterfly combination by hand (from the mid price of the 3 strike prices). But in one of his weekly videos John Locke talked about not only doing this for the Put Butterfly, but also for the Call and Iron Butterfly. This was too much "by hand" and I started writing a small tool that connects to IB TWS API and does the calculation.

    Today I released the first version. It is free to use and you may download it at http://www.BBpricer.com/.

    It is a console program and I think especially for Windows users this is a little bit rough. I assume with a batch file one could also start it via desktop. But I'm not much of a Windows user. So I welcome any suggestions to make usage easier.

    Also, if you find any bugs, please reply here or email me (see web page).

    PS: Tom, if this announcement is not okay (I'm mentioning an URL) - please feel free to delete this post or the link.

    I also trade broken-wing butterflies and BBpricer's interface was not flexible enough to handle them. Over the last months I have written a new software, which is more flexible: https://www.option-poption.com/.
    Last edited: Jun 8, 2016
    Bhaskar likes this.
  2. Georges

    Georges Well-Known Member


    Search on Interactivebrokers site for ""API DDE"
    You got "Getting Started with the DDE for Excel API"
    This can be a solution.

    I don't used it anymore. (was years ago).
    It was possible to download a file TwsDde.xls
    In this file create lines with the options bid-ask prices you need.

    Create your own second excel file (example: myspreads.xls)
    in myspreads.xls create your Call Butterfly, Put Butterfly , Iron Butterfly ... .
    Copy the bid-ask prices from TwsDde.xls and past the link into myspreads.xls.
    myspreads.xls can calculate the mid prices for the spreads.

    I wasn't a API specialist, but was able to do it.

    I don't know if you are using IB broker quotes in Optionvue,
    if it is possible at the same time to use TwsDde.xls without a problem.
    Never try it.
    Last edited: Apr 14, 2015
  3. uwe

    uwe Well-Known Member

    Thanks, Georges, for your suggestion. That is like another approach to reach the same goal. BBpricer does work on Windows, it is just not so convenient as other GUI programs.

    I'm using OptionVue with IB broker quotes. Both work at the same time, but OptionVue is very unreliable with IB (also without BBpricer).
  4. Georges

    Georges Well-Known Member

    To clarify.
    I never try, OptionVue with IB broker quotes AND Ib quotes in TwsDde.xls at the same time.
    I used Backtrader in Optionvue AND Ib quotes in TwsDde.xls at the same time.

    I use OptionVue with IB broker quotes AND not TwsDde.xls.

    I understood.
    uwe is using OptionVue with IB broker quotes AND BBpricer at the same time.
  5. uwe

    uwe Well-Known Member

    It happened now the second time that I got an email with a reply and when I go to the forum the reply is gone.

    @Vijay did you just delete your post or was it somebody/something else?
  6. Vijay

    Vijay Member

    Yes. I did delete the post because I am now getting the data after second try:

    RUT - 20150618 - 1250.00 (Calls 78.05, 41.70, 15.15, Puts 16.25, 29.60, 53.20)
    Call BF: 9.80
    Put BF: 10.25
    Iron BF: 10.10
    Rev. BF: 9.95


    Just want to point out that you need to put to your "Trusted IP Addresses".
    Last edited: Apr 14, 2015
  7. uwe

    uwe Well-Known Member

    Ok, thanks. So the forum is working correctly.

    I have seen this already from another user. If one of the prices is not available, the whole calculation goes nuts.
    If this happens repeatedly, you can start "bbpricer --dump" - this will output all API communication to IB. Please send me this output, so that I can further debug it. (My email address is on the BBpricer website.)
  8. uwe

    uwe Well-Known Member

    If you exprience something similar, try to change the API client id that BBpricer is using. The default is 1 - which was maybe a bad choice. Just put this line into bb.conf:
    CLIENT = 17
    In the next version I will use 17 as default. Hope that helps.

    Thanks Vijay for reporting and helpful debugging outputs.
  9. uwe

    uwe Well-Known Member

    I uploaded a new version which fixes a few bugs:
    • hard coded strike width (50)
    • changed default Client ID (now 17)
    • fixed spelling of -frozen parameter
    I'm working on a completely new version, with strike selection and IV skew. I'm looking for two to three alpha testers. Please contact me, if you are interested (email is on the web site - first post).
  10. uwe

    uwe Well-Known Member

    Big changes!

    I completely redesigned BBpricer. It is now browser-based (but still needs a local program running for the quotes). The butterfly prices are continously updated in real-time. No need to re-run it again and again. Also, no more config file needed.

    Please download the new version (v0.1.1) from the web site: http://www.bbpricer.com/

    Please report problems/questions here or send me an email (see web site).
  11. RayM

    RayM Well-Known Member

    Just to be clear (perhaps I am mis-reading the site), this solution does NOT work for TOS users...correct ?
  12. uwe

    uwe Well-Known Member

    Yes, Ray. You have to be a customer of InteractiveBrokers. BBpricer uses the TWS API.
  13. Thetaseeker

    Thetaseeker Member

    I have also had bad experiences with RUT fills. When you need to get in or out fast, sometimes its a big problem. This problem likely was exacerbated when the exchange was consolidated (bought out) as it use to be traded on 5 or 6 exchanges, now mainly on one or two. To see how badly they are trying to treat you, i like the suggestions above but also in TOS, just switch from buy to Sell and see the mid-natural prices vary. The spread they are trying to make is very large, it seemed to be much smaller a few years ago! :(

    I have heard that Tony or some other members sometimes use ES. I have heard that Karen the super trader also uses ES because of problems getting consistent good fills on the SPX. Has anyone tried to use ES? If so what are the experiences like, and do you know if they are cash settled?
  14. ACS

    ACS Well-Known Member

    The Russell company took the options away from the ISE a few years ago and you can see the difference. They did the same thing with the Russell futures several years ago taking them off Globex and making an exclusive deal with ICE. I guess they don't believe competition is good for their products. You can complain here:
  15. fieldydwb

    fieldydwb New Member

    Very useful. Thanks for putting this out there.
  16. Capt Hobbes

    Capt Hobbes Well-Known Member

    Ray, if you are an Excel user, I'll be happy to share the butterfly pricer I made in Excel which works with TOS data.
    Stephen likes this.
  17. Stephen

    Stephen Member

    Capt- Pls do share.
  18. RayM

    RayM Well-Known Member

    Sent you a private message
  19. Capt Hobbes

    Capt Hobbes Well-Known Member

    OK, here it is - zipped because the forum doesn't like the .xlsm extension. Uwe, I hope you are ok with me posting it here. If not, let me know and I'll move it. Some notes:
    1. Excel will consider this as a file with macros and will by default disable them and show a security warning. You are welcome to (and perhaps always should under similar circumstances) inspect the code by hitting Alt+F11 to open a VBA editor to verify there's nothing funny. In this case the code is a single trivial function constructing a TOS option code from the underlying symbol and other parameters. Macros should be enabled in this spreadsheet for everything to work. Of course, TOS should also be running and connected.
    2. The contents are hopefully clear. Enter the options expiry date and the center strike of the top butterfly (typically the strike just above the market) you are interested in at the top. The spreadsheet will show five flies from that strike down in 10-point steps. There are two Mid Price columns for iron butterflies. The first (negative) is the actual price (credit). The second marked as "(Iron)" is the equivalent debit, for ease of comparison with the debit flies. The Upper/Lower IV Skew columns are the ratio of IV at the upper/lower wing strike to the IV at the center.
    3. If you change the parameters after the market close when the data is not updating, you may see lines with empty cells and errors. This seems to be the data link "feature". Simply save, close, and reopen the spreadsheet and it will pull the correct EOD data.
    The overall organization is inspired by Kevin Lee's input in the M3 thread a while ago. Thanks for sharing your experience, Kevin!

    Attached Files:

    Andrei, Bill C, Jay Hattler and 2 others like this.
  20. RayM

    RayM Well-Known Member

    Very nice and clean. Thank you for sharing your work.

    Some of possible enhancements:
    >>> The Upper/Lower IV Skew columns are the ratio of IV at the upper/lower wing strike to the IV at the center.
    Perhaps also consider the IV Skew of the SPOT to the upper/lower LONG strikes.

    Consider also displaying the current price of the RUT & RVX

    Consider also displaying the Butterfly Wing Width being considered (e.g. [50,50])
    Heavier lift ideas, allow this to be a user input.

    Finally, (for now), consider making RUT/RVX swappable with SPX/VIX as a user input.

Share This Page