Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Lifo/fifo

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

    Lifo/fifo

    UPDATE: It does not work in live-mode. Orders are executed as FIFO, regardless of the unique ID's I give them. Bummer!

    ------------------------

    I have a question regarding LIFO/FIFO.

    So I'm running an FX automated strategy with FXCM. I enter multiple positions from the same side (long). Each order is assigned a unique ID (Long0, Long1, Long2 etc). I have a specific profit target for each order.

    Situation:

    I have EURUSD Long0 open at 1.1050 with a proft target of 1.1075. I also have Long1 open at 1.0990 with a profit target of 1.1015. Now Long1 hits profit target of 1.1015.

    Question:
    Does Long1 in fact get closed and Long0 still be open? (LIFO). Or does in fact Long0 be closed for a loss and Long1 still be open (FIFO).

    I ran it through the backtest and then it seems it runs LIFO, so it respects each individual profit target and closed accordingly. But I wonder how it goes in reality.

    Thanks!
    Last edited by siroki; 07-16-2015, 04:51 AM.

    #2
    Hello,

    Thanks for your reply.

    That is correct. FIFO will always be the case although your stops/targets will work as programmed. This is to ensure you get the best fills possible.
    BrandonNinjaTrader Customer Service

    Comment


      #3
      What do you mean by stops/targets will work as programmed? When Long1 is running into a loss and Long2 is almost hitting target of +10 pips, I see that Long1 is closed in stead of Long2. So the FIFO works, but the targets (which are set by uniqueID) as not really working as programmed. At least not for the intended position

      Comment


        #4
        Hello siroki,

        Thanks for your reply.

        Your orders will fill based on market conditions at their placed values. The position they exit will always be FIFO.
        BrandonNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Jon17, Today, 04:33 PM
        0 responses
        1 view
        0 likes
        Last Post Jon17
        by Jon17
         
        Started by Javierw.ok, Today, 04:12 PM
        0 responses
        4 views
        0 likes
        Last Post Javierw.ok  
        Started by timmbbo, Today, 08:59 AM
        2 responses
        10 views
        0 likes
        Last Post bltdavid  
        Started by alifarahani, Today, 09:40 AM
        6 responses
        40 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        19 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X