NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 06-05-2009, 10:34 AM   #1
nescio
Junior Member
 
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default Multiple entry strategy optimization - assistance needed

Dear support!

I created the following strategy (OnBarUpdate):

if (CrossAbove(Close, EMA(SMA_Length), 1))
{
EnterLong(1, "");
}
if (CrossAbove(Close, EMA(SMA_Length2), 1))
{
EnterLong(1, "");
}
if (CrossAbove(Close, EMA(SMA_Length3), 1))
{
EnterLong(1, "");
}
// Condition sets close
if (CrossBelow(Close, EMA(SMA_Length), 1))
{
ExitLong(1);
}
if (CrossBelow(Close, EMA(SMA_Length2), 1))
{
ExitLong(1);
}
if (CrossBelow(Close, EMA(SMA_Length3), 1))
{
ExitLong(1);
}

When optimizing, however, I receive only the optimal values for the first two SMA_Length variable, the third stays at one, but does generate any entries, exits.

I used the ranges 10;30;4, 20;80;5 and 50;200;10.

Entries per direction is set at 3, EntryHandling AllEntries. Order Quantity = by strategy, Gtc

What is more is that while showing a Profit Factor of 2,3 the culumated profit is 2.508,52%. How is this calculated?

Kindest regards,

nescio
nescio is offline  
Reply With Quote
Old 06-05-2009, 11:01 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

nescio,

Not sure what you mean. All 3 parameters are optimized. If your results shows one parameter at a set value then that would be the parameter setting that just happened to yield the best results constantly with the different combinations of other variables.

http://www.ninjatrader-support.com/H...fitFactor.html
http://www.ninjatrader-support.com/H...tedProfit.html
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-05-2009, 11:23 AM   #3
nescio
Junior Member
 
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

For some reason, I wasn't able to reproduce the values mentioned in my previous post, although I used the same parameters.

I hope the screenshots show you what I mean. Compare the figures derived from the optimization with the input values...
Attached Images
File Type: jpg opt1.jpg (54.7 KB, 6 views)
File Type: jpg opt2.jpg (74.7 KB, 5 views)
nescio is offline  
Reply With Quote
Old 06-05-2009, 11:27 AM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Please try with SampleMACrossOver and see what you get with that strategy.
NinjaTrader_Josh is offline  
Reply With Quote
Old 06-05-2009, 11:31 AM   #5
nescio
Junior Member
 
Join Date: Feb 2009
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

Seems to work with the Sample Strategy. Any idea why this could be the case?
nescio is offline  
Reply With Quote
Old 06-05-2009, 11:36 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Take it one step at a time. Please try adding signal names to your entry and tie specific exits to those entries.

Reduce it down to two parameters. Try with only one entry at a time. Have you tried restarting NinjaTrader also?
NinjaTrader_Josh 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
Incorrect Strategy Analyzer Optimization Results Displayed trader_rick Strategy Analyzer 10 03-24-2011 04:13 AM
Automated Strategy help needed suprsnipes Strategy Analyzer 3 10-17-2008 03:39 PM
New user Q's: Optimization methods and multiple bar series bluelou General Programming 6 06-12-2008 01:46 PM
indicator optimization in a strategy tecmisc1 Strategy Development 2 04-08-2008 08:22 PM
Strategy: Using multiple entry/exit signals simultaneously NinjaTrader_Josh Reference Samples 0 09-06-2007 12:56 PM


All times are GMT -6. The time now is 03:29 AM.