Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Fill Last in First out

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

    Order Fill Last in First out

    Is there a way to have Ninjatrader close the last contract opened instead of the first? What I want is that if I buy 3 MES contracts at 4680 and it dips and I buy another 3 at 4660. If I sell 3 at 4670 it will sell the 3 I bought at 4680 showing a realized loss of 150.00. I would like it to sell the 3 at 4660 and show I realized profit of 150.

    #2
    Hello,

    The simulation account will always us a first in first out (FIFO) accounting method for execution pairing. For live accounts this will be controlled by your broker.

    Comment


      #3
      Originally posted by NinjaTrader_RyanS View Post
      Hello,

      The simulation account will always us a first in first out (FIFO) accounting method for execution pairing. For live accounts this will be controlled by your broker.
      Would it be possible to add the numbered/ordered entry orders' corresponding Target/StopLosses to a list and then
      use logic to preset the order in which they would execute upon exit?

      Something like calling the latest order's Targets and StopLosses orders added to the list
      to be executed first upon exit?
      Then the 2nd latest order's Targets and StopLosses orders added to the list
      to be executed second upon exit?
      Then the 3rd latest order's Targets and StopLosses orders added to the list
      to be executed third upon exit? etc. for n number of entry orders.

      If so could you advise on what to be aware of / any sample / any specifics to take into account? Thanks!
      Last edited by PaulMohn; 06-21-2022, 02:51 PM.

      Comment


        #4
        Hello,

        Are you referring to adding logic/code to your script to accomplish this? Or code added to the platform itself to perform this logic?

        Comment


          #5
          Hello Ryan and thanks for the reply.

          Both or either which works. Better if we could do it directly with custom scripts. Thanks!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          55 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          37 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          17 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          19 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          49 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X