Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to close a specific order and keep open the rest

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

    How to close a specific order and keep open the rest

    Hi All

    I am starting in ninjatrader and I cannot understand how to manage entries and exit order. For example if I open several long positions I cannot see separately these positions, I am watching an average price. How can I keep separately these positions and how can i choose to close a specific one and keep the rest?

    I am speaking about a strategy where I open 3 positions of 1 contract and I can close them one by one by ATM strategy but I cannot find the way to close them one by one manually.

    Merry Christmas!!!!

    #2
    Hello J2512 ,

    Thank you very much for your post and welcome to the NinjaTrader Forums!

    There are various ways to 'scale out' of an order, depending on where the order was submitted.

    On the ChartTrader, for example, you could change the quantity to a lower number before manually submitting a market order, which would then scale you out of the existing ATM strategy and also close the stop loss with it.

    For a brief visual example of how this would look, please take a look at the video below:

    World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


    Please know that scaling into an order (as shown in the example) would add this quantity to an existing exit order, and would not submit an additional order. Furthermore, this behavior would only apply with the default ChartTrader settings.

    To open these settings, please right-click on the ChartTrader background and select "Properties". The "ATM Strategy Selection Mode" would then set whether you scale in and out of an existing ATM strategy by default, or whether NinjaTrader will submit a new ATM strategy for each submission. Further information about these settings may be found in our HelpGuide:



    Last but not least, I would also suggest the following two YouTube videos. These are recordings of our ATM 201 and ATM 301 webinars (30 and 45 minutes, respectively). They address all features of the ATM strategy and should assist you in answering any further questions you might have:

    ATM 201: https://www.youtube.com/watch?v=Gnyx8RSp3EI
    ATM 301: https://www.youtube.com/watch?v=DH9y-j64X1U

    Should you have any further questions in this regard, please don't hesitate to let me know!

    Comment


      #3
      Hi Manfred

      Thanks for your response. The info provided is so useful for me.

      Let me explain the situation that I would like to manage, while price is decreasing I open 3 long positions, first at 4000, second at 3950 and the third at 3900, when the price go up I would like to close the third order at 3950, the second at 4000 and the first at 4050, how can I do it, I mean, How Can I close manually firtsly the last order opened, without using ATM strategy.

      Best Regards.

      Comment


        #4
        Hi Manfred

        As summary, Is it possible to choose a specifici order opened in order window and close it, even if that is not the first order opened?

        Best Regards.

        Comment


          #5
          Hello J2512 ,

          Thank you very much for your reply.

          As a basic rule, NinjaTrader would always close the first open order first (first-in-first-out).

          However, this might differ based on the brokerage and how they report orders.

          In short, when NinjaTrader closes a position it does not actually close a specific position but instead submits an additional order in the opposite direction. If this lowers your quantity, it would then be considered scaling out / closing a position.

          The important part to understand here is that the overall profit and loss would not differ, regardless of how the executions are grouped into corresponding orders.

          To give you an example, I'm going to use the following setup:
          • Entry 1 - 1 buy at $100
          • Entry 2 - 1 buy at $150
          • Exit 1 - 1 sell at $120
          • Exit 2 - 1 sell at $110
          If we now combine the first entry with the first exit order, we would receive a profit of $20, whereas Entry 2 to Exit 2 results in a loss of $40, bringing the overall P&L to -$20.

          If we instead combine Entry 1 with Exit 2, we would now have a profit of $10, whereas Entry 2 to Exit 1 produced a $30 loss, resulting in the same $20 loss.

          To come back to your original question; If you submit three individual orders (e.g. at 4000, 3950, and 3900), you would not have a direct way to define which order is closed first. Instead, an order would be submitted to short 1 contract, resulting in you now holding 2 remaining contracts.

          While NinjaTrader would calculate the average value based on the two remaining orders, following the first-in-first-out principle (to my understanding this is also how most brokerages handle it), it might be that these trades are paired differently on your brokerage statement.

          The underlying results, however, should always be identical. This means that once you are flat, the profit/loss shown in NinjaTrader should be identical with your statement.

          I hope this explains a bit better how these trades are paired. Should you have any further questions, please don't hesitate to let me know!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          48 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X