How to detect a price change?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • newbie99
    Junior Member
    • Dec 2018
    • 62

    #1

    How to detect a price change?

    This feels like it should be something simplistic, but I can't see an obvious way to do it!

    When I call listMarketBook I can get prices back, however there is no timestamp for the price, so I can't say whether the price has changed since I last refreshed.

    Is there an obvious way to do this, or alternatively what approach do most people take? I presume the logical process is to create a database, then:

    1) Download prices on each refresh (e.g. call listMarketBook for the desired market)
    2) Compare prices from the most recent download to the previous one
    3) If the change in price meets desired criteria, place bet

    I would be very curious to know what approach people have taken, as it seems a bit odd to me not to include a timestamp and make this very simple (so I'm wondering if I'm just missing something really obvious)!
  • LetsGo
    Senior Member
    • Oct 2018
    • 112

    #2
    If you want to find out what is happening in the market you have to compare the current market book with the previous market book.
    There can be many changes in price and amount available and also the total amount matched.

    Comment

    • newbie99
      Junior Member
      • Dec 2018
      • 62

      #3
      Originally posted by LetsGo View Post
      If you want to find out what is happening in the market you have to compare the current market book with the previous market book.
      There can be many changes in price and amount available and also the total amount matched.
      Ah, okay yep that makes sense, I was just hoping for a simple way by timestamp (so if you haven't previously called the market book you could see there had been a recent change). But from what you're saying, it sounds like thats not possible?

      Comment

      • LiamP
        Junior Member
        • Oct 2015
        • 284

        #4
        Just use streaming, you then know there has been a change.

        Comment

        • newbie99
          Junior Member
          • Dec 2018
          • 62

          #5
          Originally posted by LiamP View Post
          Just use streaming, you then know there has been a change.
          Ah...I have not progressed that far yet! Will have a look at streaming....which logically does make sense now that you mention it!

          Comment

          • jabe
            Senior Member
            • Dec 2014
            • 705

            #6
            The returned data for listMarketBook includes a version number. That might be what you want.

            Comment

            • newbie99
              Junior Member
              • Dec 2018
              • 62

              #7
              Originally posted by jabe View Post
              The returned data for listMarketBook includes a version number. That might be what you want.
              That's quite interesting actually, from what I can see the version doesn't update on every refresh. I'm going to presume it therefore only changes when one or more updates have occurred since the last version. If that's the case, then it could help, as I can then loop through the prices if the version is different and find any changes.

              That said I still need to look into streaming, but short term, this could help (if I've understood how it works correctly)?

              Comment

              Working...
              X