# Event Contract Combo RFQ

request_combo_quotes(combo_leg_list, mvc)

  • Description

    Submit the user-combined contract legs (a ComboLeg list) together with the MVC security to request a quote (RFQ) for the combo contract, returning the bid/ask price and the quote ID (used when placing an order).

  • Parameters

    Parameter Type Description
    combo_leg_list ComboLeg Leg list; each element must be a ComboLeg object, non-empty
    mvc str MVC security, passed through from the return value of get_valid_combo_list
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data dict When ret == RET_OK, returns the RFQ result
    str When ret != RET_OK, returns the error description
  • Example

from moomoo import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)

# 1. First get the Combo-able events and mvc
ret, combo_data, mvc, _ = quote_ctx.get_valid_combo_list(category='Sports', count=1)
if ret != RET_OK:
    print('Failed to get combo list:', combo_data)
    quote_ctx.close()
    exit()

# 2. Build the legs and request a quote (the two legs can come from different events; pred_side is required)
leg1 = ComboLeg()
leg1.code = 'EC.KXWCADVANCE-26JUL14FRAESP-FRA'
leg1.trd_side = TrdSide.BUY
leg1.qty_ratio = 1
leg1.pred_side = PredSide.YES

leg2 = ComboLeg()
leg2.code = 'EC.KXWCADVANCE-26JUL15ENGARG-ENG'
leg2.trd_side = TrdSide.BUY
leg2.qty_ratio = 1
leg2.pred_side = PredSide.YES

ret, data = quote_ctx.request_combo_quotes([leg1, leg2], mvc)
if ret == RET_OK:
    print('bid:', data['bid_price'], 'ask:', data['ask_price'])
    print('quote_id:', data['quote_id'])
    print('should_retry:', data['should_retry'])
    for leg in data['combo_leg_list']:
        print('  leg:', repr(leg))
else:
    print('error:', data)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
  • Output
bid: N/A ask: 0.333
quote_id: 3fb44348-83e6-4179-a34a-efb09d7b80e6
should_retry: N/A
  leg: ComboLeg(code=EC.KXWCADVANCE-26JUL14FRAESP-FRA, trd_side=BUY, qty_ratio=1.0, pred_side=YES)
  leg: ComboLeg(code=EC.KXWCADVANCE-26JUL15ENGARG-ENG, trd_side=BUY, qty_ratio=1.0, pred_side=YES)
1
2
3
4
5

Interface Limitations

  • A maximum of 15 requests can be made to the Event Contract Combo RFQ interface every 30 seconds