Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

City Index PNL

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

    City Index PNL

    Hi, there's a bug with City index where Ninjatrader does not report PNL correctly. Unrealised PNL is wrong. And Realised PNL is wrong but corrects itself when I log off and log back on.

    #2
    Hello kevinenergy,

    Thank you for your post.

    So I may accurately assist you, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 7.0.1000.? or 8.0.?.?)
    • What instrument are you trading?
    • What was your entry price for the position?
    • What is the expected unrealized PnL?
    • What is the unrealized PnL that is displayed?
    Additionally, please provide a screenshot of the 'Accounts' tab of NinjaTrader if possible.

    To send a screenshot with Windows 7 or newer I would recommend using the Windows Snipping Tool.

    Click here for instructions

    Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

    Click here for detailed instruction

    I look forward to assisting you further.
    Zachary S.NinjaTrader Customer Service

    Comment


      #3
      Hi there, I am using 8.0.23.1 64-bit, Trading USSP500 USTECH100 GERMANY30. My CityIndex account is denominated in British Pound Sterling;

      I wonder if the issue is related to Ninjatrader reporting P/L values in US Dollars, rather than converting it to pounds.

      I will try to get some examples today during my trading and provide you with the information and screenshots you have rested.

      Thanks for responding so fast.
      Last edited by kevinenergy; 02-22-2021, 07:59 AM.

      Comment


        #4
        Here's the screenshots you requested. The top two windows are from CityIndex's ATPro Trading Platform, the bottom two windows are what Ninjatrader is reporting.

        It would seem that Ninjatrader is reporting the correct unrealised PnL based on this value from the broker, However, the positions table below is very wrong
        When I exit these positions I will report back on the realzed PNL reported by Ninjatrader.

        Click image for larger version

Name:	image_2021-02-22_111324.png
Views:	250
Size:	80.0 KB
ID:	1143001

        Last edited by kevinenergy; 02-22-2021, 05:13 AM. Reason: Personal Live Trading information removed from screenshot

        Comment


          #5
          I liquidated those positions and I'm now flat; Ninjatrader is reporting Realised PNL of Ł530. (Unfortunately there was personal account information showing on the screenshot and I had to remove it. I didn't store that screenshot.

          CityIndex only provides Unrealised PNL, not Daily Realised PNL. But I can work it out from the cash value in the first screenshot and the cash value in the second screenshot.


          Ł41,961.66 - Ł40086,70 = Ł1874.96 which is my actual realised PNL - not Ł530 as reported by Ninjatrader
          Last edited by kevinenergy; 02-22-2021, 05:20 AM. Reason: Removing screenshot which contained personal account numbers

          Comment


            #6
            If I disconnect from CityIndex and Reconnect, the value is even more wrong. Repeated connects and disconnects don't seem to update this. Nor does restarting the platform.


            Click image for larger version  Name:	image_2021-02-22_110433.png Views:	0 Size:	34.2 KB ID:	1143000
            Last edited by kevinenergy; 02-22-2021, 05:22 AM.

            Comment


              #7


              Just a bit more info, the Trade Performance window is completely wrong as well. Not only is the Profit wrong, but the two trades I took this morning were both Longs - yet the trade performance window states that my profit came from shorts.


              Click image for larger version  Name:	image_2021-02-22_145203.png Views:	0 Size:	53.9 KB ID:	1143034

              Comment


                #8
                Hello kevinenergy,

                Thank you for your patience.

                There are some expected account reporting limitations that come into play when using the Forex.com/CityIndex API to connect.

                1. It is expected with Forex.com/CityIndex accounts that the position's PnL and the Unrealized PnL on the 'Accounts' tab will become out of sync at times. That is because the position PnL is calculated locally by NinjaTrader on a tick-by-tick basis where as the 'Unrealized PnL' value on the 'Accounts' tab is transmitted from the CityIndex API, which updates at a much slower interval.

                2. The 'Gross realized PnL', 'Realized PnL', and 'Total PnL' on the 'Accounts' tab are not values that are transmitted by the CityIndex API and thus, we would not expect it to match to another platform. When those values are not transmitted by the brokerage connection, NinjaTrader simulates this information locally.

                3. There are a number of reasons why the Trade Performance window may become out of sync, such as carrying positions through different sessions, trading after hours, Trading outside of the running strategy, etc. Your brokerage statement will always be the most accurate report of your daily trading. Please also note that if you frequently trade using market orders, this may be adding to the discrepancy because the CityIndex API does not support downloading market order history upon disconnecting and reconnecting (This disclaimer may be found within the connection guide under the 'Disclaimer' section).

                Ultimately, the best source of accurate account information will be your broker.

                Please let us know if we may assist you any further.
                Zachary S.NinjaTrader Customer Service

                Comment


                  #9
                  On your first point, If the Position PNL is being calculated by Ninjatrader on a tick-by-tick basis, I would suggest that the code for this is not working correctly and this should be raised as a bug and corrected, it is not producing the correct values.

                  Its a pretty simple calculation:

                  For long:
                  (CurrrentBid- AverageEntryPrice) * PositionSize * PointValue

                  For Short:
                  (AverageEntryPrice - CurrentAsk) * PositionSize * PointValue

                  On your second point, you say that when Gross Realised Pnl, Realized Pnl and Total Pnl is not transmitted by the broker Ninjatrader simulates this locally. This code also clearly doesn't work properly as it gives the wrong values and should be raised as a bug.

                  I took a huge loss last week because Ninjatrader reported my drawdown as being $400 (within my 1% Risk Tolerance) I killed the trade at that point. But ninjatrader was giving me the wrong information and the loss turned out to be Ł3000 which is about 8% of my account.

                  From your response, I get the impression you think this is an acceptable situation and I should just live with it. It is not acceptable. A trading platform needs to provide the trader with accurate data in order to allow them to make informed decisions.

                  Comment


                    #10
                    Hello kevinenergy,

                    Thank you for your reply.

                    I would like to clarify that Position PnL within NinjaTrader is calculated on a tick-by-tick basis based on live market data and your entry price, while the Unrealized PnL value provided by the CityIndex API is not updated on a tick-by-tick basis but on a hard-set interval. These values become out of sync due to this reason. This is a limitation of that API that our developers are aware of and it is expected when using this connection technology.

                    With the regard to the Realized and Total PnL calculations, these are simulated within NinjaTrader based on execution prices and live market data. They are not transmitted from this API whatsoever. However, there is an option called 'Use last price for PnL' that is enabled by default, and disabling this option may bring these values more in line with the values that you are expecting. To disable this options, go to Control Center > Tools > Options > trading and deselect 'Use last price for PnL' under the 'Calculations' subsection.

                    Please let us know if we may assist you any further.
                    Zachary S.NinjaTrader Customer Service

                    Comment


                      #11
                      Zachary,

                      I would like to clarify that Position PnL within NinjaTrader is calculated on a tick-by-tick basis based on live market data and your entry price
                      So can you explain why the screenshot in post #4 above is not displaying the correct values? We know my entry price, we know the current market price and we know the size of my position. All the information needed to work out position PnL is available; but the value is wrong.
                      Last edited by kevinenergy; 02-23-2021, 03:41 AM.

                      Comment


                        #12
                        Zachary,

                        just to update you.

                        Last night I did a reset on my Ninjatrader Database, clearing out all the executions.
                        I've only taken one trade today so far, but as things stand, Ninjatrader seems to be reporting my Realized PNL and Total PNL correctly now in the accounts tab.

                        I also wrote some code manually to calculate the Position PNL from the average, position size, and current bid/ask and converting the value to my account currency using the exchange rate, and am printing this on the chart trader. However, I do wonder if clearing out the Executions might have fixed the incorrect values I was seeing in the positions tab too, so will keep an eye on this today and report back.

                        Thanks for the support,

                        Kevin.

                        Comment


                          #13
                          Hello Kevin,

                          Thank you for the update.

                          There certainly are scenarios where old executions or data corruption in the database can throw off the values displayed so I'm glad to hear that resetting the database has made an impact.

                          Please let us know if we may assist you any further in the future.
                          Zachary S.NinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by FishTrade, Yesterday, 11:11 PM
                          3 responses
                          11 views
                          0 likes
                          Last Post FishTrade  
                          Started by Graci117, Today, 09:02 PM
                          1 response
                          11 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by ETFVoyageur, Today, 07:55 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post ETFVoyageur  
                          Started by janio973, Today, 07:24 PM
                          1 response
                          7 views
                          0 likes
                          Last Post NinjaTrader_Manfred  
                          Started by aligator, 01-06-2022, 12:14 PM
                          4 responses
                          250 views
                          0 likes
                          Last Post john_44573  
                          Working...
                          X