staggered_orders_trading: use order_quantity/order_price in warning - #3648
staggered_orders_trading: use order_quantity/order_price in warning#3648blueyed wants to merge 1 commit into
Conversation
| if not created_order: | ||
| self.logger.warning( | ||
| f"No order created for {order_data} (cost: {quantity * order_data.price}): " | ||
| f"No order created for {order_data} (cost: {order_quantity * order_price}): " |
There was a problem hiding this comment.
order_quantity and order_price are initialized in the above for loop that can yield no iteration, in this case, order_quantity and order_price would be unset. To use them in this log, we need to init them before the loop, to be sure they are always set variables
There was a problem hiding this comment.
Ok.
Can you let the workflow/tests run? I'm interested to see if there are falling tests.
There was a problem hiding this comment.
tests are not failing atm, it's just a risk if we include this change.
You should be able to run tests on your own setup using pytest with the proper PYTHON_PATH and giving this as argument tentacles/Trading/Mode/staggered_orders_trading_mode (to run staggered_orders_trading_mode tests only)
Ref: #3611 (comment)