Order Execution Process - futures io
futures io futures trading



Order Execution Process


Discussion in NinjaTrader

Updated by GSREDDY
    1. trending_up 2,110 views
    2. thumb_up 0 thanks given
    3. group 0 followers
    1. forum 1 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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.

Reply With Quote

Can you help answer these questions
from other members on futures io?
I have segregated my investment and trading
Psychology and Money Management
Tracking passive Buyers/Sellers on footprint
Traders Hideout
Where I can find knoxville divergence indicator for ninja trader 8?
NinjaTrader
Thinkscript for scanning in Option Hacker
ThinkOrSwim
QDEL
Stocks and ETFs
 
Best Threads (Most Thanked)
in the last 7 days on futures io
VWAP for stock index futures trading?
43 thanks
VWAP oscillator for NT8
15 thanks
Battlestations: Show us your trading desks!
12 thanks
Price Action Kewltech Style
7 thanks
Index options vs futures options
7 thanks
 
(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.
Reply With Quote


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


September 19, 2012


Upcoming Webinars and Events
 

An Afternoon With futures io member TropicalTrader

Elite only
     



Copyright © 2020 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