• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Field Questions

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Order Field Questions

    I am passing orders to brokerage via Ninjatrader from an external source using Account.Submit() and getting status back via Account.OrderUpdate.

    I need to be able to track an external identifier thru that process and wanted to ask some questions about Order fields that are not documented as far as I can tell.

    1. OrderId is supposed to be the brokerage id for the order, but it seems to be set even when the order is in Initialized state (before being sent), which would imply this is a Ninja id, not the brokerage id. Is this true? If so, is there any way to get the brokerage order id?

    2. ClientId is an undocumented long field. If I set this field, it seems to be carried thru the order process (except in the Initialized state when it is set to -1). Can this field be safely used for this purpose? If so, any reason it would not be set in the Initialized state (I set it it when passed to Submit, but first OrderUpdate has set to -1, subsequent OrderUpdates have properly set)?

    3. Similarly, there is an undocumented Id long field. Can this be used?

    4. Finally, there are two string fields, Name and FromEntrySignal. Can these be safely used to store order information thru the order update process?

    Thanks.

    #2
    Hello aslane,

    Thanks for your questions.

    1. OrderId is supposed to be the brokerage id for the order, but it seems to be set even when the order is in Initialized state (before being sent), which would imply this is a Ninja id, not the brokerage id. Is this true? If so, is there any way to get the brokerage order id?
    Adding prints for these properties in OnOrderUpdate can help to draw a bigger picture on how these properties can be used. For example, printing the OrderState and the OrderID, we can see that a NinjaTrader ID is given on Submitted, but when the Order comes back with an Accepted or Working State, we see the OrderID is reflective of what is being used at the broker/exchange.

    2. ClientId is an undocumented long field. If I set this field, it seems to be carried thru the order process (except in the Initialized state when it is set to -1). Can this field be safely used for this purpose? If so, any reason it would not be set in the Initialized state (I set it it when passed to Submit, but first OrderUpdate has set to -1, subsequent OrderUpdates have properly set)?
    I do not have any information on this property or its usage. I would not recommend using it to set your own values and would recommend using your own class level variables instead.

    3. Similarly, there is an undocumented Id long field. Can this be used?
    You are welcome to use this if you find an appropriate purpose. Prints will show that this value will increment with each order submitted.

    4. Finally, there are two string fields, Name and FromEntrySignal. Can these be safely used to store order information thru the order update process?
    As with number 2, I would not recommend using these properties to store information outside of the context of their design. I would instead recommend using your own class level variables to manage that information.

    I used the following print to observe this behavior in OnOrderUpdate. (This was used in the SampleOnOrderUpdate strategy testing against a paper trading account, but the application would be the same for using Account OrderUpdate events.

    Print(String.Format("State: {0} OrderID: {1} ClientID: {2} ID: {3} SignalName: {4} fromEntrySignal: {5}", order.OrderState, order.OrderId, order.ClientId, order.Id, order.Name, order.FromEntrySignal));

    Please let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by xsgex, Yesterday, 09:46 PM
    0 responses
    2 views
    0 likes
    Last Post xsgex
    by xsgex
     
    Started by Steve L, Yesterday, 09:36 PM
    0 responses
    1 view
    0 likes
    Last Post Steve L
    by Steve L
     
    Started by krugman25, Yesterday, 09:34 PM
    0 responses
    4 views
    0 likes
    Last Post krugman25  
    Started by indy73, Yesterday, 04:42 PM
    0 responses
    15 views
    0 likes
    Last Post indy73
    by indy73
     
    Started by Italianforex, Yesterday, 06:20 AM
    2 responses
    13 views
    0 likes
    Last Post gplatis
    by gplatis
     
    Working...
    X