# Get Valid Spread

get_option_strategy_spread(code, option_strategy, expire_time, far_expire_time=None, index_option_type=IndexOptionType.NORMAL)

  • Description

    Get the list of valid spreads for the specified option strategy under the current underlying and expiration date.

  • Parameters

    Parameter Type Description
    code str Underlying stock code
    option_strategy OptionStrategyType Option strategy type
    expire_time str Expiration date
    far_expire_time str Far expiration date
    index_option_type IndexOptionType Index option type
    • option_strategy only supports Spread, Strangle, Collar, Butterfly, Condor, IronButterfly, IronCondor, and DiagonalSpread.
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns valid spread list
    str When ret != RET_OK, returns error description
    • DataFrame fields:

      Field Type Description
      spread float Valid spread
  • Example

from futu import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret,data = quote_ctx.get_option_strategy_spread(code='HK.00700', option_strategy=OptionStrategyType.STRANGLE)
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close() # Remember to close the connection to avoid exhausting connection quota
1
2
3
4
5
6
7
8
9
  • Output
    spread
0     10.0
1     20.0
2     30.0
3     40.0
4     50.0
5     60.0
6     70.0
7     80.0
8     90.0
9    100.0
10   110.0
11   120.0
12   130.0
13   140.0
14   150.0
15   160.0
16   170.0
17   180.0
18   190.0
19   200.0
20   210.0
21   220.0
22   230.0
23   240.0
24   250.0
25   260.0
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

API Restrictions

  • Maximum 30 requests per 30 seconds.