robcarver17 / pysystemtrade

Systematic Trading in python
GNU General Public License v3.0
2.57k stars 816 forks source link

EU-BANKS: ib_insync.wrapper:Error 110, reqId 69959: The price does not conform to the minimum price variation for this contract. #1196

Closed oldlore closed 1 year ago

oldlore commented 1 year ago

Tried to roll EU-BANKS overnight and when I checked interactive order stack the EU-BANKS order was still in the stack (supposed to execute at 4AM EST). I checked stack handler and saw this error. Checked google and only thing I could come up with is EU-BANKS uses a min tick of 0.05 compared to 0.1 for other STOXX sector futures.

2023-06-13 04:00:55 {'type': 'stack_handler', 'strategy_name': '_ROLL_PSEUDO_STRATEGY', 'instrument_code': 'EU-BANKS', 'contract_order_id': 172, 'broker_order_id': 174}  Managing trade (Order ID:174) Type limit for _ROLL_PSEUDO_STRATEGY/EU-BANKS/20230600_20230900, qty [-1, 1], fill [0, 0]@ price, None Parent:172 Children:no_children with algo 'original-best'
2023-06-13 04:00:56 {'type': 'stack_handler', 'component': 'ibContractPositionData'} [Warning] Reqid 69917: 110 The price does not conform to the minimum price variation for this contract. for None
2023-06-13 04:00:56 {'type': 'stack_handler', 'component': 'ibFuturesInstrumentData'} [Warning] Reqid 69917: 110 The price does not conform to the minimum price variation for this contract. for None
2023-06-13 04:00:56 {'type': 'stack_handler', 'component': 'ibFuturesContractData'} [Warning] Reqid 69917: 110 The price does not conform to the minimum price variation for this contract. for None
ERROR:ib_insync.wrapper:Error 110, reqId 69931: The price does not conform to the minimum price variation for this contract.
WARNING:ib_insync.wrapper:Canceled order: Trade(contract=Future(symbol='SX7E', multiplier='50', exchange='EUREX', currency='EUR', 
comboLegs=[ComboLeg(conId=586729816, ratio=1, action='BUY', exchange='EUREX', openClose=0, shortSaleSlot=0, designatedLocation='', exemptCode=-1), ComboLeg(conId=604259310, ratio=1, action='SELL', 
exchange='EUREX', openClose=0, shortSaleSlot=0, designatedLocation='', 
exemptCode=-1)]), order=LimitOrder(orderId=69931, clientId=1311, action='SELL', totalQuantity=1, lmtPrice=-0.65, account='U6227427'), orderStatus=OrderStatus(orderId=69931, status='Cancelled', filled=0.0, remaining=0.0, avgFillPrice=0.0, permId=0, parentId=0, lastFillPrice=0.0, clientId=0, whyHeld='', 
mktCapPrice=0.0), fills=[], log=[TradeLogEntry(time=datetime.datetime(2023, 6, 13, 8, 1, 0, 138293, tzinfo=datetime.timezone.utc), status='PendingSubmit', message='', errorCode=0), 
TradeLogEntry(time=datetime.datetime(2023, 6, 13, 8, 1, 1, 101923, tzinfo=datetime.timezone.utc), status='Cancelled', message='Error 110, reqId 69931: The price does not conform to the minimum price variation for this contract.', errorCode=110)])

I then checked my positions and the roll did actually happen but has not been cleared from the stack for some reason.

2023-06-13 04:02:16 {'type': 'stack_handler', 'component': 'mongoContractOrderStackData', 'strategy_name': '_ROLL_PSEUDO_STRATEGY', 'instrumen
t_code': 'EU-BANKS', 'contract_order_id': 172, 'instrument_order_id': 178}  Changed fill qty from [0, 0] to [-1, 1] for order (Order ID:172) T
ype best for _ROLL_PSEUDO_STRATEGY/EU-BANKS/20230600_20230900, qty [-1, 1], fill [0, 0]@ price, None Parent:178 Children:[162, 163, 164, 165, 
166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188]
2023-06-13 04:02:16 {'type': 'stack_handler', 'instrument_code': 'EU-BANKS', 'contract_date': '20230600'}  Updated position of EU-BANKS/202306
00 from 1 to 0; new position in db is 0
2023-06-13 04:02:16 {'type': 'stack_handler', 'strategy_name': '_ROLL_PSEUDO_STRATEGY', 'instrument_code': 'EU-BANKS', 'contract_order_id': 17
2, 'instrument_order_id': 178}  Updated position of EU-BANKS/20230600 because of trade (Order ID:172) Type best for _ROLL_PSEUDO_STRATEGY/EU-B
ANKS/20230600_20230900, qty [-1, 1], fill [0, 0]@ price, None Parent:178 Children:[162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173,
 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188] ID:172 with fills -1
2023-06-13 04:02:16 {'type': 'stack_handler', 'instrument_code': 'EU-BANKS', 'contract_date': '20230900'}  Updated position of EU-BANKS/202309
00 from 0 to 1; new position in db is 1
INSTRUMENT STACK 

(Order ID:177) Type Zero-roll-order for _ROLL_PSEUDO_STRATEGY AUD_micro, qty [0], fill [0]@ price, None Parent:no parent Children:[171]
(Order ID:178) Type Zero-roll-order for _ROLL_PSEUDO_STRATEGY EU-BANKS, qty [0], fill [0]@ price, None Parent:no parent Children:[172]

This hasn't happened to me before. I rolled CNH just a few hours ago and it went normally. Later in they day AUD, VIX rolls went fine. I assume the end of day process will clear the stack and all will be well by tonight.

Thanks!

robcarver17 commented 1 year ago

I'm closing this as I can't reproduce it and it isn't really obvious if it's a pst problem, ibinsync or ib api.