ib_async
ib_async copied to clipboard
cancelMktDepth don't cancel ...!
I have a code with try to switch between subscription to marketDepth because only 3 are possibles So I have a function:
def abonnement(self, fxSymbol='EURUSD'):
contract = Forex(fxSymbol)
if self.contractActif != contract and self.contractActif != None:
self.ib.cancelMktDepth(self.contractActif) # IB line 1524
ticker = self.ib.reqMktDepth(contract)
ticker.updateEvent += self.onDepthUpdate
self.contractActif = contract
but when trying to change fxSymbol: cancelMktDepth: No reqId found for contract Forex('EURUSD', exchange='IDEALPRO')
and when looking at results I can see that old contract continue to be updated ... with the new one
Where is the problem ? thanks
Humm ! May be it is because I have another client (the "working" one) connected to the same symbol, so when requesting by the other process (the "test" one) for the same symbol, IBgateway just share the data but don't make another subscription so reqId is the one of the first client and the second process don't recognize it. I test with Symbol different from the first process and it seems working with no error message. Data continue to be updated probably because of ticker.updateEvent ... I search more.