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 01-07-2011, 10:10 AM   #1
poseidon_sthlm
Senior Member
 
Join Date: Aug 2009
Posts: 153
Thanks: 11
Thanked 5 times in 4 posts
Default Multi timeframe indicator passses output value for default session template

Hello! After a lot of hours trouble shooting, I belive that I have found an unexpected behaviour when referencing a multi timeframe indicator in a another indicator. The problem seems to be that the output value from the multi timeframe indicator always is calculated for the the default session template of the instrument, eaven when it's attached to a chart of another session template.

I have created a simple indicator that plots the SMA(20) for the 5, 10 min, 20 min, 60 min timeframes and added the indicator to a 5 min chart. This indicator calculates an output value that is the number of timeframes above the SMA(20) of the base period. The output series can be between 0 and 3. When I reference the output IntSeries in another indicator, the output value is calculated for the default session template of the instrument, although both indicators are attached to a chart with the ETH session template. I can see this for sure when I compare the print statments in the multi timeframe indicator for the same bar that is printed twice, since it also prints when the second indicator calls the first indicator. The output values differ. The multi timeframe indicator is plotted correctly in the ETH time frame. But when the output value is referenced by another indicator, it passes an output value for the RTH instead of the ETH, as expected.

/regards
Last edited by poseidon_sthlm; 01-07-2011 at 10:14 AM.
poseidon_sthlm is offline  
Reply With Quote
Old 01-07-2011, 10:39 AM   #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 poseidon_sthlm,

This is expected with your particular usage. It will use the default session template as defined in the instrument manager.

It will only use the chart session template if the multiseries indicator is applied to the chart AND you're accessing the values from within that multiseries script. Once you access it from another script is when it will use the instrument manager setting for session template.

We recently worked through this here:
http://www.ninjatrader.com/support/f...ad.php?t=37101

This is documented here > Notes in: True Event Driven OnBarUpdate() Method
http://www.ninjatrader.com/support/h...nstruments.htm
NinjaTrader_RyanM is offline  
Reply With Quote
Old 01-07-2011, 11:29 AM   #3
poseidon_sthlm
Senior Member
 
Join Date: Aug 2009
Posts: 153
Thanks: 11
Thanked 5 times in 4 posts
Default

Thanks for the prompt reply, as always It's appreciated.

I see now that I can achieve the behaviour I would expect by changing the default session template of the instrument. I also tried to add all the timeframes I use in the indicator to the chart, but that didn't make any difference.

I still feel that the current approach is confusing, although it is documented. I do suggest that one should be able to programmatically set the session template. Maybe as an additional parameter in the Add() method. Please forward this suggestion to your development department.

/Regards
poseidon_sthlm is offline  
Reply With Quote
Old 01-07-2011, 11:37 AM   #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

Sure thing - I will forward your request to allow session template as input parameter in multiseries scripts.
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
Change default session template v7 gg80108 Miscellaneous Support 9 08-09-2011 06:47 AM
looking for example 6.5 multi-timeframe indicator tulanch Indicator Development 2 10-08-2010 12:09 PM
Session Template Timeframe execution Oil_Trader Automated Trading 1 08-27-2010 12:53 PM
Multi timeframe indicator sergeysamsonov Indicator Development 1 07-26-2010 06:08 AM
Multi-Timeframe indicator velocity Version 7 Beta General Questions & Bug Reports 3 12-23-2009 11:28 AM


All times are GMT -6. The time now is 02:26 AM.