want to code a custom tws mosaic option scanner how ?

Discussion in 'Interactive Brokers' started by theakson, Jan 16, 2020.

  1. theakson

    theakson

    Hi all
    starting with mosaic and looking at option scanner. We sometimes like to look at different durations of historical volatility and can't seem to find the code area to build this custom feature. So in Thinkorswim we could use thinkscript to easily code for 100 day in one column and 50 days in another just by changing a few values.

    Can anyone point us at where to read about the code aspect of IB's TWS mosaic specific to the TWS OPTIONS SCANNER.

    thank you.
     
  2. If I understand correctly, you can't customize the mosaic scanners beyond what they allow you though it does have lagging volatility for various time periods.
     
  3. theakson

    theakson

    first of all EXCELLENT user name! love it.
    second thanks for the reply
    third I feared as much. It's not a huge one as I can code it using python but REALLY wanted to have the same thing going we had in Thinkorswim where the thinkscript was pretty ok.
    thanks again

    ps we are TRYING to get IB to offer up their REST API to retail with NO need to run a gateway just using OA tokens. We do this because we want to use IB and Julia language. If anyone else want to email them that would really be great
     
  4. What a polite forum member, I can learn a lot from you! Yep exactly, you can do the post-filtering in Python. That's what I do.
     
    theakson likes this.
  5. tommcginnis

    tommcginnis

    Forgive my laziness, but if there is an API for Mosaic, it's news to me.
     
  6. theakson

    theakson

    The api I am referring to is the IB API for coding against. Can't speak to mosaic specifically but all we do is start up a tws session and run the python code against it. I suppose we could use the gateway but I wanted to see the scanners. The REST API ( when they remove the need for a gateway and switch to tokens ala IEX ) will negate the need for the TWS/Gateway and allow us to code in Julia directly as opposed to calling a 2nd language to get at the api.
     
  7. theakson

    theakson

    No point in being impolite and you were kind enough to help me. I'm still laughing about your user name, really a GREAT choice.
     
  8. There's no API for mosaic but you can define scanners through the API and post-filter in Python, that's what I was referring to.
     
  9. xbv8

    xbv8

    Hi,

    I know this thread is almost 2 years old but I thought I would add my experience with this and ask a question too.

    I'm using Python to connect to the gateway (or sometimes the lite version - I forget what it's called but it's basically only for API use). While IBRK is good in many areas, what was lacking for me in mosaic or the advanced scanner, was something as simple as short term (3, 5, etc min) change in option volume / oi.

    Perhaps I'm mistaken and if so, would love to be corrected.

    Anyway I resorted to using Python with the IB-insync library to do this for maybe 100 different contracts. The library has a good example using streaming data in a pyqt GUI, which I built off. In a way it's ok, but I really wish I could do this using the built in scanners :(

    Re your point about a rest API - I'm curious why the current API is an issue (sincere question)? Is it becauss they don't have libraries in Julia?