# Query Combo Order Tradable Info
- Python
- Proto
- C#
- Java
- C++
- JavaScript
comboorder_tradinginfo_query(combo_leg_list, price, qty, order_type=OrderType.NORMAL, order_id=None, trd_env=TrdEnv.REAL, acc_id=0, acc_index=0)
Description
Query tradable info for a combo order at the given price and quantity (e.g. margin and buying power changes). You can also pass an order ID to query tradable info for order modification.
Parameters
Parameter Type Description combo_leg_list list Combo leg list - Each element is a ComboLeg object; see the ComboLeg table in place_combo_order
price float Quoted price For auction or market orders, also provide a current price so the server can calculateqty float Quantity Combo quantity; actual quantity per leg is qty × that leg's qty_ratioorder_type OrderType Order type order_id str Order ID - Default None queries tradable info for a new order
- For order modification, pass server order ID orderIDEx to get related modifiable info
trd_env TrdEnv Trading environment acc_id int Trading account ID - Either acc_id or acc_index; acc_id is recommended
- When acc_id is 0, the account specified by acc_index is used
acc_index int Account index in the trading account list Defaults to 0, meaning the first trading accountReturn
Field Type Description ret RET_CODE Interface result. data pd.DataFrame If ret == RET_OK, tradable info is returned. str If ret != RET_OK, error description is returned. - Tradable info format as follows:
Field Type Description nlv_change float Net liquidation value change initial_margin_change float Initial margin change maintenance_margin_change float Maintenance margin change option_bp float Option buying power max_withdraw_change float Max withdrawable change bp_decrease float Buying power decrease
- Tradable info format as follows:
Example
from futu import *
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.US, host='127.0.0.1', port=11111, security_firm=SecurityFirm.FUTUSECURITIES)
leg1 = ComboLeg()
leg1.code = 'US.AAPL260529C302500'
leg1.trd_side = TrdSide.BUY
leg1.qty_ratio = 1
leg2 = ComboLeg()
leg2.code = 'US.AAPL'
leg2.trd_side = TrdSide.SELL
leg2.qty_ratio = 100
combo_legs = [leg1, leg2]
ret, data = trd_ctx.comboorder_tradinginfo_query(combo_legs, price=100, qty=1, order_type=OrderType.NORMAL, trd_env=TrdEnv.SIMULATE)
if ret == RET_OK:
print(data)
else:
print('comboorder_tradinginfo_query error: ', data)
trd_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- Output
nlv_change initial_margin_change maintenance_margin_change option_bp max_withdraw_change bp_decrease
0 ... ... ... ... ... ...
2
# Trd_GetComboMaxTrdQtys.proto
Description
Query max tradable quantity and related fund/margin changes for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
repeated Qot_Common.ComboLeg comboLegs = 2; //Combo leg information
required double qty = 4; //Quantity; actual quantity is qty * leg qty_ratio
optional double price = 5; //Price
required int32 orderType = 6; //Order type; see Trd_Common.OrderType enumeration definition
optional string orderIDEx = 7; //Order ID; used when modifying an order
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Return
message S2C
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2; //Combo max tradable quantity structure
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For protocol header, refer to TrdHeader
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
Protocol ID
2112
uint GetComboMaxTrdQtys(TrdGetComboMaxTrdQtys.Request req);
virtual void OnReply_GetComboMaxTrdQtys(FTAPI_Conn client, uint nSerialNo, TrdGetComboMaxTrdQtys.Response rsp);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Callback
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
public class Program : FTSPI_Trd, FTSPI_Conn {
FTAPI_Trd trd = new FTAPI_Trd();
public Program() {
trd.SetClientInfo("csharp", 1); //Set client info
trd.SetConnCallback(this); //Set connection callback
trd.SetTrdCallback(this); //Set trade callback
}
public void Start() {
trd.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(FTAPI_Conn client, long errCode, String desc)
{
Console.Write("Trd onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
TrdCommon.TrdHeader header = TrdCommon.TrdHeader.CreateBuilder()
.SetAccID(281756457888247915L)
.SetTrdEnv((int)TrdCommon.TrdEnv.TrdEnv_Simulate)
.SetTrdMarket((int)TrdCommon.TrdMarket.TrdMarket_US)
.Build();
QotCommon.ComboLeg leg1 = QotCommon.ComboLeg.CreateBuilder()
.SetSecurity(QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL260529C302500")
.Build())
.SetSide((int)TrdCommon.TrdSide.TrdSide_Buy)
.SetQtyRatio(1)
.Build();
QotCommon.ComboLeg leg2 = QotCommon.ComboLeg.CreateBuilder()
.SetSecurity(QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL")
.Build())
.SetSide((int)TrdCommon.TrdSide.TrdSide_Sell)
.SetQtyRatio(100)
.Build();
TrdGetComboMaxTrdQtys.C2S c2s = TrdGetComboMaxTrdQtys.C2S.CreateBuilder()
.SetHeader(header)
.AddComboLegs(leg1)
.AddComboLegs(leg2)
.SetQty(1)
.SetPrice(100)
.SetOrderType((int)TrdCommon.OrderType.OrderType_Normal)
.Build();
TrdGetComboMaxTrdQtys.Request req = TrdGetComboMaxTrdQtys.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = trd.GetComboMaxTrdQtys(req);
Console.Write("Send TrdGetComboMaxTrdQtys: {0}\n", seqNo);
}
public void OnDisconnect(FTAPI_Conn client, long errCode) {
Console.Write("Trd onDisConnect: {0}\n", errCode);
}
public void OnReply_GetComboMaxTrdQtys(FTAPI_Conn client, uint nSerialNo, TrdGetComboMaxTrdQtys.Response rsp)
{
Console.Write("Reply: TrdGetComboMaxTrdQtys: {0}\n", nSerialNo);
Console.Write("accID: {0}\n", rsp.S2C.Header.AccID);
}
public static void Main(String[] args) {
FTAPI.Init();
Program trd = new Program();
trd.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- Output
Trd onInitConnect: ret=0 desc= connID=6826812678028044696
Send TrdGetComboMaxTrdQtys: 3
Reply: TrdGetComboMaxTrdQtys: 3
accID: 281756457888247915
2
3
4
int getComboMaxTrdQtys(TrdGetComboMaxTrdQtys.Request req);
void onReply_GetComboMaxTrdQtys(FTAPI_Conn client, int nSerialNo, TrdGetComboMaxTrdQtys.Response rsp);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Callback
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
public class TrdDemo implements FTSPI_Trd, FTSPI_Conn {
FTAPI_Conn_Trd trd = new FTAPI_Conn_Trd();
public TrdDemo() {
trd.setClientInfo("javaclient", 1); //Set client info
trd.setConnSpi(this); //Set connection callback
trd.setTrdSpi(this); //Set trade callback
}
public void start() {
trd.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(FTAPI_Conn client, long errCode, String desc)
{
System.out.printf("Trd onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
TrdCommon.TrdHeader header = TrdCommon.TrdHeader.newBuilder()
.setAccID(281756457888247915L)
.setTrdEnv(TrdCommon.TrdEnv.TrdEnv_Simulate_VALUE)
.setTrdMarket(TrdCommon.TrdMarket.TrdMarket_US_VALUE)
.build();
QotCommon.ComboLeg leg1 = QotCommon.ComboLeg.newBuilder()
.setSecurity(QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL260529C302500")
.build())
.setSide(TrdCommon.TrdSide.TrdSide_Buy_VALUE)
.setQtyRatio(1)
.build();
QotCommon.ComboLeg leg2 = QotCommon.ComboLeg.newBuilder()
.setSecurity(QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL")
.build())
.setSide(TrdCommon.TrdSide.TrdSide_Sell_VALUE)
.setQtyRatio(100)
.build();
TrdGetComboMaxTrdQtys.C2S c2s = TrdGetComboMaxTrdQtys.C2S.newBuilder()
.setHeader(header)
.addComboLegs(leg1)
.addComboLegs(leg2)
.setQty(1)
.setPrice(100)
.setOrderType(TrdCommon.OrderType.OrderType_Normal_VALUE)
.build();
TrdGetComboMaxTrdQtys.Request req = TrdGetComboMaxTrdQtys.Request.newBuilder().setC2S(c2s).build();
int seqNo = trd.getComboMaxTrdQtys(req);
System.out.printf("Send TrdGetComboMaxTrdQtys: %d\n", seqNo);
}
@Override
public void onDisconnect(FTAPI_Conn client, long errCode) {
System.out.printf("Trd onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetComboMaxTrdQtys(FTAPI_Conn client, int nSerialNo, TrdGetComboMaxTrdQtys.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("TrdGetComboMaxTrdQtys failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive TrdGetComboMaxTrdQtys: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
FTAPI.init();
TrdDemo trd = new TrdDemo();
trd.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- Output
Send TrdGetComboMaxTrdQtys: 2
Receive TrdGetComboMaxTrdQtys: {
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"header": {
"trdEnv": 0,
"accID": "281756457888247915",
"trdMarket": 2
},
"maxTrdQtys": {
"nlvChange": -125.3,
"initialMarginChange": 320.0,
"maintenanceMarginChange": 300.0,
"optionBuyPower": 18600.0,
"maxWithDrawChange": -320.0,
"buyPowerDecrease": 410.0
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Futu::u32_t GetComboMaxTrdQtys(const Trd_GetComboMaxTrdQtys::Request &stReq);
virtual void OnReply_GetComboMaxTrdQtys(Futu::u32_t nSerialNo, const Trd_GetComboMaxTrdQtys::Response &stRsp) = 0;
Description
Estimate the impact of a combo order on net liquidation value, margin, option buying power, etc., without actually placing the order.
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
repeated Qot_Common.ComboLeg comboLegs = 2; //Combo leg information
required double qty = 4; //Quantity; actual quantity is qty * leg qty_ratio
optional double price = 5; //Price
required int32 orderType = 6; //OrderType, order type
optional string orderIDEx = 7; //Order ID; used when modifying an order
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- For protocol header, refer to TrdHeader
- Combo leg structure: ComboLeg (same as comboLegs in Place Combo Order C2S)
- For OrderType enum, refer to OrderType
- Return
message ComboMaxTrdQtys
{
optional double nlvChange = 1; //Net liquidation value
optional double initialMarginChange = 2; //Initial margin
optional double maintenanceMarginChange = 3; //Maintenance margin
optional double optionBuyPower = 4; //Option buying power
optional double maxWithDrawChange = 5; //Max withdrawable
optional double buyPowerDecrease = 6; //Buying power decrease
}
message S2C
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2; //Combo max tradable quantity structure
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- For interface result, refer to RetType
- Example
class Program : public FTSPI_Qot, public FTSPI_Trd, public FTSPI_Conn
{
public:
Program() {
m_pTrdApi = FTAPI::CreateTrdApi();
m_pTrdApi->RegisterTrdSpi(this);
m_pTrdApi->RegisterConnSpi(this);
}
~Program() {
if (m_pTrdApi != nullptr)
{
m_pTrdApi->UnregisterTrdSpi();
m_pTrdApi->UnregisterConnSpi();
FTAPI::ReleaseTrdApi(m_pTrdApi);
m_pTrdApi = nullptr;
}
}
void Start() {
m_pTrdApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(FTAPI_Conn* pConn, Futu::i64_t nErrCode, const char* strDesc) {
cout << "connect" << endl;
// Pack request
Trd_GetComboMaxTrdQtys::Request req;
Trd_GetComboMaxTrdQtys::C2S *c2s = req.mutable_c2s();
Trd_Common::TrdHeader *header = c2s->mutable_header();
header->set_accid(3637840);
header->set_trdenv(0); // TrdEnv: 0 live / 1 paper
header->set_trdmarket(2); // TrdMarket: 2 US stocks
// Example: Covered Call — buy 100 shares AAPL + sell 1 AAPL Call
Qot_Common::ComboLeg *leg1 = c2s->add_combolegs();
leg1->mutable_security()->set_market(Qot_Common::QotMarket_US_Security);
leg1->mutable_security()->set_code("AAPL260529C302500");
leg1->set_side(Trd_Common::TrdSide_Sell); // Sell Call
leg1->set_qtyratio(1);
Qot_Common::ComboLeg *leg2 = c2s->add_combolegs();
leg2->mutable_security()->set_market(Qot_Common::QotMarket_US_Security);
leg2->mutable_security()->set_code("AAPL");
leg2->set_side(Trd_Common::TrdSide_Buy); // Buy underlying stock
leg2->set_qtyratio(100);
c2s->set_qty(1); // Actual order = qty × each leg qty_ratio (1 Call + 100 shares)
c2s->set_price(190.1); // Combo net limit price (net outlay = stock buy price − Call premium received)
c2s->set_ordertype(Trd_Common::OrderType_Normal);
m_GetComboMaxTrdQtysSerialNo = m_pTrdApi->GetComboMaxTrdQtys(req);
cout << "Request GetComboMaxTrdQtys SerialNo: " << m_GetComboMaxTrdQtysSerialNo << endl;
}
virtual void OnReply_GetComboMaxTrdQtys(Futu::u32_t nSerialNo, const Trd_GetComboMaxTrdQtys::Response &stRsp) {
if (nSerialNo != m_GetComboMaxTrdQtysSerialNo) return;
cout << "OnReply_GetComboMaxTrdQtys SerialNo: " << nSerialNo << endl;
// Parse and print internal structure
// See tool.h in Sample for ProtoBufToBodyData and UTF8ToLocal definitions
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
FTAPI_Trd *m_pTrdApi;
Futu::u32_t m_GetComboMaxTrdQtysSerialNo = 0;
};
int32_t main(int32_t argc, char** argv)
{
FTAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
FTAPI::UnInit();
return 0;
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- Output
connect
Request GetComboMaxTrdQtys SerialNo: 3
OnReply_GetComboMaxTrdQtys SerialNo: 3
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"header": { "trdEnv": 0, "accID": "3637840", "trdMarket": 2 },
"maxTrdQtys": {
"nlvChange": 0,
"initialMarginChange": 10000.0,
"maintenanceMarginChange": 5000.0,
"optionBuyPower": 12500.0,
"maxWithDrawChange": -10000.0,
"buyPowerDecrease": 10000.0
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
GetComboMaxTrdQtys(req);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
2
3
4
5
6
7
8
9
- Return
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
2
3
4
5
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
import ftWebsocket from "futu-api";
import { ftCmdID } from "futu-api";
import { Common, Qot_Common, Trd_Common } from "futu-api/proto";
import beautify from "js-beautify";
function TrdGetComboMaxTrdQtys(){
const { RetType } = Common
const { TrdEnv, OrderType, TrdMarket } = Trd_Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new ftWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) { // Login succeeded
websocket.GetAccList({
c2s: {
userID: 0,
},
}).then((res) => {
let { retType, s2c: { accList } } = res
if(retType == RetType.RetType_Succeed){
let acc = accList.filter((item)=>{
return item.trdEnv == TrdEnv.TrdEnv_Simulate && item.trdMarketAuthList.some((auth)=>{ return auth == TrdMarket.TrdMarket_US})
})[0]; // Example: first US paper trading account
const req = {
c2s: {
header: {
trdEnv: acc.trdEnv,
accID: acc.accID,
trdMarket: TrdMarket.TrdMarket_US,
},
comboLegs: [
{
security: { market: QotMarket.QotMarket_US_Security, code: "AAPL260529C302500" },
side: Trd_Common.TrdSide.TrdSide_Buy,
qtyRatio: 1,
},
{
security: { market: QotMarket.QotMarket_US_Security, code: "AAPL" },
side: Trd_Common.TrdSide.TrdSide_Sell,
qtyRatio: 100,
},
],
qty: 1,
price: 100,
orderType: OrderType.OrderType_Normal,
},
};
websocket.GetComboMaxTrdQtys(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetComboMaxTrdQtys: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), {
indent_size: 2,
space_in_empty_paren: true,
});
console.log(data);
}
})
.catch((error) => {
console.log("error:", error);
});
}
})
.catch((error) => {
console.log("GetAccList error:", error);
});
} else {
console.log("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
//Close the connection when no longer needed to avoid wasting resources
//OpenD also limits a maximum of 128 connections
//You can maintain one connection per page or project; this example creates one connection per request
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000); // Disconnect after 5 seconds
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
- Output
GetComboMaxTrdQtys: errCode 0, retMsg , retType 0
{
"header": {
"trdEnv": 0,
"accID": "6684972",
"trdMarket": 2
},
"maxTrdQtys": {
"nlvChange": -125.3,
"initialMarginChange": 320.0,
"maintenanceMarginChange": 300.0,
"optionBuyPower": 18600.0,
"maxWithDrawChange": -320.0,
"buyPowerDecrease": 410.0
}
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Interface Limitations
- A maximum of 10 requests per 30 seconds under a single account ID (acc_id) for max tradable quantity query APIs.
- Python
- Proto
- C#
- Java
- C++
- JavaScript
comboorder_tradinginfo_query(combo_leg_list, price, qty, order_type=OrderType.NORMAL, order_id=None, trd_env=TrdEnv.REAL, acc_id=0, acc_index=0)
Description
Query tradable info for a combo order at the given price and quantity (e.g. margin and buying power changes). You can also pass an order ID to query tradable info for order modification.
Parameters
Parameter Type Description combo_leg_list list Combo leg list - Each element is a ComboLeg object; see the ComboLeg table in place_combo_order
price float Quoted price For auction or market orders, also provide a current price so the server can calculateqty float Quantity Combo quantity; actual quantity per leg is qty × that leg's qty_ratioorder_type OrderType Order type order_id str Order ID - Default None queries tradable info for a new order
- For order modification, pass server order ID orderIDEx to get related modifiable info
trd_env TrdEnv Trading environment acc_id int Trading account ID - Either acc_id or acc_index; acc_id is recommended
- When acc_id is 0, the account specified by acc_index is used
acc_index int Account index in the trading account list Defaults to 0, meaning the first trading accountReturn
Field Type Description ret RET_CODE Interface result. data pd.DataFrame If ret == RET_OK, tradable info is returned. str If ret != RET_OK, error description is returned. - Tradable info format as follows:
Field Type Description nlv_change float Net liquidation value change initial_margin_change float Initial margin change maintenance_margin_change float Maintenance margin change option_bp float Option buying power max_withdraw_change float Max withdrawable change bp_decrease float Buying power decrease
- Tradable info format as follows:
Example
from moomoo import *
trd_ctx = OpenSecTradeContext(filter_trdmarket=TrdMarket.US, host='127.0.0.1', port=11111, security_firm=SecurityFirm.FUTUINC)
leg1 = ComboLeg()
leg1.code = 'US.AAPL260529C302500'
leg1.trd_side = TrdSide.BUY
leg1.qty_ratio = 1
leg2 = ComboLeg()
leg2.code = 'US.AAPL'
leg2.trd_side = TrdSide.SELL
leg2.qty_ratio = 100
combo_legs = [leg1, leg2]
ret, data = trd_ctx.comboorder_tradinginfo_query(combo_legs, price=100, qty=1, order_type=OrderType.NORMAL, trd_env=TrdEnv.SIMULATE)
if ret == RET_OK:
print(data)
else:
print('comboorder_tradinginfo_query error: ', data)
trd_ctx.close()
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
- Output
nlv_change initial_margin_change maintenance_margin_change option_bp max_withdraw_change bp_decrease
0 ... ... ... ... ... ...
2
# Trd_GetComboMaxTrdQtys.proto
Description
Query max tradable quantity and related fund/margin changes for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
repeated Qot_Common.ComboLeg comboLegs = 2; //Combo leg information
required double qty = 4; //Quantity; actual quantity is qty * leg qty_ratio
optional double price = 5; //Price
required int32 orderType = 6; //Order type; see Trd_Common.OrderType enumeration definition
optional string orderIDEx = 7; //Order ID; used when modifying an order
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Return
message S2C
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2; //Combo max tradable quantity structure
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For protocol header, refer to TrdHeader
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
Protocol ID
2112
uint GetComboMaxTrdQtys(TrdGetComboMaxTrdQtys.Request req);
virtual void OnReply_GetComboMaxTrdQtys(MMAPI_Conn client, uint nSerialNo, TrdGetComboMaxTrdQtys.Response rsp);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Callback
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
public class Program : MMSPI_Trd, MMSPI_Conn {
MMAPI_Trd trd = new MMAPI_Trd();
public Program() {
trd.SetClientInfo("csharp", 1); //Set client info
trd.SetConnCallback(this); //Set connection callback
trd.SetTrdCallback(this); //Set trade callback
}
public void Start() {
trd.InitConnect("127.0.0.1", (ushort)11111, false);
}
public void OnInitConnect(MMAPI_Conn client, long errCode, String desc)
{
Console.Write("Trd onInitConnect: ret={0} desc={1} connID={2}\n", errCode, desc, client.GetConnectID());
if (errCode != 0)
return;
TrdCommon.TrdHeader header = TrdCommon.TrdHeader.CreateBuilder()
.SetAccID(281756457888247915L)
.SetTrdEnv((int)TrdCommon.TrdEnv.TrdEnv_Simulate)
.SetTrdMarket((int)TrdCommon.TrdMarket.TrdMarket_US)
.Build();
QotCommon.ComboLeg leg1 = QotCommon.ComboLeg.CreateBuilder()
.SetSecurity(QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL260529C302500")
.Build())
.SetSide((int)TrdCommon.TrdSide.TrdSide_Buy)
.SetQtyRatio(1)
.Build();
QotCommon.ComboLeg leg2 = QotCommon.ComboLeg.CreateBuilder()
.SetSecurity(QotCommon.Security.CreateBuilder()
.SetMarket((int)QotCommon.QotMarket.QotMarket_US_Security)
.SetCode("AAPL")
.Build())
.SetSide((int)TrdCommon.TrdSide.TrdSide_Sell)
.SetQtyRatio(100)
.Build();
TrdGetComboMaxTrdQtys.C2S c2s = TrdGetComboMaxTrdQtys.C2S.CreateBuilder()
.SetHeader(header)
.AddComboLegs(leg1)
.AddComboLegs(leg2)
.SetQty(1)
.SetPrice(100)
.SetOrderType((int)TrdCommon.OrderType.OrderType_Normal)
.Build();
TrdGetComboMaxTrdQtys.Request req = TrdGetComboMaxTrdQtys.Request.CreateBuilder().SetC2S(c2s).Build();
uint seqNo = trd.GetComboMaxTrdQtys(req);
Console.Write("Send TrdGetComboMaxTrdQtys: {0}\n", seqNo);
}
public void OnDisconnect(MMAPI_Conn client, long errCode) {
Console.Write("Trd onDisConnect: {0}\n", errCode);
}
public void OnReply_GetComboMaxTrdQtys(MMAPI_Conn client, uint nSerialNo, TrdGetComboMaxTrdQtys.Response rsp)
{
Console.Write("Reply: TrdGetComboMaxTrdQtys: {0}\n", nSerialNo);
Console.Write("accID: {0}\n", rsp.S2C.Header.AccID);
}
public static void Main(String[] args) {
MMAPI.Init();
Program trd = new Program();
trd.Start();
while (true)
Thread.Sleep(1000 * 600);
}
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
- Output
Trd onInitConnect: ret=0 desc= connID=6826812678028044696
Send TrdGetComboMaxTrdQtys: 3
Reply: TrdGetComboMaxTrdQtys: 3
accID: 281756457888247915
2
3
4
int getComboMaxTrdQtys(TrdGetComboMaxTrdQtys.Request req);
void onReply_GetComboMaxTrdQtys(MMAPI_Conn client, int nSerialNo, TrdGetComboMaxTrdQtys.Response rsp);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- Callback
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
message Response
{
required int32 retType = 1 [default = -400];
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
public class TrdDemo implements MMSPI_Trd, MMSPI_Conn {
MMAPI_Conn_Trd trd = new MMAPI_Conn_Trd();
public TrdDemo() {
trd.setClientInfo("javaclient", 1); //Set client info
trd.setConnSpi(this); //Set connection callback
trd.setTrdSpi(this); //Set trade callback
}
public void start() {
trd.initConnect("127.0.0.1", (short)11111, false);
}
@Override
public void onInitConnect(MMAPI_Conn client, long errCode, String desc)
{
System.out.printf("Trd onInitConnect: ret=%b desc=%s connID=%d\n", errCode, desc, client.getConnectID());
if (errCode != 0)
return;
TrdCommon.TrdHeader header = TrdCommon.TrdHeader.newBuilder()
.setAccID(281756457888247915L)
.setTrdEnv(TrdCommon.TrdEnv.TrdEnv_Simulate_VALUE)
.setTrdMarket(TrdCommon.TrdMarket.TrdMarket_US_VALUE)
.build();
QotCommon.ComboLeg leg1 = QotCommon.ComboLeg.newBuilder()
.setSecurity(QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL260529C302500")
.build())
.setSide(TrdCommon.TrdSide.TrdSide_Buy_VALUE)
.setQtyRatio(1)
.build();
QotCommon.ComboLeg leg2 = QotCommon.ComboLeg.newBuilder()
.setSecurity(QotCommon.Security.newBuilder()
.setMarket(QotCommon.QotMarket.QotMarket_US_Security_VALUE)
.setCode("AAPL")
.build())
.setSide(TrdCommon.TrdSide.TrdSide_Sell_VALUE)
.setQtyRatio(100)
.build();
TrdGetComboMaxTrdQtys.C2S c2s = TrdGetComboMaxTrdQtys.C2S.newBuilder()
.setHeader(header)
.addComboLegs(leg1)
.addComboLegs(leg2)
.setQty(1)
.setPrice(100)
.setOrderType(TrdCommon.OrderType.OrderType_Normal_VALUE)
.build();
TrdGetComboMaxTrdQtys.Request req = TrdGetComboMaxTrdQtys.Request.newBuilder().setC2S(c2s).build();
int seqNo = trd.getComboMaxTrdQtys(req);
System.out.printf("Send TrdGetComboMaxTrdQtys: %d\n", seqNo);
}
@Override
public void onDisconnect(MMAPI_Conn client, long errCode) {
System.out.printf("Trd onDisConnect: %d\n", errCode);
}
@Override
public void onReply_GetComboMaxTrdQtys(MMAPI_Conn client, int nSerialNo, TrdGetComboMaxTrdQtys.Response rsp) {
if (rsp.getRetType() != 0) {
System.out.printf("TrdGetComboMaxTrdQtys failed: %s\n", rsp.getRetMsg());
}
else {
try {
String json = JsonFormat.printer().print(rsp);
System.out.printf("Receive TrdGetComboMaxTrdQtys: %s\n", json);
} catch (InvalidProtocolBufferException e) {
e.printStackTrace();
}
}
}
public static void main(String[] args) {
MMAPI.init();
TrdDemo trd = new TrdDemo();
trd.start();
while (true) {
try {
Thread.sleep(1000 * 600);
} catch (InterruptedException exc) {
}
}
}
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- Output
Send TrdGetComboMaxTrdQtys: 2
Receive TrdGetComboMaxTrdQtys: {
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"header": {
"trdEnv": 0,
"accID": "281756457888247915",
"trdMarket": 2
},
"maxTrdQtys": {
"nlvChange": -125.3,
"initialMarginChange": 320.0,
"maintenanceMarginChange": 300.0,
"optionBuyPower": 18600.0,
"maxWithDrawChange": -320.0,
"buyPowerDecrease": 410.0
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
moomoo::u32_t GetComboMaxTrdQtys(const Trd_GetComboMaxTrdQtys::Request &stReq);
virtual void OnReply_GetComboMaxTrdQtys(moomoo::u32_t nSerialNo, const Trd_GetComboMaxTrdQtys::Response &stRsp) = 0;
Description
Estimate the impact of a combo order on net liquidation value, margin, option buying power, etc., without actually placing the order.
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
repeated Qot_Common.ComboLeg comboLegs = 2; //Combo leg information
required double qty = 4; //Quantity; actual quantity is qty * leg qty_ratio
optional double price = 5; //Price
required int32 orderType = 6; //OrderType, order type
optional string orderIDEx = 7; //Order ID; used when modifying an order
}
message Request
{
required C2S c2s = 1;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
- For protocol header, refer to TrdHeader
- Combo leg structure: ComboLeg (same as comboLegs in Place Combo Order C2S)
- For OrderType enum, refer to OrderType
- Return
message ComboMaxTrdQtys
{
optional double nlvChange = 1; //Net liquidation value
optional double initialMarginChange = 2; //Initial margin
optional double maintenanceMarginChange = 3; //Maintenance margin
optional double optionBuyPower = 4; //Option buying power
optional double maxWithDrawChange = 5; //Max withdrawable
optional double buyPowerDecrease = 6; //Buying power decrease
}
message S2C
{
required Trd_Common.TrdHeader header = 1; //Transaction common header
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2; //Combo max tradable quantity structure
}
message Response
{
required int32 retType = 1 [default = -400]; //RetType, return result
optional string retMsg = 2;
optional int32 errCode = 3;
optional S2C s2c = 4;
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
- For interface result, refer to RetType
- Example
class Program : public MMSPI_Qot, public MMSPI_Trd, public MMSPI_Conn
{
public:
Program() {
m_pTrdApi = MMAPI::CreateTrdApi();
m_pTrdApi->RegisterTrdSpi(this);
m_pTrdApi->RegisterConnSpi(this);
}
~Program() {
if (m_pTrdApi != nullptr)
{
m_pTrdApi->UnregisterTrdSpi();
m_pTrdApi->UnregisterConnSpi();
MMAPI::ReleaseTrdApi(m_pTrdApi);
m_pTrdApi = nullptr;
}
}
void Start() {
m_pTrdApi->InitConnect("127.0.0.1", 11111, false);
}
virtual void OnInitConnect(MMAPI_Conn* pConn, moomoo::i64_t nErrCode, const char* strDesc) {
cout << "connect" << endl;
// Pack request
Trd_GetComboMaxTrdQtys::Request req;
Trd_GetComboMaxTrdQtys::C2S *c2s = req.mutable_c2s();
Trd_Common::TrdHeader *header = c2s->mutable_header();
header->set_accid(3637840);
header->set_trdenv(0); // TrdEnv: 0 live / 1 paper
header->set_trdmarket(2); // TrdMarket: 2 US stocks
// Example: Covered Call — buy 100 shares AAPL + sell 1 AAPL Call
Qot_Common::ComboLeg *leg1 = c2s->add_combolegs();
leg1->mutable_security()->set_market(Qot_Common::QotMarket_US_Security);
leg1->mutable_security()->set_code("AAPL260529C302500");
leg1->set_side(Trd_Common::TrdSide_Sell); // Sell Call
leg1->set_qtyratio(1);
Qot_Common::ComboLeg *leg2 = c2s->add_combolegs();
leg2->mutable_security()->set_market(Qot_Common::QotMarket_US_Security);
leg2->mutable_security()->set_code("AAPL");
leg2->set_side(Trd_Common::TrdSide_Buy); // Buy underlying stock
leg2->set_qtyratio(100);
c2s->set_qty(1); // Actual order = qty × each leg qty_ratio (1 Call + 100 shares)
c2s->set_price(190.1); // Combo net limit price (net outlay = stock buy price − Call premium received)
c2s->set_ordertype(Trd_Common::OrderType_Normal);
m_GetComboMaxTrdQtysSerialNo = m_pTrdApi->GetComboMaxTrdQtys(req);
cout << "Request GetComboMaxTrdQtys SerialNo: " << m_GetComboMaxTrdQtysSerialNo << endl;
}
virtual void OnReply_GetComboMaxTrdQtys(moomoo::u32_t nSerialNo, const Trd_GetComboMaxTrdQtys::Response &stRsp) {
if (nSerialNo != m_GetComboMaxTrdQtysSerialNo) return;
cout << "OnReply_GetComboMaxTrdQtys SerialNo: " << nSerialNo << endl;
// Parse and print internal structure
// See tool.h in Sample for ProtoBufToBodyData and UTF8ToLocal definitions
string resp_str;
ProtoBufToBodyData(stRsp, resp_str);
cout << UTF8ToLocal(resp_str) << endl;
}
protected:
MMAPI_Trd *m_pTrdApi;
moomoo::u32_t m_GetComboMaxTrdQtysSerialNo = 0;
};
int32_t main(int32_t argc, char** argv)
{
MMAPI::Init();
{
Program program;
program.Start();
getchar();
}
protobuf::ShutdownProtobufLibrary();
MMAPI::UnInit();
return 0;
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
- Output
connect
Request GetComboMaxTrdQtys SerialNo: 3
OnReply_GetComboMaxTrdQtys SerialNo: 3
{
"retType": 0,
"retMsg": "",
"errCode": 0,
"s2c": {
"header": { "trdEnv": 0, "accID": "3637840", "trdMarket": 2 },
"maxTrdQtys": {
"nlvChange": 0,
"initialMarginChange": 10000.0,
"maintenanceMarginChange": 5000.0,
"optionBuyPower": 12500.0,
"maxWithDrawChange": -10000.0,
"buyPowerDecrease": 10000.0
}
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
GetComboMaxTrdQtys(req);
Description
Query tradable info for a combo order
Parameters
message C2S
{
required Trd_Common.TrdHeader header = 1;
repeated Qot_Common.ComboLeg comboLegs = 2;
required double qty = 4;
optional double price = 5;
required int32 orderType = 6;
optional string orderIDEx = 7;
}
2
3
4
5
6
7
8
9
- Return
message S2C
{
required Trd_Common.TrdHeader header = 1;
optional Trd_Common.ComboMaxTrdQtys maxTrdQtys = 2;
}
2
3
4
5
- For combo tradable info structure, refer to ComboMaxTrdQtys
- For interface result, refer to RetType
- Example
import mmWebsocket from "moomoo-api";
import { mmCmdID } from "moomoo-api";
import { Common, Qot_Common, Trd_Common } from "moomoo-api/proto";
import beautify from "js-beautify";
function TrdGetComboMaxTrdQtys(){
const { RetType } = Common
const { TrdEnv, OrderType, TrdMarket } = Trd_Common
const { QotMarket } = Qot_Common
let [addr, port, enable_ssl, key] = ["127.0.0.1", 33333, false, '7522027ccf5a06b1'];
let websocket = new mmWebsocket();
websocket.onlogin = (ret, msg)=>{
if (ret) { // Login succeeded
websocket.GetAccList({
c2s: {
userID: 0,
},
}).then((res) => {
let { retType, s2c: { accList } } = res
if(retType == RetType.RetType_Succeed){
let acc = accList.filter((item)=>{
return item.trdEnv == TrdEnv.TrdEnv_Simulate && item.trdMarketAuthList.some((auth)=>{ return auth == TrdMarket.TrdMarket_US})
})[0]; // Example: first US paper trading account
const req = {
c2s: {
header: {
trdEnv: acc.trdEnv,
accID: acc.accID,
trdMarket: TrdMarket.TrdMarket_US,
},
comboLegs: [
{
security: { market: QotMarket.QotMarket_US_Security, code: "AAPL260529C302500" },
side: Trd_Common.TrdSide.TrdSide_Buy,
qtyRatio: 1,
},
{
security: { market: QotMarket.QotMarket_US_Security, code: "AAPL" },
side: Trd_Common.TrdSide.TrdSide_Sell,
qtyRatio: 100,
},
],
qty: 1,
price: 100,
orderType: OrderType.OrderType_Normal,
},
};
websocket.GetComboMaxTrdQtys(req)
.then((res) => {
let { errCode, retMsg, retType,s2c } = res
console.log("GetComboMaxTrdQtys: errCode %d, retMsg %s, retType %d", errCode, retMsg, retType);
if(retType == RetType.RetType_Succeed){
let data = beautify(JSON.stringify(s2c), {
indent_size: 2,
space_in_empty_paren: true,
});
console.log(data);
}
})
.catch((error) => {
console.log("error:", error);
});
}
})
.catch((error) => {
console.log("GetAccList error:", error);
});
} else {
console.log("error", msg);
}
};
websocket.start(addr, port, enable_ssl, key);
//Close the connection when no longer needed to avoid wasting resources
//OpenD also limits a maximum of 128 connections
//You can maintain one connection per page or project; this example creates one connection per request
setTimeout(()=>{
websocket.stop();
console.log("stop");
}, 5000); // Disconnect after 5 seconds
}
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
- Output
GetComboMaxTrdQtys: errCode 0, retMsg , retType 0
{
"header": {
"trdEnv": 0,
"accID": "6684972",
"trdMarket": 2
},
"maxTrdQtys": {
"nlvChange": -125.3,
"initialMarginChange": 320.0,
"maintenanceMarginChange": 300.0,
"optionBuyPower": 18600.0,
"maxWithDrawChange": -320.0,
"buyPowerDecrease": 410.0
}
}
stop
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Interface Limitations
- A maximum of 10 requests per 30 seconds under a single account ID (acc_id) for max tradable quantity query APIs.