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 File Sharing > NinjaScript File Sharing Discussion

NinjaScript File Sharing Discussion Discussion for shared NinjaScript files.

Reply
 
Thread Tools Display Modes
Old 01-24-2008, 11:11 AM   #1
Don44
Junior Member
 
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default Wizard vs Code for indicator on indicator

Can the Indicator wizard be used to do basic indicator on indicator set ups, such as a SMA of a WMA or similar without having to edit the code?
...for example is there a way to just identify the standard WMA (or a custom name) indicator with a click from the drop down list as the "input" to a new custom indicator?

Since I can't find an example that does this, I suspect the answer is no.

Thanks for your help.
Don44 is offline  
Reply With Quote
Old 01-24-2008, 11:44 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Unfortunately not. You would have to custom code any indicator logic.
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-24-2008, 12:09 PM   #3
Don44
Junior Member
 
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default Related question on code sysntax

Thanks, Ray,

On a related syntax/structure note, I created a custom indicator (Myindicator1) in which I create a custom DataSeries1 and plot the result ...it works great.

Now I want to create a Myindicator2 (and Dataseries2) that operates on Myidicator1.
What is the basic rule(s) for referring to Myindicator1 from within Myindicator2, as I keep getting various compiler errors.
My brute force solution was to copy all the custom code from Myidicator1 into Myindicator2, and then append the Myindicator2 code. This works fine but seems to fly in the face of reusable objects. All of the documentation examples use a standard NT indicator(eg SMA) from within a new custom indicator. I'm hoping there are a few simple C# rules that apply to accomplish this, as I expect to do a lot of it.

Thanks again.
Don44 is offline  
Reply With Quote
Old 01-24-2008, 12:13 PM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

As you create and compile MyIndicator2, NinjaTrader creates hidden wrapper methods for this indicator that makes it accesisible from any other NinjaScript object.

Withing MyIndicator1, you can then reference:

double myValue = MyIndicator2(your parameters)[0];
NinjaTrader_Ray is offline  
Reply With Quote
Old 01-24-2008, 02:16 PM   #5
Don44
Junior Member
 
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
Default

Ray,
A clarification question:
Do I need to change the original Indicator1 class to "public" from private for this to work? Are there any other changes I need to do to it so that future indicators can refer to it?

Thanks so much for your help
Don44 is offline  
Reply With Quote
Old 01-24-2008, 02:41 PM   #6
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

Yes, it should be a public class. This is what is generated by default by the Indicator Wizard set up process.
NinjaTrader_Ray 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
Can someone please translate this TS indicator code to NT Razor_Trader Indicator Development 2 11-21-2007 06:48 PM
Plotting 3 lines beside Wizard generated code grd974 General Programming 2 08-26-2007 02:07 AM
Using Strategy Wizard to develope Indicator on Indicator mrlucky1x Indicator Development 3 08-25-2007 04:09 PM
New Indicator wizard always codes PlotStyle as line. higler General Programming 3 05-16-2007 03:11 PM
Indicator file cached? "Name already in use" error in wizard... funk101 Indicator Development 3 04-27-2007 10:53 AM


All times are GMT -6. The time now is 04:42 PM.