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)
| 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: |
nothing calls this directly
no test coverage detected