Historical Bid Ask

Forums ProRealTime English forum ProBuilder support Historical Bid Ask

Viewing 12 posts - 1 through 12 (of 12 total)
  • #227968

    I have a IBKR + PRT account. Is it possible to access historical bid/ask for FX so I can make an indicator in a panel that shows this?



    I would say No … based on the fact that we cannot even access current bid ask values via code.

    Happy to be corrected by anyone? 🙂

    1 user thanked author for this post.

    True, what GraHal says, but maybe you can receive this data via IBKR’s API…

    1 user thanked author for this post.

    OK. I thought so. Thanks. I am learning Python to access IBKR API data feed. Hopefully will get there soon..

    1 user thanked author for this post.
    avatar JS

    @gadetrading – Yes, within TWS / Trader WorkStation you can see them and act upon them graphically. You will see your own bid etc. and creeping up Asks, especially when in quiet pre-trading hours (like at this moment, 13:30 your time).

    Their API should provide it, although I don’t know for real. What I do seem to know is that working out all via the IBKR API is more than a hassle, probably not worth it. Of course this is personal opinion (from experience).
    You do know about the groups.io group  for the TWS API ?


    An other answer would be this :

    Yes you can see that in PRT too, but I don’t recognize that really as “tradeable”. Maybe I never tried really, but in TWS I used it for sure. One additional thing : I said “pre-market” which does not make much sense for Fx (IMO). Or maybe … maybe what you see in PRT for this indicator is just what you want.

    Also please see the 2nd picture below, which is the help-balloon for the Bid/Ask band (zone) indicator, which talks about two other possibilities. I am not sure any more whether you need to pay for both (more difficult to check for me as I pay for them so I have them available anyway. The thing to obtain would be the subscription to the orderbook (which is buried very deep in the ProRealTime pages – not the normal subscription but as a plug-in) and I recall that the indicator “Orderbook Volume on Price” is slipstreamed with it.
    What I showed in the first picture is available by standard.



    1 user thanked author for this post.

    I didn’t know about the grous.io forum. I will definitely look into it. Thanks for that 🙂

    Can I ask why have you found it to be a hassle to work with the TWS Api?


    Hi Andreas,

    It is not the API as such, but all the things you need to arrange for. First example would be “history”. Okay, you would need that if you’d want to backtest in one or the other form. But anyway you would need to build that yourself (which means waiting for your own collection for a year or so – one month or is there for you by standard). Maybe (by now) people provide this history. Or it can be bought ?
    I am not sure whether all can be done via Python. But keep in mind that it could be via Excel only. In C++ you can do all yourself for sure.

    All you do for orders must be done by yourself. In itself this is fun, but it may take you a month to control that alone. So then you can make orders and exit them (via an exchange of choice). Increase position is in another kind of league. This relates to some extent to IB having dozens of order types. But see the order form in TWS.

    You’d need to deal with IB outages (like each morning 06:30). In itself this would be better than leaving it to PRT (my opinion and for me). But you’d *need* to deal with it.
    That TWS needs to be up and running during your automatic trading is just a known fact, and in itself not special (but for PRT this is not needed).

    The fun could be that the orders you create via the API, also appear in PRT (assumed you have a PRT subscription).
    The fun is of course also that you can make everything yourself.


    1 user thanked author for this post.

    I worked several years with the IB API using Java, and I can confirm it’s a big hassle. It has a very steep initial learning curve, you have to deeply read a lot of documentation and familiarize with the way it is internally designed and how it works. It has parallel architecture and require multi-threading programming. It’s complicated, if you’re not an experienced programmer.

    But, if you manage to see the light, it’s very powerful and you can do all sort of things, and also use it in creative ways to make it even more powerful.

    Also it requires frequent maintainance, you need to keep the TWS or the Gateway open, and be prepared to change your code when a new TWS version breaks something or when there is an API version update.

    If you go through this path, you must download and store specific TWS versions, so if/when something breaks after a new TWS version, you can install and use your stored version, and therefore have time to fix without interruptions.

    1 user thanked author for this post.

    I appreciate the replies 🙂

    It sounds like the API is a bit of challenge. Unfortunately, I am not an experienced programmer but I train every day. For now, my goal is simply to extract some historical OHLC data using the API and then analyze this data with Python in different ways. There is a 13 hour course for the IBKR API using Python on Udemy, so hopefully it can help me overcome the major hassles. For anyone reading this and interested, here is the link: Algorithmic Trading using Interactive Broker’s Python API | Udemy

    I also see that SAXO (PRT also has SAXO offer) has multiple API’s: API | Saxo Advanced Solutions | Saxo Group (home.saxo)  Perhaps they are better.


    Hi again Andreas,

    Someone else would need to confirm, but I don’t think that Saxo ever became a real partner to PRT. At least AutoTrading never lifted off with them, and otherwise … too expensive. And also uncommon. IBKR is not uncommon at all (better for your CV – haha).

    Your Python project would be perfect for the retrieval and analysis of historical data.
    A small hint of which I don’t know where that would lead to : Try DevExpress for the framework. This is not trading oriënted per se, but it contains explicit controls for trading (including a Demo project). They have controls for Python as well. The disadvantage ? it is HUGE. But you would be in the .Net (8) environment – all modern.
    It is not free and may be beyond your budget, but if I am well informed you can arrange things with them (for students, I mean). Just ask them.


    OK. I’m sticking with IBKR API for now.

    Thanks for the tip about DevExpress. I’ll have a look.

Viewing 12 posts - 1 through 12 (of 12 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login