2. You can save the tickcount / time to a variable and them compare to the current one to determine when to CancelOrder() - http://www.ninjatrader-support.com/H...ncelOrder.html
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
get status of position
Collapse
X
-
1. Yes, this is expected, the CurrentBar leading to the signal is then still developing, thus signals can come and go as the bar nears completion.
2. You can save the tickcount / time to a variable and them compare to the current one to determine when to CancelOrder() - http://www.ninjatrader-support.com/H...ncelOrder.html
-
setstoploss vs longenterstop
Hello
I am debating which is the safest way to go using setstoploss or longenterstop.
Are they identical in handling complex situations?
Comment
-
There are differences between the two but it will depend on what you're looking for.
Set statements are automatically applied upon entry execution, and can be more convenient as they will be valid until the position is closed.
Exit statements provide you with flexibility and you can expose more information regarding individual orders. This gives you a greater level of control but also requires an understanding of how to setup IOrder objects, issuing cancelorder statements, and resetting values when in a terminal state.
It's a matter of convenience versus control and steeper learning curve.Ryan M.NinjaTrader Customer Service
Comment
-
-
sergeysamsonov,
This depends on what exactly you mean. You can definitely have a SetProfitTarget() and a SetStopLoss() on a single entry signal. You will not be able to have two SetStopLoss() orders on a single entry signal though.
If you want to scale out with multiple stops or targets you would need to break apart your entry into multiple entry signals to match the number of exit pairs you want to use.Josh P.NinjaTrader Customer Service
Comment
-
I have three position in the same direction with different position_name and I have three different setstoploss (position_name = "1","2","3"):
SetStopLoss(position_name,CalculationMode.Price,po sition_stop_price);
The manual says: Should you call this method to dynamically change the target price in the strategy OnBarUpdate() method, you should always reset the target price/offset value when your strategy is flat otherwise, the last price/offset value set will be used to generate your profit target order on your next open position.
Question: If I have EnterLong("1") (meaning I am not flat anymore) executed with position_name="1", can I still reset SetStopLoss(position_name,CalculationMode.Price,po sition_stop_price); with position_name=2 before submitting EnterLong("2") but after submitting EnterLong("1") ?
Comment
-
partial fill
Hello
A few more questions.
Let's say I placed an order EnterLong(100,"E1") and the order was filled in three partials 30+60+10.
If I monitor the execution of this order from OnExecution:
Q1. Do I get 3 or 4 filled statements (3 part filled and then 1 filled) or just 3 part filled?
Q2. If every time I check order.Filled value do I get 30,60,10 or I get 30, 90, 100 (cumulative).
Q3 If from OnExecution on part filled and filled every time I send ExitLongLimit("E1"), does it update amount automatically?
Q4. How do I submit OCO orders for pair ExitLongLimit and ExitLongStop?
Comment
-
follow up
I also would like to know what happens with order.Amount when I have "partial filled" in OnExecution
Comment
-
Sergey, sorry not sure what you refer to order.Amount by, perhaps order.Quantity?
You would get partial state for the IOrder, until the final 10 produces the fully filled state.
The order filled for original entry order would be cumulative after each partial fill received.
Not sure I follow on your Q3, IPosition would be updated for scaleouts -http://www.ninjatrader-support.com/HelpGuideV6/IPosition.html
You would supply the OCO logic yourself in the code, when for example the stop reports filled, you CancelOrder() the target.
Comment
-
I guess it is impossible to have multiple IPosition objects within one strategy?
I place two EnterLong orders and try to monitor them independently (scaleouts and so on), in this case it would be nice to attache IPosition object to each EnterLong order.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
630 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
364 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
105 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
565 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
568 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment