NexusFi: Find Your Edge


Home Menu

 





NinjaTrader Genetic Optimizer


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one piersh with 49 posts (94 thanks)
    2. looks_two Big Mike with 26 posts (10 thanks)
    3. looks_3 TraderDJB with 13 posts (18 thanks)
    4. looks_4 dsraider with 10 posts (0 thanks)
      Best Posters
    1. looks_one piersh with 1.9 thanks per post
    2. looks_two TraderDJB with 1.4 thanks per post
    3. looks_3 sam028 with 0.5 thanks per post
    4. looks_4 Big Mike with 0.4 thanks per post
    1. trending_up 91,614 views
    2. thumb_up 134 thanks given
    3. group 47 followers
    1. forum 197 posts
    2. attach_file 19 attachments




 
Search this Thread

NinjaTrader Genetic Optimizer

  #101 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

Thanks for your response, piersh. Well, no matter what I do, I don't get the options on the right side (I'm on 6.5, by the way). As far as the int/doubles go, I get no options for them in either window. Did I forget something?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Are there any eval firms that allow you to sink to your …
Traders Hideout
ZombieSqueeze
Platforms and Indicators
Deepmoney LLM
Elite Quantitative GenAI/LLM
Exit Strategy
NinjaTrader
 
  #102 (permalink)
piersh
California
 
Posts: 87 since Jun 2009
Thanks Given: 5
Thanks Received: 120


dsraider View Post
Thanks for your response, piersh. Well, no matter what I do, I don't get the options on the right side (I'm on 6.5, by the way). As far as the int/doubles go, I get no options for them in either window. Did I forget something?

do the properties in your strategy look like this?

 
Code
                            
        [Category ("Parameters")] 

        public 
PriceType PriceType 
        

            
get { return _priceType; } 
            
set _priceType value; } 
        } 
        
PriceType _priceType

Reply With Quote
  #103 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87


No, sir. I stared at page 7 of this thread for quite some time and tried to make my strat look like that. After a million error messages, I went to the enum link you posted but that didn't seem to do the trick. Maybe I just need an Enum for Dummies book? Sorry, I'm just not much of a coder yet, so the language doesn't come easily to me.

Reply With Quote
  #104 (permalink)
piersh
California
 
Posts: 87 since Jun 2009
Thanks Given: 5
Thanks Received: 120


dsraider View Post
No, sir. I stared at page 7 of this thread for quite some time and tried to make my strat look like that. After a million error messages, I went to the enum link you posted but that didn't seem to do the trick. Maybe I just need an Enum for Dummies book? Sorry, I'm just not much of a coder yet, so the language doesn't come easily to me.

let's have a look. can you post your code here? you can strip out the code inside your Initialize/OnBarUpdate/etc. methods... i'm mostly interested in how you're declaring your properties.

Reply With Quote
  #105 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

I've removed this post so no one knows how dumb I am. Also, I didn't want anyone getting confused.

Reply With Quote
  #106 (permalink)
piersh
California
 
Posts: 87 since Jun 2009
Thanks Given: 5
Thanks Received: 120


dsraider View Post
Well, I tried copying the variables from the indicator into the strat, in order to manipulate them locally. I hope this is what you mean. I'm about two weeks into coding ninjascript:

Am I six or seven exits past what you meant?

well, in order for your strategy's varables to show up, you'll need to expose each one of them as properties.

for example:
 
Code
                            
        [Category ("Parameters")]  

        public 
SuperTrendMode TrendMode
        
{  
            
get { return smode; }  
            
set smodevalue; }  
        }  
        
SuperTrendMode smode SuperTrendMode.ATR

Reply With Quote
Thanked by:
  #107 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

Oh man, I'm like a 90-year-old guy trying to change the channels by clicking away at his cell phone.

Okay, TrendMode and MAs worked but it did NOT like my entering length, multiplier or the smoothing integer. My plan is to test all combos of Mode, MAs and lengths (1-20), multipliers (.1-5) and smooth (1-20) against targets and stops of say .25 - 12, just on a TSSuperTrend crossover. Maybe this isn't possible?

Thanks.

Reply With Quote
  #108 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87

You meant this, I assume?

#region Variables

private int length = 14;
private double multiplier = 1.5;
private int smooth = 14;

private int target = 2;
private int stop = 8;

[Category ("Parameters")]
public int Length
{
get { return length; }
set { length = Math.Max(1, value); }
}

[Category ("Parameters")]
public MovingAverageType MAType
{
get { return maType; }
set { maType= value; }
}
MovingAverageType maType = MovingAverageType.HMA;

[Category ("Parameters")]
public double Multiplier
{
get { return multiplier; }
set { multiplier = Math.Max(0.0001, value); }
}

[Category ("Parameters")]
public int Smooth
{
get { return smooth; }
set { smooth = Math.Max(1, value); }
}

[Category ("Parameters")]
public SuperTrendMode TrendMode
{
get { return smode; }
set { smode= value; }
}
SuperTrendMode smode = SuperTrendMode.ATR;

[Category ("Parameters")]
public int Target
{
get { return target; }
set { target = Math.Max(1, value); }
}

[Category ("Parameters")]
public int Stop
{
get { return stop; }
set { stop = Math.Max(1, value); }
}

#endregion

It compiles but doesn't show in the optimizer. I'll keep working on it but if you see something and want to save me some hair from falling out....?

Reply With Quote
  #109 (permalink)
piersh
California
 
Posts: 87 since Jun 2009
Thanks Given: 5
Thanks Received: 120


dsraider View Post
You meant this, I assume?


It compiles but doesn't show in the optimizer. I'll keep working on it but if you see something and want to save me some hair from falling out....?

yes, that looks good. the 'int' & 'double' parameter won't show in the GA Optimizer dialog - you can set those in the usual place, in the Strategy Analyzer 'optimize' dialog.

Reply With Quote
  #110 (permalink)
dsraider
New York, NY
 
Posts: 142 since Dec 2009
Thanks Given: 41
Thanks Received: 87


I actually couldn't get the strat to show at all but it turned out to be a typo on my part. Thank you for your explanation and tips. Everything now shows as it should.

Dave

Reply With Quote




Last Updated on December 16, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts