Skip to content

Commit

Permalink
clean up to marketbook/runnerbook when requesting orders
Browse files Browse the repository at this point in the history
fixes #83
  • Loading branch information
liampauling committed May 23, 2017
1 parent 77becc8 commit 29a6c1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion betfairlightweight/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from . import filters

__title__ = 'betfairlightweight'
__version__ = '1.1.8'
__version__ = '1.1.9'
__author__ = 'Liam Pauling'

# Set default logging handler to avoid "No handler found" warnings.
Expand Down
10 changes: 7 additions & 3 deletions betfairlightweight/resources/bettingresources.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,8 @@ class RunnerBookOrder(object):
"""

def __init__(self, betId, avgPriceMatched, bspLiability, orderType, persistenceType, placedDate, price, side,
sizeCancelled, sizeLapsed, sizeMatched, sizeRemaining, sizeVoided, status, size):
sizeCancelled, sizeLapsed, sizeMatched, sizeRemaining, sizeVoided, status, size,
customerStrategyRef=None, customerOrderRef=None):
self.bet_id = betId
self.avg_price_matched = avgPriceMatched
self.bsp_liability = bspLiability
Expand All @@ -329,6 +330,8 @@ def __init__(self, betId, avgPriceMatched, bspLiability, orderType, persistenceT
self.size_voided = sizeVoided
self.status = status
self.size = size
self.customer_strategy_ref = customerStrategyRef
self.customer_order_ref = customerOrderRef


class RunnerBookMatch(object):
Expand All @@ -341,7 +344,7 @@ class RunnerBookMatch(object):
:type size: float
"""

def __init__(self, betId, matchId, price, side, size, matchDate):
def __init__(self, price, side, size, betId=None, matchId=None, matchDate=None):
self.bet_id = betId
self.match_id = matchId
self.price = price
Expand All @@ -366,7 +369,7 @@ class RunnerBook(object):
"""

def __init__(self, selectionId, status, handicap, adjustmentFactor=None, lastPriceTraded=None, totalMatched=None,
removalDate=None, sp=None, ex=None, orders=None, matches=None):
removalDate=None, sp=None, ex=None, orders=None, matches=None, matchesByStrategy=None):
self.selection_id = selectionId
self.status = status
self.total_matched = totalMatched
Expand All @@ -378,6 +381,7 @@ def __init__(self, selectionId, status, handicap, adjustmentFactor=None, lastPri
self.ex = RunnerBookEX(**ex) if ex else None
self.orders = [RunnerBookOrder(**i) for i in orders] if orders else []
self.matches = [RunnerBookMatch(**i) for i in matches] if matches else []
self.matches_by_strategy = matchesByStrategy

def __str__(self):
return 'RunnerBook: %s' % self.selection_id
Expand Down

0 comments on commit 29a6c1d

Please sign in to comment.