So, what is the difference between NinjaTrader.Cbi.Order and NinjaTrader.Cbi.IOrder? Is the Order class implementing the interface IOrder?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
NinjaTrader.Cbi.Order vs. NinjaTrader.Cbi.IOrder
Collapse
X
-
NinjaTrader.Cbi.Order vs. NinjaTrader.Cbi.IOrder
I am getting an error "Unable to cast object of type 'NinjaTrader.Cbi.Order' to type 'NinjaTrader.Cbi.IOrder'"
So, what is the difference between NinjaTrader.Cbi.Order and NinjaTrader.Cbi.IOrder? Is the Order class implementing the interface IOrder? -
Hello,
Thanks for the forum post.
The difference is that iOrder object is supported and is how you get information on the order object and is a read only interface. The order object is one that is undocumented and not supported as to what you would use it for.
-BrettBrettNinjaTrader Product Management
-
The main issue here is that when a strategy ninjascript is running it create the order in the type of NinjaTrader.Cbi.IOrder, which is fine as long as this order turns into a position. However, if a strategy ninjascript is re-started after it exits or clashes or is down due to whatever reasons, the existing order can be identified in the account order collection, with the type of NinjaTrader.Cbi.Order.
Why do we have two class types of order if it means the same thing but lives in the different phase of its life cycle?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
662 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
376 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
110 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
580 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment