Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order and Order Management Clarification Needed

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

    Order and Order Management Clarification Needed

    Hello to All,

    I am looking for clarification on several points on how to handle different situations. Also seeking to make sure that I have the correct understand how things work under the hood.

    Currently I am using version 7 of ninja trader and running my strategy on the Sim101 account. At some point I would like to move over to live trading with FXCM.

    I have been going over the docs for the past couple of days, to the point where my strategy does places trades. When it comes to Stop Loss, Take Profits and Entering on a limit or stop I am still confused.

    Currently I am using the Unmanaged methodology because I think it is the proper methodology to be able a finer control of my orders and to facilitate when looking at historical trades being able to know which trades came from which strategies that I am running.

    What I am used to when placing an order is something along the lines of Entry Price, Stop Loss Price and Take Profit Price of depending on the broker submitting then entry order and then after that submitting the order to set the stop loss and take profit.

    When using the SubmitOrder() function and for OrderType it has 4 different types; OrderType.Market doesn’t require any explanation. But the other 3 Limit, Stop and StopLimit have me confused. Is the Limit just a BuyLimit? And that’s why there is a StopLimit and is the Stop OrderType for both a BuyStop and a Sell Stop??

    Also in a SubmitOrder() there is a Limit Price and Stop Price I would say that these are the Buy/Stop Limit Price and the Buy/Sell Stop Prices, but in the function docs for ChangeOrder() it leads me to think that the Limit Price = Take Profit and the Stop Price is the Stop Loss.

    Can someone please explain these options?

    I am thinking that I should be using OnExecution() to do Stop Loss and Profit Taking Change Submissions and OnOrderpdated() to do Error and order Rejection is this the best mindset to have?

    I am assuming that once and order has been submitted it creates a new IOrder object to be returned and that is why we can add them to a list collection to track them.

    Concerning the OrderState of an IOrder Object, I think I understand all of them but the working state, what is that?

    What is the order of states after an order is submitted; here is what I think it is please correct me if I have it wrong
    1 Order Submitted
    2 Pending Submit, Change or Cancel
    3 Accepted or Rejected
    4 Canceled, Filled or Partial Fill

    If I have multiple strategies running on the same instrument and timeframe how does the Position Object and Trade Objects know which positions and trades belong to which strategies?

    In the docs for OnPositionUpdate() it states whenever a position state changes this event is fired, are these the same states as the IOrder Object?

    Thank you for your Time
    EK

    #2
    Hello Emerald King,
    Thanks for your note.

    To specify whether the limit (or stop) order is a buy or a sell, please use the OrderAction variable.

    For example if you want to place a buy limit order then please use the below code
    Code:
    SubmitOrder(0, [B]OrderAction.Buy[/B], OrderType.Limit, 1, Close[0] - TickSize * 10, 0, "", "LONG");
    A stop order can be 2 type. A stop market order or a stop limit order. If you want to place a stop market order then please use OrderType.Stop else if you want to place a stop limit order then please use OrderType.StopLimit

    In the ChangeOrder method just assign the necessary price for the order.

    I would suggest going through our help guide to know more about the methods



    Yes, you can place the stop / target order via OnExecution. OnOrderUpdate event is where you can handle the order rejection / cancellations.

    Yes, you can assign an IOrder object while submitting the orders. You can store it in a list for future reference.

    Please refer to our help guide to know more about the various order states.



    The Position class will reflect the positions taken by that strategy only. It will not show any position taken by any other strategy.

    Yes, OnPositionUpdate will reflects the change in OrderState

    Please let me know if I can assist you any further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hello Joydeep

      Thank you for taking the time to clarify things for me. I will study more code examples and the docs as I progress

      Thanks
      EK

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X