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.
    Ryan S.NinjaTrader Customer Service

    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?
        Ryan S.NinjaTrader Customer Service

        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 cmtjoancolmenero, Yesterday, 03:58 PM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by benmarkal, Yesterday, 12:52 PM
          3 responses
          23 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by helpwanted, Today, 03:06 AM
          1 response
          20 views
          0 likes
          Last Post sarafuenonly123  
          Started by Brevo, Today, 01:45 AM
          0 responses
          11 views
          0 likes
          Last Post Brevo
          by Brevo
           
          Started by pvincent, 06-23-2022, 12:53 PM
          14 responses
          244 views
          0 likes
          Last Post Nyman
          by Nyman
           
          Working...
          X