Replies: 3 comments
-
Think this is related to #949. |
Beta Was this translation helpful? Give feedback.
-
In that issue I modified the error logging so it displayed the IB status code for the order, looks like you don't have that. So my gut feeling is that IB are holding the order in a pre submitted status for some reason which means pst can't modify it. Unfortunately the information about what is causing this: margin issue, trading restriction, .... ; I think you would need to look at the gateway log to find out. |
Beta Was this translation helpful? Give feedback.
-
As I said in the other issue, try submitting the order in ib_insync with pst not running any processes, and keep a sharp eye on the gateway logs. |
Beta Was this translation helpful? Give feedback.
-
Hi Everyone,
The stack handler is failing to execute Bund and Nikkei trades in the last couple days. Seeing the following in the stack handler log. Just wanted to check whether this is the expected behaviour.
grep NIKKEI ~/echos/run_stack_handler.txt | more
2023-03-07 00:01:17 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'instrument_order_id': 328} No roll, allocating entire order (Order ID:328) Type best for pr
od NIKKEI, qty [1], fill [0]@ price, None Parent:no parent Children:no_children to current contract 20230600
2023-03-07 00:01:17 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': '', 'instrument_order_id': 328} 'Best' order so allocating to original_
best
2023-03-07 00:01:17 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'instrument_order_id': 328} List of contract orders spawned [(Order ID:no order ID) Type bes
t for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:328 Children:no_children]
2023-03-07 00:01:17 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'instrument_order_id': 328, 'contract_order_id': ''} Put child order (Order ID:no order ID)
Type best for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:328 Children:no_children LOCKED on stack with ID 302 from parent order (Order ID:328) Type best for prod NIKKEI, qty [1], fill [0]@ price, None Parent:n
o parent Children:no_children
2023-03-07 01:45:02 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'instrument_order_id': 328} Sending order (Order ID:302) Type best
for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:328 Children:no_children to algo sysexecution.algos.algo_original_best.algoOriginalBest
2023-03-07 01:45:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'instrument_order_id': 328} Created a broker order (Order ID:no or
der ID) Type limit for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:302 Children:no_children (not yet submitted or written to local DB)
2023-03-07 01:45:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'component': 'ibExecutionStackData', 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': ''} Going
to submit order (Order ID:no order ID) Type limit for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:302 Children:no_children to IB
2023-03-07 01:45:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'component': 'ibExecutionStackData', 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': ''} Order
submitted to IB
2023-03-07 01:45:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'instrument_order_id': 328, 'broker_order_id': ''} Submitted order
to IB (Order ID:no order ID) Type limit for prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:302 Children:no_children
2023-03-07 01:45:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Managing trade (Order ID:508) Type limit f
or prod/NIKKEI/20230600, qty [1], fill [0]@ price, None Parent:302 Children:no_children with algo 'original-best'
2023-03-07 01:45:25 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Imbalance ratio for ticker analysisTick(or
der='B', side_price=28095.0, mid_price=28092.5, offside_price=28090.0, spread=5.0, side_qty=1.0, offside_qty=234.0, imbalance_ratio=234.0) 234.000000 exceeds threshold 5.000000
2023-03-07 01:45:25 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} On ticker analysisTick(order='B', side_pri
ce=28095.0, mid_price=28092.5, offside_price=28090.0, spread=5.0, side_qty=1.0, offside_qty=234.0, imbalance_ratio=234.0) we require size of 3.000000 (our trade 1.000000 * adjustment 3.000000) for a limit order but only 1.0000
00 available
2023-03-07 01:45:25 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Switch to aggressive because Imbalance rat
io of 234.000000 exceeds threshold
2023-03-07 01:45:26 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Can't modify limit price for order right n
ow as status isn't good
2023-03-07 01:45:26 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Can't modify limit price for order right n
ow as status isn't good
2023-03-07 01:45:26 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Can't modify limit price for order right n
ow as status isn't good
The last message repeats for many minutes, at some point I see the following message indicating there seems to be good two way market
2023-03-07 01:49:05 {'type': 'stack_handler', 'broker': 'IB', 'clientid': 831, 'strategy_name': 'prod', 'instrument_code': 'NIKKEI', 'contract_order_id': 302, 'broker_order_id': 508} Aggressive execution with limit price desi
red:28095.000000 actual:28095.000000 last tick oneTick(bid_price=28090.0, ask_price=28095.0, bid_size=218.0, ask_size=14.0)
However the limit order doesn't get modified and the order eventually gets cancelled. Something seems off with the code.
Please let me know if others are experiencing the same.
PS: I am not on the head version of the code, not sure if this issue has been encountered and fixed before.
Best
Emre
Beta Was this translation helpful? Give feedback.
All reactions