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

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

Reply
 
Thread Tools Display Modes
Old 06-02-2010, 07:16 AM   #1
bubblegum
Junior Member
 
Join Date: Nov 2009
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
Default How to add second, variable datastream to v7 indicator

Hi,

I can add a second datastream to an indicator OK.

Code:
 
protected override void Initialize()
{
Add("^TICK", PeriodType.Tick, 150);
}
But I want to make the PeriodType and the Interval dependent on the underlying chart. So, if my underlying chart were 5 minutes I want my second datastream to by ^TICK 5 minutes.

It says specifically in the documentation that I shouldn't use variables in the Initialize() section, so how do I achieve this?

Thanks
Last edited by bubblegum; 06-02-2010 at 07:21 AM.
bubblegum is offline  
Reply With Quote
Old 06-02-2010, 08:02 AM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thank you for your first forum post!

Unfortunately though this is not supported, as there are no bar objects in the Initialize to pull from at that point.

What you can do is add user defined inputs when you add the strategy to set these manually when you first add the strategy. Let me know if you need further information on how to do this if this is what you want to do.

http://www.ninjatrader.com/support/f...ead.php?t=5782

Let me know if I can be of further assistance.
NinjaTrader_Brett is offline  
Reply With Quote
Old 06-02-2010, 08:13 AM   #3
bubblegum
Junior Member
 
Join Date: Nov 2009
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
Default

Thank you.

Can this be added as an Enhancement Suggestion somewhere?
bubblegum is offline  
Reply With Quote
Old 06-02-2010, 08:22 AM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Absolutely, I will get this sent to development for their consideration.

Thank You.
NinjaTrader_Brett is offline  
Reply With Quote
Old 08-19-2010, 04:44 PM   #5
molecool
Senior Member
 
Join Date: Jan 2009
Posts: 429
Thanks: 27
Thanked 11 times in 10 posts
Unhappy Want it as well

Quote:
Originally Posted by NinjaTrader_Brett View Post
Hello,

Absolutely, I will get this sent to development for their consideration.

Thank You.
This is something I would like as well - would appreciate this to be added into the next release.
molecool is offline  
Reply With Quote
Old 08-19-2010, 04:53 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

Thanks for the suggestion, Molecool.
NinjaTrader_RyanM 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
Add additional Periods and Plots to TRIX? JSBatch Indicator Development 9 06-01-2010 12:25 PM
Lastprice stays fixed on real-time datastream. ModularMix Version 7 Beta General Questions & Bug Reports 9 02-13-2010 03:44 PM
Accessing variable from a 5min Indicator and 15min Indicator mefTrader Market Analyzer 8 01-12-2010 09:14 AM
indicator as variable e-man Version 7 Beta General Questions & Bug Reports 3 10-20-2009 03:38 PM
ERROR: Failed to call 'Add' method for period type 'Tick' RK_trader Miscellaneous Support 24 06-04-2009 05:49 AM


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