NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 12-25-2007, 05:47 PM   #1
Aussie2
Member
 
Join Date: Oct 2007
Location: Sydney
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
Default v6.5.0.4 BETA Position.GetProfitLoss/Position.GetProfitLoss method fault

Not sure whether someone has already noted this, however it appears there might be a bug in the NT ver 6.5.0.4 code when Optimising with the Position.GetProfitLoss method, with PerformanceUnit.Currency option. In these circumstances the optimiser freezes.

The code below will compile, but not optimise any results in ver 6.5.0.4 BETA but will optimise in NT ver 6 ?? Moreover if the lines referencing the PerformanceUnit.Currency method are deleted then the optimiser does not freeze up !

Can anyone confirm my results? Thanks.


protectedoverridevoid OnBarUpdate()
{ if (Position.MarketPosition == MarketPosition.Flat)EnterLong(1,"L");
if (Position.MarketPosition == MarketPosition.Long)
{
//double currency = 1;
double currency = Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);
double percent = Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Percent),4);
double points = Math.Round(Position.GetProfitLoss(Close[0], PerformanceUnit.Points),4);
Print(CurrentBar);
Print("Currency = " + currency);
Print("Percent = " + percent);
Print("Points = " + points);
}
}
Aussie2 is offline  
Reply With Quote
Old 12-25-2007, 11:25 PM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

This bug will be fixed with next update of NT6.5. Thanks for reporting.
NinjaTrader_Dierk is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I realize this is my fault for doing this, but... Pete S Historical NinjaTrader 6.5 Beta Threads 4 12-12-2007 06:18 AM
Re: Strategy Position vs. Account Position Pete S Strategy Development 1 11-14-2007 08:55 AM
Strategy Position vs. Account Position NinjaTrader_Josh Tips 0 11-12-2007 06:06 PM
Position.GetProfitLoss(Close[0], PerformanceUnit.Points) problems scriabinop23 Strategy Development 2 05-18-2007 12:22 PM
Add to a position T4M ATM Strategies (Discretionary Trading) 1 05-04-2007 06:13 AM


All times are GMT -6. The time now is 10:29 PM.