Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Using IOrder in a Strategy
Collapse
X
-
Using IOrder in a Strategy
I have read the information in your help guide regarding IOrder and IPosition. I am still confused as to the exact text to use in the code. WHat I would like to do is Modify the stoploss oder for a specific entry order which I have "tagged" during the entry code.Tags: None
-
clfield,
Welcome to the NinjaTrader Support Forums. What you want to do does not require IOrders. Please check out this reference sample: http://www.ninjatrader-support2.com/...ead.php?t=3222Josh P.NinjaTrader Customer Service
-
I have a strategy that will enter two positions,"Proffit1" which has a fixed stoploss order set in the initialize section and "Proffit2" which I set and modify the stopLoss for in the BarUpdate section.
I want to be able to enter a second set of orders "Proffit3" and Profit"4" before the first set of orders have reached their respective targets. "Profit 3 would have a fixed stoploss set in the initialize secxtion. My problem is in managing the "proffit4" Stoploss order independent of the "Profit 3" Stoploss order.
I have been trying to use the Average entry price to determine my breakeven, however this price is the average of the 4 orders after the 2nd set of orders is placed.
I found the "Client" class in the NT help section and was hoping I could use the AvgFillPrice(string orderId) to get the average price for each descreet entry and the OrderStatus(string orderId) to detemine when the order had been filled. But the help section does not shpw any examples and I am not sure of the exact code needed.
Thanks for you help
Comment
-
clfield,
You should be able to manage each one individually. Please use unique Entry Signal names for each and then you can distinguish which profit target goes with which entry order. To figure out your breakeven for the fourth order you will just need to run your own calculation by hand. If your fourth order has an IOrder attached to it you can access the fill price of that IOrder object. myOrder.AvgFillPrice will do the trick.Josh P.NinjaTrader Customer Service
Comment
-
Please elaborate on myOrder.AvgFillPrice will do the trick. Is this an Iorder Object? I have done a fair amount of programming but this part of it just seems to be a morass. It would be extremely helpful if one could access the state of an order and the average fill price without having to write 400 lines of code.
Comment
-
It is a property of the IOrder object. Please see the Help Guide for more information here: http://www.ninjatrader-support.com/H...V6/IOrder.htmlJosh P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment