Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Access working orders
Collapse
X
-
Thanks Bertrand.
Regarding the aforesaid sample code: the manual warns against using OnOrderUpdate() to track fills. I do not intend to track fills, but to capture each time the profit target and stop loss prices are updated via the SetStopLoss() and SetProfitTarget() methods.
Some questions:- I may use this info to make decisions in my strategy. Is it OK to use this method, or do you recommend calculating the price when I call SetStopLoss()/SetProfitTarget() manually? (i.e. infer the price from the ticks and the entry price)
- When is this method called? Just before the order is actually sent to the broker? Just after?
Thanks,
Boaz
Comment
-
Hi Boaz,
Yes, OnOrderUpdate() can be used to expose details about stop loss and profit target prices directly. For the most precision on the actual values, you can work directly there. There isn't one best way to do things, so if your self calculated values are accurate and work well in your strategy, can use those as well.
The OnOrderUpdate() method is called everytime an order managed by a strategy changes state. An order will change state when a change in order quantity, price or state (working to filled) occurs.
It will go through some order state changes before the order arrives to broker. Can see this page for the listing of these.
Last edited by NinjaTrader_RyanM1; 09-13-2011, 10:06 AM.Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by PaulMohn, Today, 03:49 AM
|
0 responses
3 views
0 likes
|
Last Post
by PaulMohn
Today, 03:49 AM
|
||
Started by inanazsocial, Today, 01:15 AM
|
1 response
7 views
0 likes
|
Last Post Today, 02:18 AM | ||
Started by rocketman7, Today, 02:12 AM
|
0 responses
10 views
0 likes
|
Last Post
by rocketman7
Today, 02:12 AM
|
||
Started by dustydbayer, Today, 01:59 AM
|
0 responses
2 views
0 likes
|
Last Post
by dustydbayer
Today, 01:59 AM
|
||
Started by trilliantrader, 04-18-2024, 08:16 AM
|
5 responses
23 views
0 likes
|
Last Post Today, 12:32 AM |
Comment