Order Execution Process - futures io
futures io futures trading



Order Execution Process


Discussion in NinjaTrader

Updated
    1. trending_up 2,164 views
    2. thumb_up 0 thanks given
    3. group 0 followers
    1. forum 1 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Order Execution Process

(login for full post details)
  #1 (permalink)
sanfrancisco
 
Experience: Advanced
Platform: Ninjatrader,TS,IRT
Broker: IQfeed
Trading: ES
 
Posts: 45 since Feb 2012
Thanks: 26 given, 21 received

Hi,
I am trying to understand the IOrder object OrderState property. It will be great if you can clarify below questions along with the below example process.

With the unmanaged approach, strategy prevents internal signal tracking and internal order handling rules. Is this correct?
Can you please suggest the best place to submit the profit target and stop loss orders and explain why you think that is the best method to submit PT and Stop loss orders?

Example process: we have a working order in the exchange with quantity 20 submitted from ninja strategy using unmanaged approach and gets below partial fills to fill the total quantity and an over fill, can I expect below IOrder object properties in onOrderUpdate and iexecution object properties in OnExecution methods? Correct me if I am wrong.

Fill 1: market has filled 2 out of 20.
Broker Account will have 2 filled quantity and working order for 18 in the exchange
At what point of time strategy quantity will get updated with this partial fill 2 quantity?

As soon as 2 quantity gets filled in the exchange, I am expecting below sequence of calls will get executed in the order in the strategy.

Call 1: OnOrderUpdate(IOrder order) method will get called with below IOrder object properties.
order .OrderState == OrderState.PartFilled
order. Filled == 2
order. Quantity == 20
order. OverFill == False

Call 2: After the OnOrderUpdate call, strategy will call OnExecution(IExecution execution) method
Case 1: assuming No fill (in flight) between Call 1 and Call 2
execution.Order.OrderState == OrderState.PartFilled
execution. order. Filled == 2
execution. order. Quantity == 20
execution. Quantity == 2
execution. order. OverFill == False
Case2: assuming 3 more quantity got filled between call 1 and call 2 or during the execution of Call 1 (In Flight Fill)
execution.Order.OrderState == OrderState.PartFilled
execution. order. Filled == 5 (2 + 3) ??
execution. order. Quantity == 20
execution. Quantity == 5 ( is this correct ??)
execution. order. OverFill == False

at what point of time OnOderUpdate will be called for this 3 quantity? Are there any important properties that I am missing other than price related?

Assuming market has filled 16 quantities during the process and left with final 4 quantity.

Final Fill : remaining 4 quantity got filled ( total order quantity got filled)
Call 11: OnOrderUpdate(IOrder order) method will get called with below IOrder object properties.
order .OrderState == OrderState.PartFilled ( is this OrderState.PartFilled or OrderState.Filled ?)
order. Filled == 20 ( is this 4 or 20?)
order. Quantity == 20
order. OverFill == False
Call 22: After the OnOrderUpdate call, strategy will call OnExecution(IExecution execution) method
execution.Order.OrderState == OrderState.PartFilled
execution. order. Filled == 20
execution. order. Quantity == 20
execution. Quantity == 4
execution. order. OverFill == False

do I need to compare order. Filled with order. Quantity to check whether the complete order quantity got filled or not in OnOrderUpdate or in OnExecition methds?

Assuming quantity 5 got filled instead of remaining 4 quantity ( Over Fill case)
Call 111: OnOrderUpdate(IOrder order) method will get called with below IOrder object properties.
order .OrderState == OrderState.PartFilled
order. Filled == 21
order. Quantity == 20
order. OverFill == True
Call 222: After the OnOrderUpdate call, strategy will call OnExecution(IExecution execution) method
execution.Order.OrderState == OrderState.PartFilled
execution. order. Filled == 21
execution. order. Quantity == 20
execution. Quantity == 5
execution. order. OverFill == False

sorry for the long list of questions, I am trying to understand the execution process before I design and code order executions in my strategy.

Thanks
gsreddy.

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(167 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(116 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(31 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
sanfrancisco
 
Experience: Advanced
Platform: Ninjatrader,TS,IRT
Broker: IQfeed
Trading: ES
 
Posts: 45 since Feb 2012
Thanks: 26 given, 21 received

Hi,

below sample output may help order execution process with partial fills.

OnBarUpdate entryOrder Qty :100 Fill Qty: 0
OnOrderUpdate entryOrder Qty :100 Fill Qty: 0 Order State :PendingSubmit
OnOrderUpdate entryOrder Qty :100 Fill Qty: 0 Order State :Accepted
OnOrderUpdate entryOrder Qty :100 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 6 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 6 Order State :PartFilledExecution Qty6
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :6 Stop Price: 0 Fill Qty: 0 Order State :PendingSubmit
OnOrderUpdate stopOrder Qty :6 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :6 Stop Price: 1465 Fill Qty: 0 Order State :PendingSubmit
OnOrderUpdate targetOrder Qty :6 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :6 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 9 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 9 Order State :PartFilledExecution Qty3
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :9 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :9 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :9 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :9 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :9 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 12 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 12 Order State :PartFilledExecution Qty3
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :12 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :12 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :12 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :12 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :12 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 20 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 20 Order State :PartFilledExecution Qty8
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :20 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :20 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :20 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :20 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :20 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 30 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 30 Order State :PartFilledExecution Qty10
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :30 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :30 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :30 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :30 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :30 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 37 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 37 Order State :PartFilledExecution Qty7
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :37 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :37 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :37 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :37 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :37 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 44 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 44 Order State :PartFilledExecution Qty7
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :44 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :44 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :44 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :44 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :44 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 54 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 54 Order State :PartFilledExecution Qty10
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :54 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :54 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :54 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :54 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :54 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 63 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 63 Order State :PartFilledExecution Qty9
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :63 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :63 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :63 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :63 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :63 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 72 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 72 Order State :PartFilledExecution Qty9
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :72 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :72 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :72 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :72 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :72 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 76 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 76 Order State :PartFilledExecution Qty4
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :76 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :76 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :76 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :76 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :76 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 78 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 78 Order State :PartFilledExecution Qty2
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :78 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :78 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :78 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :78 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :78 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 88 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 88 Order State :PartFilledExecution Qty10
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :88 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :88 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :88 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :88 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :88 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 91 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 91 Order State :PartFilledExecution Qty3
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :91 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :91 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :91 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :91 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :91 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 96 Order State :PartFilled
OnExecution entryOrder Qty :100 Fill Qty: 96 Order State :PartFilledExecution Qty5
OnExecution Stop and PT orders generated
OnOrderUpdate stopOrder Qty :96 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :96 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :96 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :96 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :96 Stop Price: 1465 Fill Qty: 0 Order State :Working
OnOrderUpdate entryOrder Qty :100 Fill Qty: 100 Order State :Filled
OnExecution entryOrder Qty :100 Fill Qty: 100 Order State :FilledExecution Qty4
OnExecution Stop and PT orders generated
OnExecution entryOrder to Null
OnOrderUpdate stopOrder Qty :100 Stop Price: 0 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate stopOrder Qty :100 Stop Price: 0 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :100 Stop Price: 1465 Fill Qty: 0 Order State :PendingChange
OnOrderUpdate targetOrder Qty :100 Stop Price: 1465 Fill Qty: 0 Order State :Accepted
OnOrderUpdate targetOrder Qty :100 Stop Price: 1465 Fill Qty: 0 Order State :Working

thanks
gsreddy

thanks,
GSREDDY.
Started this thread Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > Order Execution Process


Last Updated on September 19, 2012


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts