Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
City Index PNL
Collapse
X
-
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.Tags: None
-
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?
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
-
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
-
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.
Last edited by kevinenergy; 02-22-2021, 05:13 AM. Reason: Personal Live Trading information removed from screenshot
Comment
-
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
-
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.
Last edited by kevinenergy; 02-22-2021, 05:22 AM.
Comment
-
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.
Comment
-
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
-
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
-
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
-
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 priceLast edited by kevinenergy; 02-23-2021, 03:41 AM.
Comment
-
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
-
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 AttiM, 02-14-2024, 05:20 PM
|
8 responses
166 views
0 likes
|
Last Post
by jeronymite
Today, 05:00 PM
|
||
Started by cre8able, Today, 04:22 PM
|
0 responses
7 views
0 likes
|
Last Post
by cre8able
Today, 04:22 PM
|
||
Started by RichStudent, Today, 04:21 PM
|
0 responses
4 views
0 likes
|
Last Post
by RichStudent
Today, 04:21 PM
|
||
Started by cre8able, Today, 04:16 PM
|
0 responses
8 views
0 likes
|
Last Post
by cre8able
Today, 04:16 PM
|
||
Started by cre8able, Yesterday, 03:20 PM
|
3 responses
19 views
0 likes
|
Last Post
by cre8able
Today, 04:08 PM
|
Comment