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 01-04-2010, 12:51 PM   #1
d.allen101
Senior Member
 
Join Date: Jun 2009
Location: Chicago
Posts: 154
Thanks: 0
Thanked 0 times in 0 posts
Default Creating an indicator

I'm creating an indicator that uses an indicator that's already within the NinjaTrader library. Can you please point me to a tread that covers how to do this? I've already read the section in the user guide covering how to use the DataSeries type but I'm still having a little trouble. Thanks
d.allen101 is offline  
Reply With Quote
Old 01-04-2010, 03:34 PM   #2
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

Hello D.Allen,

Thank you for your post.

We have this guide on setting indicators on indicators.

You've probably already read this one on using custom data series.

Let us know what you're looking to do and we can assist further.
Last edited by NinjaTrader_RyanM; 01-05-2010 at 01:00 PM.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-11-2010, 11:59 AM   #3
djdinut1
Member
 
Join Date: Oct 2008
Location: Salt Lake City, UT
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default

Is there an indicator that draws two lines on a chart that represent offsets of the current day's high and low? This would operate exactly like your indicator "CurrentDayOHL" except that rather than drawing lines at the current day's high and low, it would draw two lines as offsets of the current day's high and low; the first line at 20 ticks below the current day's high and the second line at 20 ticks above the current day's low. This creates a channel off the current day's high and low.

Also, how do I post a new thread in the forum? The FAQ don't describe the process. I had to piggyback on this thread to post a message.
djdinut1 is offline  
Reply With Quote
Old 01-11-2010, 01:57 PM   #4
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

Hello djdinut,

We don't have an indicator like this by default but it can be created. You can use:

Code:
Plot0.Set(CurrentDayOHL().CurrentHigh[0] + TickSize * OffsetValue);
OffsetValue is a user-defined input. You can set this while creating the indicator. For below the Low you just replace CurrentHigh with CurrentLow and use a negative offset.

To create a new thread hit the "New Thread" button. If you don't see the "New Thread" button you may have to activate your forum account by clicking on the email link sent to you when you registered. If you don't see it in your inbox, check your spam folder.

NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-11-2010, 02:41 PM   #5
djdinut1
Member
 
Join Date: Oct 2008
Location: Salt Lake City, UT
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default

Excellent! Works great. Is there a command that would shade the offset gap between the high of the day and the offset line below it that I just created from your instructions?
djdinut1 is offline  
Reply With Quote
Old 01-11-2010, 02:48 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

djdinut1,

Take look at this reference sample below, which provides some coding examples on shading between two values:
http://www.ninjatrader-support2.com/...ead.php?t=4331
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-11-2010, 03:25 PM   #7
djdinut1
Member
 
Join Date: Oct 2008
Location: Salt Lake City, UT
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default

I'll work with that. In the meantime, how can I rename an Indicator? I can do this with Strategies by editing and changing the name to something else. But when I edit an Indicator I don't see how that works.
djdinut1 is offline  
Reply With Quote
Old 01-11-2010, 03:34 PM   #8
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

To rename you will want to Right click within the editor and select Save As. Type in your new name and click OK.
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-11-2010, 03:49 PM   #9
djdinut1
Member
 
Join Date: Oct 2008
Location: Salt Lake City, UT
Posts: 42
Thanks: 0
Thanked 0 times in 0 posts
Default

Works! Thanks much for your great help.
djdinut1 is offline  
Reply With Quote
Old 09-08-2010, 04:04 AM   #10
Serninja
Junior Member
 
Join Date: Mar 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
Default Creating an indicator based on one or more sub-indicators

Hello!

I am very thankful for the almost unlimited possibilities regarding "indicators-on-indicators".

I know that I can create a template, if I want to share the "new" indicator or to put it on another chart etc.

But is it also possible to easily convert the new created indicator into a separate indicator, which I can share for instance without having to program it from scratch?

E.g. get a KAMA of a CCI of an HMA of a Closing Price as a new separate indicator named e.g. "KAMACCIHMA" or whatever.

Thank you very much!
Serninja is offline  
Reply With Quote
Old 09-08-2010, 04:54 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,561
Thanks: 261
Thanked 1,015 times in 996 posts
Default

Serninja, this nested indicator will unfortunately need to be programmed.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 09-08-2010, 04:57 AM   #12
Serninja
Junior Member
 
Join Date: Mar 2010
Posts: 24
Thanks: 3
Thanked 0 times in 0 posts
Default

Bertrand,

thanks anyway.

Kind regards,
Serninja 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
Creating an indicator like Market Delta antonio Indicator Development 24 02-18-2010 12:10 PM
how do i go about creating this indicator? kaywai Indicator Development 4 11-30-2009 09:05 PM
Help with Creating Indicator Sakkers Indicator Development 4 02-22-2009 06:26 PM
Creating an indicator from an indicator instructions designer Indicator Development 5 11-04-2008 11:04 AM
Problem creating Indicator nicko9 Indicator Development 2 02-22-2007 01:52 AM


All times are GMT -6. The time now is 04:17 AM.