NinjaTrader Support Forum  

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

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 08-22-2011, 06:22 PM   #1
csharp
Junior Member
 
Join Date: Jun 2011
Location: Tucson, Arizona
Posts: 15
Thanks: 0
Thanked 1 time in 1 post
Default Adding parameters to an existing indicator

Hello,

A short while ago I installed NinjaTrader 7, and have been reading the various Help menus and practicing with the pre-installed indicators, as well as writing my own for testing. The wizard can be used to start a new indicator from scratch, where the parameters, data and type of graphical output can be specified. However, I do not know how to add new data or parameters to an existing indicator, and would be most grateful for some help.

On opening a chart and specifying indicators, a window is opened with a list of indicators on the left and the parameters, data, graphics etc. displayed on the right. The value in an input parameter can be changed, but how do I add a new parameter or item of data?

In looking at the code at the beginning of an indicator are various standard .NET “using System” statements, followed by “using NinjaTrader.Cbi”, “using NinjaTrader.Data” and “using NinjaTrader.Gui.Chart”, which are obviously specific to NinjaTrader, and the last one obviously refers to graphics, so the code associated with parameters and indicators must be referred by the other two “using” statements, but I am unable to locate the source code.

In going to \Program Files\NinjaTrader 7\ are the folders bin, db, doc and sounds, together with a Word document with the license agreement. By elimination it looks as if the code I’m looking for must be in \db\NinjaTrader SQL server. I only have .NET express installed and no SQL currently installed.

The upshot is that I would be most grateful to know how to change the numbers of parameters or data types in an existing indicator, either by using some kind of wizard or by locating and modifying the source code that is set up by the wizard before the specific indicator is called, and would be most grateful for some help on this.

Christopher
Csharp
csharp is offline  
Reply With Quote
Old 08-22-2011, 07:17 PM   #2
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,354
Thanks: 24
Thanked 1,304 times in 1,067 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by csharp View Post
Hello,

A short while ago I installed NinjaTrader 7, and have been reading the various Help menus and practicing with the pre-installed indicators, as well as writing my own for testing. The wizard can be used to start a new indicator from scratch, where the parameters, data and type of graphical output can be specified. However, I do not know how to add new data or parameters to an existing indicator, and would be most grateful for some help.

On opening a chart and specifying indicators, a window is opened with a list of indicators on the left and the parameters, data, graphics etc. displayed on the right. The value in an input parameter can be changed, but how do I add a new parameter or item of data?

In looking at the code at the beginning of an indicator are various standard .NET “using System” statements, followed by “using NinjaTrader.Cbi”, “using NinjaTrader.Data” and “using NinjaTrader.Gui.Chart”, which are obviously specific to NinjaTrader, and the last one obviously refers to graphics, so the code associated with parameters and indicators must be referred by the other two “using” statements, but I am unable to locate the source code.

In going to \Program Files\NinjaTrader 7\ are the folders bin, db, doc and sounds, together with a Word document with the license agreement. By elimination it looks as if the code I’m looking for must be in \db\NinjaTrader SQL server. I only have .NET express installed and no SQL currently installed.

The upshot is that I would be most grateful to know how to change the numbers of parameters or data types in an existing indicator, either by using some kind of wizard or by locating and modifying the source code that is set up by the wizard before the specific indicator is called, and would be most grateful for some help on this.

Christopher
Csharp
Look in the properties section, and cross-reference them to the private variables.
koganam is offline  
Reply With Quote
The following user says thank you to koganam for this post:
Old 08-23-2011, 11:57 AM   #3
csharp
Junior Member
 
Join Date: Jun 2011
Location: Tucson, Arizona
Posts: 15
Thanks: 0
Thanked 1 time in 1 post
Default

At the end of my reply I meant to say that it may ONLY make sense to change some of these in the code, e.g. the input series, say AA (Daily), depends on what Data Series you select, so there is no point in changing the code for this.

csharp
csharp is offline  
Reply With Quote
Old 08-23-2011, 01:00 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

csharp, I would suggest you take a look at this tip here - http://www.ninjatrader.com/support/f...ead.php?t=5782
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 08-23-2011, 11:50 AM   #5
csharp
Junior Member
 
Join Date: Jun 2011
Location: Tucson, Arizona
Posts: 15
Thanks: 0
Thanked 1 time in 1 post
Default

OK, I did exactly that and it works! Many thanks indeed. I'm new to NinjaScript and that advice saved me a lot of time.

At some point I might want to change some of the other quantities in Data, Visual, Label and Plots. Of these only the last, Plot0, is in the Properties section, and it is set up in the Initialize() method. Where are the other properties set up? I realise that it may make sense to changes some of these in the code.

Many thanks,

csharp
csharp is offline  
Reply With Quote
Old 08-23-2011, 12:01 PM   #6
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hi csharp,

Those categories are built in and are non-configurable, as far what items appear in those categories. Each item there is a property you can set in the indicator's initialize() method, that will serve as the default when you apply the script. Autoscale, Displacement, CalculateOnBarClose, etc. Can see an alphabetical listing of all NinjaScript here:
http://www.ninjatrader.com/support/h..._reference.htm

You can of course add plots and they will show up under the plots category. If you add any inputs, like a period calculation, they're set to display under a Parameters category. You can also customize and provide your own category name.
Last edited by NinjaTrader_RyanM; 08-23-2011 at 12:10 PM.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 08-23-2011, 04:14 PM   #7
csharp
Junior Member
 
Join Date: Jun 2011
Location: Tucson, Arizona
Posts: 15
Thanks: 0
Thanked 1 time in 1 post
Default

Hi Ryan M,

Many thanks, and that is pretty much as I had expected. The link you gave me is of course the same as the Help that comes with NinjaTrader.

Incidentally, if I put in at the beginning "using System.Windows.Forms;" a MessageBox can be used which is convenient for testing and debugging, and by making some other changes, it is possible to get a console displayed and use the Console.WriteLine() method for additional output.

csharp
csharp is offline  
Reply With Quote
Old 08-23-2011, 10:11 PM   #8
koganam
Senior Member
 
Join Date: Feb 2008
Location: Durham, North Carolina, USA
Posts: 3,354
Thanks: 24
Thanked 1,304 times in 1,067 posts
Send a message via Skype™ to koganam
Default

Quote:
Originally Posted by csharp View Post
Hi Ryan M,

... and by making some other changes, it is possible to get a console displayed and use the Console.WriteLine() method for additional output.

csharp
Care to detail how?
koganam is offline  
Reply With Quote
Old 08-24-2011, 12:12 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
Default

Quote:
Originally Posted by csharp View Post
Hi Ryan M,

Many thanks, and that is pretty much as I had expected. The link you gave me is of course the same as the Help that comes with NinjaTrader.

Incidentally, if I put in at the beginning "using System.Windows.Forms;" a MessageBox can be used which is convenient for testing and debugging, and by making some other changes, it is possible to get a console displayed and use the Console.WriteLine() method for additional output.

csharp
csharp, as this is more a general C# topic we could unfortunately not offer support on that.
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Tags
code, parameters

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
Manually adding parameters DionysusToast General Programming 0 03-02-2011 11:10 PM
NT crashes on adding instruments to existing list noincomenojobnoassets Version 7 Beta General Questions & Bug Reports 3 06-29-2010 04:52 AM
Adding parameters in wizard raycam Strategy Development 2 08-25-2009 06:41 AM
Adding parameters at a later stage... Sidhartha General Programming 7 04-04-2008 09:32 AM
Problems adding contracts to existing position/strategy Ouiji Miscellaneous Support 1 05-10-2007 02:10 PM


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