availableToBack / availableToLay vaules

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hendrixback
    Junior Member
    • Jan 2015
    • 10

    #1

    availableToBack / availableToLay vaules

    Hello I use the following function to print the availableToBack and availableToLay prices. But I just can print 3 of each (like in the website). How can I extend this? Some applications have much more intervals and available money to trade. Thank you

    function printRunnerInfo ($selectionId, $marketBook) {

    foreach ($marketBook->runners as $runner)
    if ($runner->selectionId == $selectionId) break;

    echo "<br>Available to Back: \n";
    foreach ($runner->ex->availableToBack as $availableToBack)
    echo $availableToBack->size . "@" . $availableToBack->price . " | ";

    echo "<br>Available to Lay: \n";
    foreach ($runner->ex->availableToLay as $availableToLay)
    echo $availableToLay->size . "@" . $availableToLay->price . " | ";

    }
  • jabe
    Senior Member
    • Dec 2014
    • 705

    #2
    On your listMarketBook call, you should specify EX_ALL_OFFERS in your priceProjection parameters rather than EX_BEST_OFFERS. I believe. You might (or might not) want to check out the stuff about virtualizing bets in the documentation.

    Comment

    • hendrixback
      Junior Member
      • Jan 2015
      • 10

      #3
      Thank you for you answer.

      My getMarketBook function is:

      function getMarketBook($appKey, $sessionToken, $marketId)
      {
      $params = '{"marketIds":["' . $marketId . '"], "priceProjection":{"priceData":["EX_ALL_OFFERS"], "virtualise":"true"}}';

      $jsonResponse = sportsApingRequest($appKey, $sessionToken, 'listMarketBook', $params);

      return $jsonResponse[0]->result[0];
      }

      I am using EX_ALL_OFFERS and virtualise = TRUE.

      But I can only see the 3:

      Output:

      Available to Back: 11.66@4.7 | 172.51@4.6 | 498.91@4.5 |
      Available to Lay: 136.98@4.8 | 70.93@4.9 | 134.62@5 |

      Any idea how can I get all?

      Comment

      • LiamP
        Junior Member
        • Oct 2015
        • 284

        #4
        Originally posted by hendrixback View Post
        Thank you for you answer.

        My getMarketBook function is:

        function getMarketBook($appKey, $sessionToken, $marketId)
        {
        $params = '{"marketIds":["' . $marketId . '"], "priceProjection":{"priceData":["EX_ALL_OFFERS"], "virtualise":"true"}}';

        $jsonResponse = sportsApingRequest($appKey, $sessionToken, 'listMarketBook', $params);

        return $jsonResponse[0]->result[0];
        }

        I am using EX_ALL_OFFERS and virtualise = TRUE.

        But I can only see the 3:

        Output:

        Available to Back: 11.66@4.7 | 172.51@4.6 | 498.91@4.5 |
        Available to Lay: 136.98@4.8 | 70.93@4.9 | 134.62@5 |

        Any idea how can I get all?
        Remove virtualise, fairly sure betfair limit it to the top 3 prices.

        Comment

        Working...
        X