Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 09:58:25 +0000



Post From: ACSIL order cancellation and maximum position size

[2023-09-10 15:39:51]
User948037 - Posts: 15
I have an ACSIL automated trading system. The maximum position size is set to 2.

When a buy signal is observed, the system puts in a limit order. If the order is not filled within the same bar, it's cancelled on the open of the next bar. If the buy signal is still on, then a new limit order is placed at the open of that bar.

When my position is flat in live trading, this works perfectly. You can watch the orders placed and then cancelled once per bar until I get filled or the buy signal stops.

In simulation, this also works perfectly when my position size is flat or +1.

But when I'm trading live and my position size is +1, orders are only placed on alternating bars. What happens is that an order will be open, it will not fill, and then it will cancel on the open of the next bar, as intended. But instead of placing a new order immediately (as happens when I'm flat), the program waits a bar. Then, if the buy signal is still on, the order is placed on the open of the next bar.

What I think is happening is that when live trading there's a delay between the program sending the cancellation and its execution (and confirmation being sent back to my PC). So, the order cancellation goes to the service, the program is ready to send a new buy order, but the order cancellation has not been confirmed, so my effective position size (actual positions plus working orders) is +2 now, and the new buy order doesn't get placed. By the open of the next bar, my previous order is cancelled and confirmed so, so the program can place a new order.

Two questions: First, does this sound like a correct explanation?

And, second, is there a solution? I know that I could temporarily make my maximum position size 3, but then there's a small risk that I'll end up with a position size of 3. I'm not looking for programming help. I'm just wondering if there's a option to direct the program to not count cancelled orders towards my position size limit.

Thanks.