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 > Strategy Development

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

Reply
 
Thread Tools Display Modes
Old 11-26-2008, 01:20 PM   #1
lawyse
Certified NinjaScript Consultant
 
lawyse's Avatar
 
Join Date: Aug 2008
Location: Atlanta, GA
Posts: 84
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to lawyse
Default Name Strategy Parameters

I have a strategy that is code locked that has spaces in the names of the parameters, such as "Trigger EMA" or "Number of Bars". How are they able to do that, since when creating a variable in the code, you can't use spaces? I would like use names with spaces in my strategy.

Thanks.
lawyse is offline  
Reply With Quote
Old 11-26-2008, 02:19 PM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Hi lawyse,

You can't do it in the Indicator Wizard pages, but it is possible to change it directly in the NinjaScript editor later when editing the full code.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-26-2008, 03:10 PM   #3
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by lawyse View Post
I have a strategy that is code locked that has spaces in the names of the parameters, such as "Trigger EMA" or "Number of Bars". How are they able to do that, since when creating a variable in the code, you can't use spaces? I would like use names with spaces in my strategy.

Thanks.
I'm not sure exactly how it's represented, but you can take a look at the wizard generated code to see... unlock the code, and then look at the bottom of the generated file.

There's a region (almost invisible text) called "Properties"; click on the 'plus' sign to expand it. There are the parameters available for your strategy. However they represent spaces there, I'd imagine you can copy it by hand in your own code.
heech is offline  
Reply With Quote
Old 11-26-2008, 03:16 PM   #4
lawyse
Certified NinjaScript Consultant
 
lawyse's Avatar
 
Join Date: Aug 2008
Location: Atlanta, GA
Posts: 84
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to lawyse
Default

Here is some of the code... I am not using the wizard. At the bottom are my parameters, like 15 of them...

There is a description and a category, but I don't see a place for the "name." Any more ideas?


[Description(
"")]
[Category(
"Parameters")]
publicint BOBs
{
get { return bOBs; }
set { bOBs = Math.Max(1, value); }
}
[Description(
"")]
[Category(
"Parameters")]
publicdouble EntryAdjust
{
get { return entryAdjust; }
set { entryAdjust = Math.Max(-100, value); }
}
lawyse is offline  
Reply With Quote
Old 11-26-2008, 03:18 PM   #5
heech
Senior Member
 
Join Date: Nov 2008
Posts: 576
Thanks: 0
Thanked 1 time in 1 post
Default

Quote:
Originally Posted by lawyse View Post
[FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]Here is some of the code... I am not using the wizard. At the bottom are my parameters, like 15 of them...

There is a description and a category, but I don't see a place for the "name." Any more ideas?
Is this from the code that you said already had spaces? If so... beats me, I'm baffled.
heech is offline  
Reply With Quote
Old 11-26-2008, 03:32 PM   #6
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Hi,

Here is some code snippet demonstrating how to change the display to allow spaces, unfortunately we can not support it though...

Code:
[Description("Plots the entry prices")]
  [Category("Plots")]
  [Gui.Design.DisplayName("Draw Entry Price")]
  public bool DrawEntries
  {
   get { return showentries; }
   set { showentries = value; }
  }
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-26-2008, 04:55 PM   #7
lawyse
Certified NinjaScript Consultant
 
lawyse's Avatar
 
Join Date: Aug 2008
Location: Atlanta, GA
Posts: 84
Thanks: 0
Thanked 3 times in 3 posts
Send a message via Skype™ to lawyse
Default

Thanks... exactly what I wanted!!!!! You can close this thread now.
lawyse 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
strategy parameters kenzo Strategy Analyzer 4 04-27-2009 04:18 PM
No parameters to optimize CapoeiraNick Strategy Analyzer 8 02-12-2009 12:06 AM
Strategy Parameters ohowie Historical NinjaTrader 6.5 Beta Threads 1 01-20-2008 08:39 PM
Strategy Parameters Negative int value MindSabre Strategy Development 1 04-30-2007 01:28 AM
Strategy Parameters Json Strategy Development 2 04-01-2007 03:38 PM


All times are GMT -6. The time now is 01:43 AM.