Answer by Zack · Mar 02 at 08:40 PM
In X_Trader and the API, you can set what the PnL is based on and what currency it is displayed in. This mismatch you are seeing may be being caused by a mismatch of these two settings between X_Trader and your API app.
Luckily this can be quickly and easily checked. If you have not already, I would reccommend downloading our C# Samples. The 11_ProfitLoss project has two dropdown menus to quickly change these withing a trade subscription and see the results instantly. If you open your position window and right click on the row representing the instrument you are interested in, there will be two context menu options, "P/L Display" and "P/L Based On", that let you check and set these settings.
When you make sure that these two properties match do the numbers displayed also match?
Answer by Zack · Mar 08 at 10:30 PM
Sorry to hear that they differ even when given the same criteria. One possibility is that the tick tables for this instrument somehow differ. To refresh your tick tables do the following procedure:
Note: Before deleting any product tables or token files, save a copy of the <drive letter>:\tt\guardian\config and <drive letter>:\tt\datfiles\ProductTableData folders on the Desktop as a backup.
First, delete the config folder from Guardian (which will delete the Product Tables).
1. Log out of X_TRADER and stop Guardian and TT Messaging.
- To stop Guardian, double-click the Stop Guardian icon on the Desktop; click Yes.
- To stop TT Messaging, select the Windows Start globe and type ttmd -k in the Search programs and files field; press Enter.
2. To delete the product tables, access the <drive letter>:\tt\guardian folder.
3. Delete the <drive letter>:\tt\guardian\config folder. (Remember to save a copy of this folder on the Desktop)
Second proceed with deleting the ProductTableData folder (which will delete the token files).
4. To delete the token files, access the <drive letter>:\tt\datfiles folder.
5. Delete the <drive letter>:\tt\datfiles\ProductTableData folder. (Remember to save a copy of this file on the Desktop.)
6. Double-click the Start Guardian icon and log in to X_TRADER.
Note: The folder will be re-created when X_TRADER starts.