I run a fully automated futures system through IB with python (ibinsync)
IB have done something every weird... they appear to have changed the ticker for the micro bitcoin from BRR to MBT (without telling me, which is nice!), but for my existing position the API is still returning a ticker of BRR. So I can't just change the configuration for the instrument from BRR to MBT. As far as I can tell, the only thing I can do is manually close the position, change the configuration ticker from BRR to MBT, and then open a new one.
Any ideas?
IB have done something every weird... they appear to have changed the ticker for the micro bitcoin from BRR to MBT (without telling me, which is nice!), but for my existing position the API is still returning a ticker of BRR. So I can't just change the configuration for the instrument from BRR to MBT. As far as I can tell, the only thing I can do is manually close the position, change the configuration ticker from BRR to MBT, and then open a new one.
Any ideas?
Code:
>>> from ib_insync import Future, IB
>>> ib = IB()
>>> ib.connect('127.0.0.1', 4001, clientId=10)
<IB connected to 127.0.0.1:4001 clientId=10>
## We have MBT futures...
>>> future = Future(symbol='MBT', exchange = 'CMECRYPTO')
>>> contracts =ib.reqContractDetails(future)
>>> print(len(contracts))
8
## But the old BRR micros are gone
>>> future = Future(symbol='BRR', exchange = 'CMECRYPTO', multiplier=0.1)
>>> contracts =ib.reqContractDetails(future)
Error 200, reqId 5: No security definition has been found for the request, contract: Future(symbol='BRR', multiplier=0.1, exchange='CMECRYPTO')
## Though the original large contract is still there
>>> future = Future(symbol='BRR', exchange = 'CMECRYPTO', multiplier=5)
>>> contracts =ib.reqContractDetails(future)
>>> print(len(contracts))
8
## But in my postitions I'm still holding BRR!
>>> x = ib.positions()
>>> print(x[17].contract)
Future(conId=481220886, symbol='BRR', lastTradeDateOrContractMonth='20210730', multiplier='0.1', currency='USD', localSymbol='MBTN1', tradingClass='MBT')