Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Average Price and Simulator Account

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

    Average Price and Simulator Account

    Consider the following example

    Buy 100 shares at $10
    Buy 100 shares at $11
    Sell 100 shares at $10.50 (price here is unimportant).

    NinjaTrader (by default I think), does Last In First Out (LIFO) for Average prices shown on the chart. For simplicity assume that everything is done with limit orders and fills at exactly the price the limit order specifies.
    LIFO FIFO
    Buy 100 shares @ $10 10.00 10.00
    Buy 100 shares @ $11 10.50 10.50
    Sell 100 shares @ $10.50 10 11
    For LIFO, step 3 involves selling off all shares at 11$ leaving an average price now of 10.
    For FIFO, step 3 involves selling off all shares at 10$ leaving an average price now of 11.

    When using a simulated account, and checking the box in the options "Use FIFO for position average price calculations" NinjaTrader shows exactly what is shown in FIFO column. With the option unchecked, the once the average price stays at 10.50, regardless of how much is sold.

    When in LIFO mode, the simulator only changes the average price when shares are added to the position. The average price never moves when shares are removed. For example consider
    1. Buy 100 shares @10 - NinjaTrader shows 10
    2. Buy 100 shares @11 - NinjaTrader shows 10.50
    3. Sell 50 shares @12 - NinjaTrader still shows 10.50
    4. Buy 100 shares @13 - NinjaTrader shows 11.33
    5. Sell 150 shares @14 - NinjaTrader shows 11.33
    The average prices for LIFO for above should have been
    1. 10
    2. 11.50
    3. 10.33
    4. 11.40
    5. 10
    By step 5, the only shares left are the $100 shares @ $10.

    Why does the average price never drop as one exits a position in LIFO mode?
    Last edited by ntbone; 10-26-2020, 10:53 PM.

    #2
    Hello ntbone,

    Unfortunately this is as expected. There is no LIFO mode. If "Use FIFO for position average price calculations" is unchecked, it will have the same average entry price when you scale out. Please see the information below from the help guide.
    https://ninjatrader.com/support/help...ns_trading.htm

    .
    Use FIFO for position average price calculations Sets if the position average entry price will be based on the FIFO (First in First Out) or if this will retain the average entry when scaling out. At this time this setting only affects the simulation account and requires reconnecting to go into effect. For live accounts, you would need to see if your broker can adjust this on their end.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Is there a feature request to implement LIFO? If not can we have one created. I realize that features will only be implemented based on demand.

      Comment


        #4
        I will forward your suggestion to support LIFO mode for the simulator to business development to put it on the list of possible future enhancements.
        JasonNinjaTrader Customer Service

        Comment


          #5
          I have the option for FIFO unchecked, and I thought it would at least execute as LIFO when executing but it looks like even executions for simulator are FIFO. If the option is unchecked will it change simulator execution?

          Comment


            #6
            Hello,

            Disabling FIFO will cause the sim account to keep the average entry price listed as positions are exited until the account is flat again in that instrument. LIFO is not possible within the platform for the simulation accounts.

            Please let us know if you have any other questions.
            Ryan S.NinjaTrader Customer Service

            Comment


              #7
              So execution is always FIFO regardless of that option?

              Comment


                #8
                Hello,
                If this is unchecked, the average position price will not change once exits are executed as it would with FIFO enabled. For instance, if 2 contracts are bought, one at 100 and then another at 105, the average position price would display as 102.5.

                With FIFO enabled, selling one contract would use the first entry price of 100 for pairing and then display an average position price of 105 for the remaining contract. If FIFO is disabled, it would still display 102.5 once the first contract was sold.

                Please let me know if I may assist further.
                Ryan S.NinjaTrader Customer Service

                Comment


                  #9
                  What it displays and the orders/executions it makes are two separate things. From what I have established

                  FIFO checkbox is checked, orders are executed FIFO and the price is adjusted
                  FIFO unchecked, the average price is displayed, but orders are still executed FIFO.

                  Comment


                    #10
                    Hello,

                    Correct, the sim accounts will always use FIFO for order pairing when possible, the option in the Tools menu simply changes how average position price is reported when scaling out.
                    Ryan S.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello ntbone,

                      The internal tracking number for your feature request is SFT-1417. We added your vote. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

                      When a feature request is implemented, you'll find a description of the new feature in the release notes:
                      JasonNinjaTrader Customer Service

                      Comment


                        #12
                        Does the FIFO average price calculation option exist in NinjaTrader 8? I can't seem to find this option in NT8, it seems to default to FIFO average price calculation with no other option?

                        Comment


                          #13
                          Hello MisterTee,

                          Thank you for your post.

                          This option has not been chosen to be implemented on the platform yet. It's possible it may be added in a future version.
                          Sean H.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by pechtri, 06-22-2023, 02:31 AM
                          9 responses
                          122 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by frankthearm, 04-18-2024, 09:08 AM
                          16 responses
                          64 views
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by habeebft, Today, 01:18 PM
                          1 response
                          5 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by benmarkal, Today, 12:52 PM
                          2 responses
                          13 views
                          0 likes
                          Last Post benmarkal  
                          Started by f.saeidi, Today, 01:38 PM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_BrandonH  
                          Working...
                          X