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 > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 08-05-2011, 01:20 PM   #1
ScottB
Senior Member
 
Join Date: Jan 2009
Posts: 414
Thanks: 0
Thanked 20 times in 20 posts
Default Indicator from a Strategy

Hi,

I have a calculation that needs to be performed on a minute bar to be accurate enough but I only need the information a few times per day.

If I call the indicator performing the calculations every 4 hours but the indicator works from minute data; are the calculations performed whether I call the indicator or not?

I feel I have seen this issue discussed but could not find the particular post.

Best Regards,
Scott
ScottB is offline  
Reply With Quote
Old 08-05-2011, 01:29 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
Default

Hello ScottB,

Depending on your calculate on bar close properties, the indicator will be recalculated either with every incoming tick (if set to false) or the indicator will be updated every time a new minute bar is formed (if set to true).

The indicator you are calling will be recalculated more frequently than the times you are calling it in the strategy.

Please let me know if you have additional questions.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-05-2011, 01:32 PM   #3
ScottB
Senior Member
 
Join Date: Jan 2009
Posts: 414
Thanks: 0
Thanked 20 times in 20 posts
Default

Matthew, thanks. If I understand you correctly, essentially, the called indicator updates based upon its data series as well as the data series of the calling indictor/strategy.
ScottB is offline  
Reply With Quote
Old 08-05-2011, 01:35 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
Default

ScottB,

Yes, exactly - it will attempt to recalculate based on the data series(s). If there are no changes, you wouldn't see an update until there is a new value and the calculation will output a new value.

edit: You may want to play with the Print() function to the output window in real-time to have a better understanding of how this may work for your particular script.
NinjaTrader_Matthew is offline  
Reply With Quote
Old 08-05-2011, 01:43 PM   #5
ScottB
Senior Member
 
Join Date: Jan 2009
Posts: 414
Thanks: 0
Thanked 20 times in 20 posts
Default

Matthew,

Thanks; but I now have another question regarding the print output below. I have one print statement in the calling indicator and one in the called (calculating) indicator.

As you can see the time stamps are not in sequence and I only get values when the calculations are called during real time (the calculations will not change during the day).

Calling indicator 8/5/2011 15:38:00 PM 0
Calling indicator 8/5/2011 15:39:00 PM 0
Calling indicator 8/5/2011 15:39:00 PM 0
Calling indicator 7/5/2011 16:52:00 PM 0
Calculation indicator 7/7/2011 16:15:00 PM 1,346.75 1,357.75 1,363.75 1,380.75 1,340.75 1,329.75 1,312.75
Calculation indicator 7/8/2011 16:15:00 PM 1,341.75 1,354.50 1,367.00 1,392.25 1,329.25 1,316.50 1,291.25

...

Calculation indicator 8/3/2011 16:15:00 PM 1,247.50 1,264.75 1,275.25 1,303.00 1,237.00 1,219.75 1,192.00
Calculation indicator 8/4/2011 16:15:00 PM 1,219.00 1,245.00 1,290.00 1,361.00 1,174.00 1,148.00 1,077.00
Calling indicator 8/5/2011 15:40:00 PM 1219
Calling indicator 8/5/2011 15:41:00 PM 1219
Calling indicator 8/5/2011 15:42:00 PM 1219

1219 is the correct value but notice I get 0 above, plus that print statement from 7/5 is quite odd.

Any thoughts?
Last edited by ScottB; 08-05-2011 at 01:46 PM.
ScottB is offline  
Reply With Quote
Old 08-05-2011, 01:54 PM   #6
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,781
Thanks: 159
Thanked 565 times in 556 posts
Default

ScottB,

Without the context of the conditions you are printing, I'm not sure what results we should expect here.

If these results are not expected, I'd suggest simplifying the code and maybe using only one print statement at a time until you can determine which piece is giving the inaccurate values.
NinjaTrader_Matthew 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
NT7B22: Strategy Analyzer chart, indicator on strategy attached to panel 1 nailz420 Version 7 Beta General Questions & Bug Reports 3 10-11-2010 09:09 AM
Multi Instrument and Indicator on Indicator in a Strategy MXASJ Version 7 Beta General Questions & Bug Reports 1 03-01-2010 10:29 AM
Bad scaling in strategy analyzer if indicator on indicator maxima Version 7 Beta General Questions & Bug Reports 2 12-23-2009 09:03 AM
Strategy Wizard indicator on indicator pgabriel NinjaScript File Sharing Discussion 1 08-29-2009 01:19 PM
Using Strategy Wizard to develope Indicator on Indicator mrlucky1x Indicator Development 3 08-25-2007 04:09 PM


All times are GMT -6. The time now is 05:49 AM.