![]() |
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
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Oct 2007
Location: Sydney
Posts: 78
Thanks: 0
Thanked 0 times in 0 posts
|
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); } } |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
This bug will be fixed with next update of NT6.5. Thanks for reporting.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |