I've been looking at betfairlightweight (gee it's excellent). With the following example, I am getting the following error "print(place_orders.status)
AttributeError: 'dict' object has no attribute 'status'". When I comment that out, the "for order in place_orders.place_instruction_reports" produces the error also. The order is executed. Could someone please tell me where I have gone wrong thanks.
def place_order(selection_id,market_id):
global trading
# placing an order
limit_order = filters.limit_order(size=2.00, price=1.01, persistence_type="LAPSE")
instruction = filters.place_instruction(
order_type="LIMIT",
selection_id=selection_id,
side="LAY",
limit_order=limit_order,
)
place_orders = trading.betting.place_orders(
market_id=market_id, instructions=[instruction] # list
)
print(place_orders.status)
for order in place_orders.place_instruction_reports:
print(
"Status: %s, BetId: %s, Average Price Matched: %s "
% (order.status, order.bet_id, order.average_price_matched)
)
AttributeError: 'dict' object has no attribute 'status'". When I comment that out, the "for order in place_orders.place_instruction_reports" produces the error also. The order is executed. Could someone please tell me where I have gone wrong thanks.
def place_order(selection_id,market_id):
global trading
# placing an order
limit_order = filters.limit_order(size=2.00, price=1.01, persistence_type="LAPSE")
instruction = filters.place_instruction(
order_type="LIMIT",
selection_id=selection_id,
side="LAY",
limit_order=limit_order,
)
place_orders = trading.betting.place_orders(
market_id=market_id, instructions=[instruction] # list
)
print(place_orders.status)
for order in place_orders.place_instruction_reports:
print(
"Status: %s, BetId: %s, Average Price Matched: %s "
% (order.status, order.bet_id, order.average_price_matched)
)


Comment