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 CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
23 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
186 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|
||
|
Started by CaptainJack, 04-24-2026, 11:07 PM
|
0 responses
345 views
0 likes
|
Last Post
by CaptainJack
04-24-2026, 11:07 PM
|
||
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
267 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|

Comment