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 > Application Technical Support > Strategy Analyzer

Strategy Analyzer Support for automated system backtesting and optimization using the NinjaTrader Strategy Analyzer.

Reply
 
Thread Tools Display Modes
Old 01-03-2008, 07:11 PM   #1
chrisdc5
Junior Member
 
Join Date: Nov 2007
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default f optimizer development - no values returned

I'm in the process of developing an optimizer, the code compiles correctly but nothing is displayed in the strategy analyzer. The code isn't completely finished but it should be able to return at least one value. NT6 shows nothing and NT6.5 says that there is no info to display. The code is attached.

Thanks,
Chris
Attached Files
File Type: cs OptimalF.cs (1.7 KB, 18 views)
chrisdc5 is offline  
Reply With Quote
Old 01-03-2008, 08:30 PM   #2
KBJ
Senior Member
 
Join Date: Mar 2007
Location: , Florida, USA
Posts: 663
Thanks: 36
Thanked 7 times in 6 posts
Default

I didn't examine your logic in any depth, but I'd do two things:

1) Check to make sure you're not getting a divide by zero (it looks likely -- did you look in the "Log" tab for errors?)

2) If still having troubles, try writing some intermediate results to a text file using C# I/O methods.

Good luck.
KBJ is offline  
Reply With Quote
Old 01-04-2008, 05:47 AM   #3
Pete S
Senior Member
 
Join Date: Jul 2007
Location: Fairfax, VA
Posts: 216
Thanks: 0
Thanked 0 times in 0 posts
Default

I'll take a quick look. Note you can use Strategy.Print() to write debug info to the output window.
Pete S is offline  
Reply With Quote
Old 01-04-2008, 06:01 AM   #4
Pete S
Senior Member
 
Join Date: Jul 2007
Location: Fairfax, VA
Posts: 216
Thanks: 0
Thanked 0 times in 0 posts
Default

It returns results for me as expected (on 6.5 beta 4), but your logic doesn't make sense, in particular:

1. TWR *= HPR; TWR is always zero, so this value is always going to be zero.

2. This section:
Loser = systemPerformance.ShortTrades.TradesPerformance.Gr ossLoss;
largestLoser = systemPerformance.LongTrades.TradesPerformance.Gro ssLoss;

if(largestLoser >Loser)
{
largestLoser = Loser;
}

The gross loss is the total of all losing trades, and it is a negative number. This logic is not going to do what you think.

But I am not getting the no results message. KBJ is probably right about there being an exception.
Pete S 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
NTMarketPosition suddenly returned a wrong value BCA Automated Trading 45 05-22-2008 11:02 AM
Custom optimizer development feedback Pete S Historical NinjaTrader 6.5 Beta Threads 2 02-14-2008 08:44 AM
New "Introduction to NinjaScript Strategy Development" 8 Hour Online Seminar! NinjaTrader_Ray News and Announcements 0 12-05-2007 06:35 PM
Bug in Optimizer NinjaTrader_Josh Suggestions And Feedback 5 05-29-2007 02:02 AM
Error returned underground Automated Trading 0 06-10-2005 07:18 AM


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