PDA

View Full Version : NKD - strange unrealized PnL


jp_kettunen
02-02-2009, 03:43 PM
Ninja shows strange unrealized PnL for NKD (the Dollar-denominated Nikkei 225 Futures Contract traded on Globex), but calculates the realized PnL correctly - at least in simulated trading. How come, and does this apply to live trading, too? I checked the settings for the instrument, and they seem to be ok (point value = USD 5, tick size = 5).

NinjaTrader_Jessica
02-02-2009, 03:54 PM
Please be aware that your unrealized won't include any commissions you have added. Other then that I am not sure what would make them differ. Try left clicking on the PnL box to cycle it through points, percent, and currency to make sure you viewing the display you want.

Other then that you may want to try reseting your instrument. If that is the case send a note to support AT ninjatrader DOT com attn Jessica and I will send you a screen shots of the instrument setup.

jp_kettunen
02-02-2009, 11:58 PM
I was running a Ninja Script, and just seconds before the program closed the position (realized PnL -$50, or -2 ticks), the unrealized PnL was something in the order of $35000 (should have been between 0 and -$50). I'll do more tests today...

NinjaTrader_Jessica
02-03-2009, 07:40 AM
Please keep me posted and I have attached screen shots of the instrument setup.

jp_kettunen
02-03-2009, 10:50 AM
This issue relates to algo trading, NKD and Sim account. My NKD settings are similar to yours. Its the unrealized PnL column in the Control Center / Strategies sheet that goes wild when the position is open and price changes occur. Pls take a look at the attached picture. The profit target / stop-loss was +/- 2 ticks (+/- $50 away), and they have proven to function as expected. Can you reproduce this phenomenon?

NinjaTrader_Jessica
02-03-2009, 11:22 AM
Please try repairing your database and reseting your instruments.

Tools--> Options--> Misc--> Repair DB

Tools--> Options--> Misc--> Reset Instruments

jp_kettunen
02-04-2009, 01:09 PM
Did that, but didn't get rid of the problem - a lot of minus or plus when the position is open (but to correct direction though!), and correct realized PnL. Can you reproduce this?

NinjaTrader_Jessica
02-04-2009, 01:50 PM
We are not able to reproduce so I would suggest a complete reinstall.

If you still have the issue please send a note into support so we can trouble shoot further.

jp_kettunen
02-04-2009, 02:08 PM
Just reinstalled Ninja about two weeks ago after system crash (the database got corrupted). It has been working well ever since. Could this somehow relate to my system/OS settings? What *in principle* could produce this phenomenon? Pls note that this only relates to algo trading - e.g. no problems with Super DOM (unrealized PnL gets calculated right) - and only to NKD (of the USD denominated instruments I have tried). Special feature of Sim (no live trading experience with Ninja)?

NinjaTrader_RJ
02-05-2009, 09:05 AM
Just reinstalled Ninja about two weeks ago after system crash (the database got corrupted). It has been working well ever since. Could this somehow relate to my system/OS settings? What *in principle* could produce this phenomenon? Pls note that this only relates to algo trading - e.g. no problems with Super DOM (unrealized PnL gets calculated right) - and only to NKD (of the USD denominated instruments I have tried). Special feature of Sim (no live trading experience with Ninja)?

Hello,

Data can become corrupt for any number of reasons, however the most likely is unexpected PC shutdowns or disconnects.

jp_kettunen
02-05-2009, 11:17 AM
Reinstalled Ninja, but did not get rid of this peculiar phenomenon. My gut feeling now points into the direction of the platform or Sim101 account. What next?

NinjaTrader_RJ
02-05-2009, 11:42 AM
Reinstalled Ninja, but did not get rid of this peculiar phenomenon. My gut feeling now points into the direction of the platform or Sim101 account. What next?

Jp,

Can you send in your trace and log files for a day when this issue occurred, today if possible?

Send to Support AT Ninjatrader DOT com.

Trace File: \Documents\NinjaTrader6.5\trace\(date of issue)
Log File: \Documents\NinjaTrader6.5\log\(date of issue)

jp_kettunen
02-05-2009, 01:40 PM
They're coming, strange if you cannot reproduce this thing with your systems...
Remember that the only anomaly I have noticed is the unrealized PnL in the strategy sheet when the position is open, while the realized PnL seems to be more in sync with reality... Cheers, and good hunting

jp_kettunen
02-05-2009, 02:20 PM
COMPLETELY UNRELATED, MULTI-INSTRUMENT-RELATED QUESTION:
Let's suppose that my primary bars object is NKD 03-09 and secondary bars object is ES 03-09. In such a case, is there any way of buying and selling NKD from inside OnBarUpdate() when BarsInProgress == 1?! I am asking this because trading NKD is challenging due to the relatively low volumes (and rare incoming ticks). Any other way of circumventing this obstacle?!

NinjaTrader_Josh
02-05-2009, 03:18 PM
Sure. Just submit the order when BIP == 1. On all of the submit methods you have a signature that allows you to define which BIP you want to have the order submitted against.

jp_kettunen
02-05-2009, 04:31 PM
So of BarsInProgress == 1 and I want to buy NKD (my primary bars object), I could write, for example,

private int LotsPerTrade = 2;

EnterLong(0, LotsPerTrade, "BuyNKD");

Right?

NinjaTrader_Bertrand
02-06-2009, 06:26 AM
That should do it jp_kettunen.

jp_kettunen
02-06-2009, 09:12 AM
Works - thanks a lot.