Did you see my previous reply? Let's isolate to one sample at a time. Break down the steps needed to see an issue. If you made changes that make it easier to reproduce in real time, you can attach and will test here.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Reference sample question
Collapse
X
-
HI Ryan,
ok. I'll take one after the other the questions. my biggest problem is with the Reference Samples number 14. Using OnOrderUpdate() and OnExecution() methods to submit protective orders and 16. Using CancelOrder() method to cancel orders.
when I'd like run real-time gives me constantly errors. as can be see under picture 1 and 2. I've attached only to the original script: TraceOrders, and if (Historical) return; to run only in real time. the script are applicable to NT7. I attached the amended script.
question: why can give me this error? the problem can be at my PC? occur this at You? I give it on real-time data not only using MR.
thanks Tom (I hope I didn't ask lot at a time)Last edited by marotom; 06-03-2011, 09:27 AM.
Comment
-
Hi Tom,
The basic functionality of those samples is working for me here.
The message you're getting means that it's submitting at an invalid stop price and is rejected. To track this behavior you can use print statements and trace orders output.
Check the value of your orders compare to the last traded price. For sell stop orders, they should be below the last traded price.
If the message always comes on stop loss modification, maybe consider changing CalculateOnBarClose to false. Since it's currently set to true, it may be moving too late then and at an invalid price.Ryan M.NinjaTrader Customer Service
Comment
-
Hi Tom,
Yes, OnOrderUpdate() triggers when ever there is a change in order state. When you submit these orders, OnOrderUpdate is triggered for the first PendingSubmit. You could use something like this to check each time this triggers for an order.
protected override void OnOrderUpdate(IOrder order)
{
Print(order.ToString());
}Ryan M.NinjaTrader Customer Service
Comment
-
Hello,
could you clarify how does the OnOrderUpdate() work correctly?
I print an text within OnOrderUpdate() when the strategy open an position and the OnOrderUpdate() updates, and its name will change. but IOrder state changes will loop 4 times at open position, as can be seen on picture. is it routine procedure? should I calculate with this behavior extra info? what throws it?
I attached a picture and the script
thanks for answer. Tom
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment