Online strategy p&l calculator

Discussion in 'Options' started by Wisard, Nov 16, 2014.

  1. Nice URL! Can you clarify what the 4 graphs in the "Volatility smile" represent? (I know they are Implied Volatility VS Strike) 2 are Red and 2 are Green. I'm guessing the Green are Calls and the Red are PUTs, but unclear why there are two of each, unless computed from differing models.
     
    #11     Sep 7, 2015
    Wisard likes this.
  2. Wisard

    Wisard

    Hi, @stepandfetchit, thanks for pointing out! I've accidentally removed some of the descriptions, now they are restored. As for your question: yes, green are calls and red are puts. Two graphs of the same colour represent simply bid and ask prices. Glad to help you. Cheers!
     
    #12     Sep 8, 2015

  3. I have had a brief look at the p&l calculator and I don't get it. Perhaps you could provided a demo on what it would be used for.




    :)
     
    #13     Sep 8, 2015
  4. Wisard

    Wisard

    Ok, here's an example for pnl page:

    Screen Shot 2015-09-09 at 10.28.18.png
    1. Enter a ticker and request quotes (either by hitting enter or clicking the button) -> the form will become disabled while loading. If provider answers that it doesn't know such a ticker, the input field will become red. If everything's fine, other parts of the page will be revealed: "Underlying chart" (orange) and "Risk profile" (green).



    Screen Shot 2015-09-09 at 10.24.52.png
    2. Use the plus button to add legs to your strategy. Apply your desired what-if scenarios. Every parameter can be changed at any time and the chart below will reflect the changes instantly.



    Screen Shot 2015-09-09 at 10.22.29.png
    3. Look at the chart and repeat step 2 until you satisfied with the builded strategy. Go to your trading terminal and execute it (be aware that yahoo and google both provide delayed quotes, so the actual prices may be a little different).



    Screen Shot 2015-09-09 at 10.43.49.png
    4. For your convenience, pnl calculation can be tweaked by this form. Yuo can alter both price span and calculation step (in dollars).



    P.S. I've detected many problems on the step 1 of this demo (people just get stuck here because nothing happens for a long time after clicking the button). It takes time to request quotes from the provider, but for me it rarely exceeds 1-2 seconds. I'll try to figure out what happens and fix it, at least I'll create a more obvious "loading..." label than just disabling the "request" button. Stay tuned, guys, I'm working on it.

    P.P.S. I always test my app in google chrome and sometimes in mozilla firefox, so it would be better if you use the same browser (another one should also work though).
     
    #14     Sep 9, 2015
  5. Wisard

    Wisard

    Hi, ladies and gents!
    I'm pleased to announce some nice improvements of my options toolbox:
    1. Ability to specify deal prices apart from the market prices to see the actual PnL (not zero-adjusted as it was before).
    2. Now strategies, whatifs and chart parameters for every underlying stock are automatically saved in the local storage of your browser, so you can easily track complex multiple asset positions.
    3. Added a refresh button to update market prices for every leg in your position at once (of course this happens automatically when your strategy is initially loaded).
    4. Minor UI/UX fixes, e.g. axis and hover labels on charts became bigger as @badlucktrades suggested.
    Hope you like it.
     
    #15     Dec 5, 2015
    MatijaSh likes this.
  6. Wisard

    Wisard

    A few pictures:

    Screen Shot 2015-12-05 at 18.01.31.png Screen Shot 2015-12-05 at 18.01.38.png
     
    #16     Dec 5, 2015
    Martinsos likes this.
  7. xandman

    xandman

    Great Job. If you wan't to really attract attention, find a way to facilitate Futures options calcs with their different tick values/contract specs.

    None have implemented it, not even the exchanges who I have written to. I suspect there are major computational hurdles.
     
    #17     Dec 5, 2015
  8. Wisard

    Wisard

    Hi, @xandman , thanks for the suggestion. Currently, I don't trade futures as they are too expensive for me yet, but I'll keep it in mind. I totally need some rest after the bunch of really huge updates to the site. Here is the new portion:

    Screen Shot 2015-12-22 at 03.44.33.png
    1. Realtime data stream directly from the IB Gateway or TWS. Used automatically when available (additional open-sourced software required). Yahoo and Google are still there as delayed fallback options.
    2. Midpoint price, extrinsic value, implied volatility, greeks, -- all this data does also come from the IB terminal or calculated locally. For every leg and for the whole position too.
    3. Showed level1 quotes: price and size for both bid and ask. There are also last, close and model quotes, but they are used internally.
    4. As they were before, your positions are automatically saved in your browser. This update required really huge modifications, among them was also a significant data scheme change, so I need to clean up all the old data, sorry about that.
    5. Deal sizes became consistent with level1 quotes, so all of them are now in lots, not in shares. I added an ability to use odd lots, though.
    6. Fully customizable chart is still there as usual. Now it gets updated on every quote change, it can be very frequent sometimes, so I added a button to turn this off and on (floppy disk icon is strange, I know.. but it was the best option I found in already loaded icons).
    7. I suppose the site starts to demand a better thought design as it grows.. Maybe this is what the next major update will be about.
     
    #18     Dec 21, 2015
    guidoisot and xandman like this.
  9. xandman

    xandman

    Very impressive. It may have been asked before, but can you talk a little about what languages and libraries you are using to program all this?
     
    #19     Dec 21, 2015
  10. Wisard

    Wisard

    Everything is coded entirely in javascript. Both backends (main site and quotes streamer) utilize node.js framework, and frontend is built on top of the angular.js framework. Here are some details about the most important components:
    1. Main site:
      1. Backend. HTTP interface on top of express.js. The main goal is to get quotes from the sources and send them back to a client upon request. Generally speaking, the server just opens a corresponding page at Google or Yahoo, parses it and sends back the raw quotes in JSON format.
      2. Frontend. Charts are interactive thanks to the d3 library. Black-Scholes model calculations are performed with the help of my own lib. Portfolio and additional data are stored in browser's local storage. Realtime quotes and communication with the local backend are performed using socket.io.
    2. Quotes streamer:
      1. Backend only. Communicates with local IB Gateway/TWS with a pure socket connection, thanks to the node-ib library. Communicates with the main site's frontend with a socket.io connection. All the data transferred between them are local to your computer and doesn't leave it in either way.
     
    #20     Dec 22, 2015
    xandman likes this.