Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with orders

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

    Problems with orders

    I use de UNMANAGED APPROACH and I have the next problem:

    - I open a short order at 1,34 (EURUSD). When this order gets executed I sent a SLOrder at 1,35 (signal name SL1).

    - When the previous order is still active I open a new short order at 1,33. When this order gets executed I sent a SLOrder at 1,34 (signal name SL2).

    Then, with the two short orders opened, as price reaches the 1,34 level, a SL order gets executed.

    The problem is that the SLorder executed is the one I named SL1 that was supposed to execute at 1,35. This fact makes the back test useless.

    I would like close instead of FIFO, close with the LIFO method.

    Is this posible?

    #2
    Hello CJS,

    Where in the platform are you interpreting the FIFO LIFO pairing?

    In unmanaged system there is no pairing of entries and exits by signal name. There is only submit order, change order, cancel order.

    If you would like to pair exits with specific entries, then the managed order system can do this.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Let's detail the thing:

      As the first short order gets executed I submit a SL order at 100 pips above the entry price and a Signal name "SL1"

      While fisrt short order, and the "SL1", are still active, a second short order gets executed and, at that moment, I submit another SL order at 100 pips above the entry price and a Signal name "SL2" .

      As soon as the price achieves to the "SL2" level ("SL1" is working cose price went down without filling "SL1", in fact price is 100 pips from "SL1"), the platform in doing the next:

      Closing the first short order at the level of the "SL2". So, "SL2" is executed at a diferent stop price level that was submitted with as a aparameter. The platform in "mixing" signal names with stoplevels.

      I call this "FIFO".

      Tha unmanaged approach does nor pair orders, but it seems to follow some kind of order to close orders.

      The manage aproach has the internal handling rules wich make it uselees for my systems based in placing different stop & limit orders above and below price

      Comment


        #4
        There is no configuration available for changing FIFO here. The first trade made is closed with the first exit.

        It depends what you want to do with this though, because you can custom code to get the values you want. If you want to track PnL as LIFO then work off the fill price of specific orders and calculate this on your own.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the answer.

          I've been thinking about it, but I do not figure out how to make it possible.

          Could you give a quick example or a bit of more of information about your point?

          Thanks in advance

          Comment


            #6
            Sure, but it really depends what you're trying to achieve. When both positions are closed the realized PnL will be the same whether you use FIFO or LIFO.

            Each order you submit can have an IOrder object associated with it. You can expose the fill price from these orders with IExecution interface.

            E1
            E2
            S1
            S2


            For PnL on this trade, take S2 fill price - E2 fill price.
            Ryan M.NinjaTrader Customer Service

            Comment


              #7
              "When both positions are closed the realized PnL will be the same whether you use FIFO or LIFO."

              Well, I do not agree with that statement. Imagine the example of my previous post of this tread:

              You have 2 short orders and 100 pips range between them both. Each order with a 100 pips SL and a 200 pips TP.

              With the FIFO you can have 2 stops out (net=-200 pips)

              But, with the LIFO, the same movement of price can finish with one TP (the first short open) and one SL. (net=+100 pips)

              This would happen if once the second short gets triggered, price retraces back 100 pips and, cose of FIFO, close the very first short. Then price move 200 pips in favor. Here the first short would have get its TP. However, cose FIFO this first order was closed. Then price retraces back 200 pips more and the last SL gets executed.

              So, here you hava an scenario where FIFO and LIFO makes a big difference. And This is why my back test is nor valid.

              Comment


                #8
                I don't see where you get different PnL with these different trade pairing techniques. While the trade is going on, the Open PnL will for sure be different when using FiFo or Lifo. But points aren't somehow created when the positions is closed. Sorry, I don't follow your scenario where this is the case.

                E1 - 100
                E2 - 150
                S1 - 300
                S2 - 200

                Fifo:
                (200 - 100) + (300 - 150) = 250

                Lifo:
                (200 - 150) + (300 - 100) = 250
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Hi,

                  In order to understand your point correctly, could you explain your system?

                  What does E1,E2, S1,S2 mean? Could you kindly explain this example with real levels (for example: this first short is open at 1,43 with 100 pips SL and 200 pips TProfit,........

                  Thanks for your patience!!.

                  I would like also you to take a look at the attached file. I am probably missing something, but, in my opinion this is an scenario where applying FIFO or LIFO makes a big diference.

                  I wait for your feed back.
                  Attached Files

                  Comment


                    #10
                    Those represent entry point and exit levels. In your picture, you get more points because your target is in a different place. The issue then becomes effective management of your target orders and not trade pairing. Since you're using unmanaged system, there's nothing tying your target order to the original entry. You can cancel or modify your target orders while you're in a trade.
                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      "You can cancel or modify your target orders while you're in a trade"

                      Well, It does not help. This do not change the fact that the first order is the one that will be close first.

                      My picture is just a really really simple example. My trading is based in multiple orders, with diferent SL & TP each. I trade a simple and custom variation of grid trading.

                      NT is quite powerful for systems based in indicatos and patterns based in candlestick and OHLC. But, NT is quite rigid and limitated when trying to create strategies based on managing stops & limit orders.

                      I have spent 80 % of the time trying to get over the limitacions that NT has with the order handling.

                      Well, thanks anyway

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      648 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      369 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      108 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      572 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      573 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X