NexusFi: Find Your Edge


Home Menu

 





Strategy stop orders partially filled


Discussion in EasyLanguage Programming

Updated
    1. trending_up 379 views
    2. thumb_up 0 thanks given
    3. group 4 followers
    1. forum 8 posts
    2. attach_file 3 attachments




 
Search this Thread
  #1 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 19 since Apr 2023
Thanks Given: 1
Thanks Received: 0

I have started testing a strategy in real-time, and every now and then I have some stop orders that will only get partially filled.
My trade manager tabs confirms this, which I have attached a photo of. Usually, the orders are filled as expected.
I thought that maybe there was a setting I was missing, but couldn't find anything relevant to the issue.

The commands being used are:
buy("B") 1000 shares next bar at n_price Stop;
sell("SL") 1000 shares next bar at n_price Stop;

Each order command is being issued when conditions are met.
IOG is being used, so "next bar" means next tick in my case.

Unless I am not understanding how these behave in real-time, I can't wrap my head around why these would be getting partial fills!
Shouldn't they always be filled, at whatever available price?

Thanks for any help in advance!

Attached Thumbnails
Click image for larger version

Name:	orders.png
Views:	37
Size:	17.9 KB
ID:	339192  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Has anyone taken The Confident Trader course from aheadc …
Trading Reviews and Vendors
What You Know vs How much you know about it
Traders Hideout
Quantum physics & Trading dynamics
The Elite Circle
tick data interval discrepancy
NinjaTrader
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
ApexTraderFunding.com experience and review
91 thanks
HumbleTraders next chapter
73 thanks
Winning attitudes create winning traders
39 thanks
Just another trading journal: PA, Wyckoff & Trends
32 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
28 thanks
  #2 (permalink)
toucan94506bm
danville ca usa
 
Posts: 80 since Aug 2015
Thanks Given: 49
Thanks Received: 76

I suspect that your order uses up all the shares at n-price before filling the entire order #shares..

Reply With Quote
  #3 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 19 since Apr 2023
Thanks Given: 1
Thanks Received: 0



toucan94506bm View Post
I suspect that your order uses up all the shares at n-price before filling the entire order #shares..

Maybe I'm not understanding how strategies interpret these buy/sell commands.
N-price is merely the price that a market order is triggered upon. Shouldn't the entire order be filled regardless of the price its being filled at, once the target price(n-price) is traded?

Reply With Quote
  #4 (permalink)
toucan94506bm
danville ca usa
 
Posts: 80 since Aug 2015
Thanks Given: 49
Thanks Received: 76

You could be right I thought buy (B) was like a buy limit order and sell (SL) was like a stop market order... I haven't used strats for orders in a long time

Reply With Quote
  #5 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 19 since Apr 2023
Thanks Given: 1
Thanks Received: 0

On further inspection, I came across an older post where someone had mentioned being able to diagnose issues from the messages tab in the trade manager window.
Turns out this message log shows a lot of information I wasn't aware of.

I've attached those messages, regarding partial fill trades that were made today.
Although I haven't been able to decipher what has been happening from the message log, I'm hoping this will some shed light on the issue.
The log shows all the events when entering a long position, with a partial fill, and then selling that same position. At end of the trade, I had bought 600 shares and then sold 600 shares, even though I was using a stop market order for 1000 shares, as shown in the log.

The events are in ascending chronological order, as shown in the time stamp.
For some reason, one of the messages was exported out of order. Not sure what thats about!

partial fills

Reply With Quote
  #6 (permalink)
toucan94506bm
danville ca usa
 
Posts: 80 since Aug 2015
Thanks Given: 49
Thanks Received: 76

Agreed.. I always keep this up as well as open orders and open positions... Just to be sure I don't f#$k anything uP.. Especially when I quit trading for the day

Cheers toucan

Reply With Quote
  #7 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 19 since Apr 2023
Thanks Given: 1
Thanks Received: 0

FWIW, I asked ChatGPT about this, just to see what it might have to say and not really expecting it to provide anything helpful.
Turns out it did! Although due to the nature of a market order, it still doesn't make sense to me why I wouldn't get fully filled, every time.


Quoting 
QUESTION: WITHIN MY STRATEGY, THERE ARE ORDER BEING PLACED WITH THE "BUY" COMMAND, WHICH IS A SPECIFIC RESERVED WORD IN EASYLANGUAGE THAT INITIATES A MARKET BUY ORDER. WHY DO ORDERS SOMETIMES GET PARTIALLY FILLED, EVEN THOUGH THEY ARE MARKET ORDERS? SHOULDNT ANY ORDER MADE WITH THE "BUY" COMMAND ALWAYS BE FILLED REGARDLESS OF THE PRICE THEY ARE BEING FILLED AT?

ANSWER: When you place a market order using the "BUY" command in EasyLanguage, it should indeed be filled immediately at the best available price. However, there are a few reasons why market orders can sometimes be partially filled:

Market Liquidity: If there is insufficient liquidity at the current market price, your order may only be partially filled until more shares/contracts become available. This is more common in less liquid markets or with large order sizes.

Order Size vs. Available Volume: If your order size is larger than the volume available at the best price, your order will be filled at multiple price levels. This can lead to partial fills until the entire order is completed.

Market Conditions: During periods of high volatility, prices can move quickly, and the available volume at each price level can be consumed rapidly, leading to partial fills.

Broker and Exchange Practices: Different brokers and exchanges handle market orders in slightly different ways, which can sometimes result in partial fills.

Here are a few tips to help manage and potentially mitigate partial fills:

Check Liquidity: Ensure you are trading in a market with sufficient liquidity to handle your order size.

Order Size: Consider breaking large orders into smaller chunks to improve the likelihood of full fills at desired prices.

Limit Orders with Slippage Tolerance: If partial fills are a significant issue, consider using limit orders with a tolerance for slippage, although this doesn't guarantee a fill like market orders.

Trading Times: Trade during times of higher volume, such as market open or close, to increase the likelihood of full fills.


Reply With Quote
  #8 (permalink)
 kevinkdog   is a Vendor
 
Posts: 3,668 since Jul 2012
Thanks Given: 1,893
Thanks Received: 7,377

I would not trust SIM in Tradestation to be accurate, based on my experience.

Since you are using IBOG, it could be that the order does not get regenerated at next tick.

I would ask this in the Tradestation forum, since Tradestation employees answer questions there.

Follow me on Twitter Reply With Quote
  #9 (permalink)
nfgrufio
Atlanta, GA
 
Posts: 19 since Apr 2023
Thanks Given: 1
Thanks Received: 0


kevinkdog View Post
I would not trust SIM in Tradestation to be accurate, based on my experience.

Since you are using IBOG, it could be that the order does not get regenerated at next tick.

I would ask this in the Tradestation forum, since Tradestation employees answer questions there.

It looks like this setting might be the issue, according to your comment.

I have this setting turned off, based on my original logic of "market orders will always be filled, at whatever available price, so this must be an unrelated setting".

I guess the statement still stands true about always being filled, UNLESS you are telling TS not to continue trying to fill the order(market or stop) after the current bar/tick has expired.

Reply With Quote




Last Updated on June 12, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts