MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / reqIds

Method reqIds

packages/ibkr/ref/source/pythonclient/ibapi/client.py:3159–3186  ·  view source on GitHub ↗

Call this function to request from TWS the next valid ID that can be used when placing an order. After calling this function, the nextValidId() event will be triggered, and the id returned is that next valid ID. That ID will reflect any autobinding that has occurred (which

(self, numIds: int)

Source from the content-addressed store, hash-verified

3157 return
3158
3159 def reqIds(self, numIds: int):
3160 """Call this function to request from TWS the next valid ID that
3161 can be used when placing an order. After calling this function, the
3162 nextValidId() event will be triggered, and the id returned is that next
3163 valid ID. That ID will reflect any autobinding that has occurred (which
3164 generates new IDs and increments the next valid ID therein).
3165
3166 numIds:int - deprecated"""
3167
3168 if (self.useProtoBuf(OUT.REQ_IDS)):
3169 idsRequestProto = createIdsRequestProto(numIds)
3170 self.reqIdsProtoBuf(idsRequestProto)
3171 return
3172
3173 self.logRequest(current_fn_name(), vars())
3174
3175 if not self.isConnected():
3176 self.wrapper.error(NO_VALID_ID, currentTimeMillis(), NOT_CONNECTED.code(), NOT_CONNECTED.msg())
3177 return
3178
3179 try:
3180 VERSION = 1
3181
3182 msg = make_field(VERSION) + make_field(numIds)
3183 self.sendMsg(OUT.REQ_IDS, msg)
3184 except Exception as ex:
3185 self.wrapper.error(NO_VALID_ID, currentTimeMillis(), FAIL_SEND_CORDER.code(), FAIL_SEND_CORDER.msg() + str(ex))
3186 return
3187
3188 def reqIdsProtoBuf(self, idsRequestProto: IdsRequestProto):
3189 if idsRequestProto is None:

Callers

nothing calls this directly

Calls 12

useProtoBufMethod · 0.95
reqIdsProtoBufMethod · 0.95
logRequestMethod · 0.95
isConnectedMethod · 0.95
sendMsgMethod · 0.95
createIdsRequestProtoFunction · 0.90
current_fn_nameFunction · 0.90
currentTimeMillisFunction · 0.90
make_fieldFunction · 0.90
errorMethod · 0.65
codeMethod · 0.45
msgMethod · 0.45

Tested by

no test coverage detected