Partial Fill With Limit Orders
Author: kcbars
Creation Date: 7/28/2014 4:27 PM
profile picture

kcbars

#1
I have an intraday strategy that uses limit buy orders, and have been testing it for real-life trading (via Fidelity). If a partial fill occurs (100 of 300 shares, say), my understanding was that the remaining unfilled balance should be cancelled at the end of the bar cycle. However, that doesn't happen - the unfilled portion of the limit buy order remains open until I manually cancel it, and the sell logic operates on the filled portion. Does that make sense to anyone? Or am I missing a setting somewhere? I do have the "Exit Orders should always exit the full position" box checked. Or is there any way to force a fill or kill sort of thing? Thanks.
profile picture

Cone

#2
It will be canceled for Auto-Trading (only).

Use "Exit Orders should always exit the full position" to avoid trying to sell too many live shares (300) or too few shares.

WLP doesn't have a FOK option, and remember, the script is always operating in hypothetical mode anyway.. if the price is touched, it assumes the order is [completely] filled.

fwiw, the Quotes tool has an option to use market orders when the limit price is triggered, which practically guarantees a fully filled order.

You might be able to use Replace order to manually fill the rest of an order at market, but I don't know if that would result in a separate commission charge or not - a question for the Fidelity guys.


profile picture

kcbars

#3
Cone, thanks for the reply. On the first line, where you say it will be cancelled for auto-trading (only), do you mean in the script/hypothetically? I'm only auto-trading in this scenario.

And I had never considered the Quotes tool for placing market orders. That may be exactly what I need to do if it will place market orders from the alerts generated via the strategy monitor. So I will definitely experiment with that. Thanks again.
profile picture

kcbars

#4
Along the same concept, I have been using the following "dummy" code to guarantee that I get a market sell of a position:

CODE:
Please log in to see this code.


It occurred to me that I might be able to use the same sort of thing to cancel the remainder of a partially filled order if I could create a dummy limit order that would never be filled and therefore be cancelled. So basically change the BuyAtMarket code above to:

CODE:
Please log in to see this code.


However, I can't get it to work. Can you please tell me what I'm doing wrong, or if it's possible? Thanks.
profile picture

Cone

#5
You can't use another order to cancel or replace a different one.

The Quotes tool is really only for EOD trading. In other words, you should use it if your limit price does not change throughout the day.

QUOTE:
... where you say it will be cancelled for auto-trading (only), do you mean in the script/hypothetically? I'm only auto-trading in this scenario.
Both - but it depends if you have limit order slippage enabled! If you do, the script would leave the order open even if it were actually fully filled exactly at the limit price. Make sense?

Since you are Auto-Trading, limit order slippage is the only explanation that I can think of why the order wouldn't have been canceled (by design) after a partial fill.

profile picture

kcbars

#6
I don't have slippage enabled, and I let it run on live data again for a while. Sometimes the partial fill order gets canceled, sometimes it doesn't. So I'm not sure but will keep experimenting. Thanks for the reply.
profile picture

Cone

#7
Another [somewhat esoteric] explanation is if the partial fill was an "odd lot", i.e., less than 100 shares. In this case, the trade is not reported in the streaming feed and therefore it's not incorporated into the bar's price. Consequently, you could be partially (or even fully) filled with fewer than 100 shares, but if no 100+ share trade occurred at that price Wealth-Lab wouldn't recognize it.

Were the partial fills fewer than 100 shares? Is the Low of the bar on which the trade occurred at or below the limit price? Make sure to look at both prices (limit trigger and Low) at full precision.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).