NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > Application Technical Support > Charting

Charting Support for NinjaTrader Advanced Charting.

Reply
 
Thread Tools Display Modes
Old 07-10-2008, 12:45 AM   #1
greentrader
Member
 
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
Default Daily EMA last bar calc missing?

I notice that in both a MarketAnalyzer and a Chart, the calcuated EMA for a range of daily data does not produce a result for the very last bar in the chart. For example, on 7/9 it only showed results up to 7/8, even after the market day ended and the 7/9 bar was closed.

This is a problem since I need to know what the EMA was for the pervious day BEFORE the market opens the next day, not after it opens. I'm new to this, so I may easily be missing something.

Also, is this a general issue with all indicators? Do indicators not get called for the very last bar until the next one opens?
greentrader is offline  
Reply With Quote
Old 07-10-2008, 01:31 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Please make sure you have both MarketAnalyzer and Chart set to the same CalculateOnBarClose setting.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-10-2008, 04:32 AM   #3
greentrader
Member
 
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
Please make sure you have both MarketAnalyzer and Chart set to the same CalculateOnBarClose setting.
Yes, they are both set to CalculateOnBarClose = TRUE. (I don't want to waste time having the calculation done more than once per day.)

Problem seems to be though, that a daily bar (of an index) is not recognized as "closed" until start of next day, so I can't see yesterday's EMA until after today's open. If trying to get any of the big daily EMAs (200, 50, etc.), they'll are delayed until start of next day, even though the previous day's bar is "closed" long before that.

Surely there must be a workaround for this. I've also verified with another program that the EMAs being calculated by NT are correct, but am just missing that last day's calculated value, which, for most indices, should be available after the market closes that day.

I just checked this again this morning, and the close from yesterday's index data is still not being used to calculate yesterday's EMA, even though the markets have been closed since yesterday afternoon. I presume that this won't be updated until the market opens today and the first data shows up for these stock indices.
greentrader is offline  
Reply With Quote
Old 07-10-2008, 04:48 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> Problem seems to be though, that a daily bar (of an index) is not recognized as "closed" until start of next day, so I can't see yesterday's EMA until after today's open. If trying to get any of the big daily EMAs (200, 50, etc.), they'll are delayed until start of next day, even though the previous day's bar is "closed" long before that.

Not sure I follow. If that would be true than it would be true for chart and MA.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-10-2008, 05:05 AM   #5
greentrader
Member
 
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by NinjaTrader_Dierk View Post
Not sure I follow. If that would be true than it would be true for chart and MA.
Yes, problem occurs whereever EMA is used, in both chart and MA.

I've attached a small screen dump to illustrate the problem. The SP500 EMAs from daily data are not being calculated for the last closed bar, meaning I can't see what yesterday's value is for use today...

Edit: I can see why this is not normally a problem for continuous data. But the daily index bar data has a big time gap between bars, so the "close" of a bar does not correspond to the "open" of the next bar. Perhaps the underlying NT code is not recognizing this issue, and is assuming that bar closes always occur with bar opens.
Attached Images
File Type: jpg bigema.jpg (25.6 KB, 4 views)
Last edited by greentrader; 07-10-2008 at 05:11 AM.
greentrader is offline  
Reply With Quote
Old 07-10-2008, 05:10 AM   #6
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Set CalculateOnBarClose=false to get the EMA for the last bar.
NinjaTrader_Dierk 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
Fibo Bollinger calc Burga1 Indicator Development 9 09-22-2009 10:08 PM
Session times/bar calc nicko9 Market Analyzer 5 05-25-2009 12:55 AM
Pivot calc BigAAPL Charting 2 07-01-2008 07:56 AM
Calc an angle? Burga1 Indicator Development 1 01-29-2008 09:52 AM
Backfill data in Daily chart (July/August data missing) RK_trader Charting 4 09-09-2007 10:52 PM


All times are GMT -6. The time now is 09:54 AM.