![]() |
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
|
|||||||
| NinjaScript File Sharing Discussion Discussion for shared NinjaScript files. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Unfortunately not. You would have to custom code any indicator logic.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
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];
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Jan 2008
Posts: 9
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Yes, it should be a public class. This is what is generated by default by the Indicator Wizard set up process.
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |