![]() |
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
|
|||||||
| Charting Support for NinjaTrader Advanced Charting. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Please make sure you have both MarketAnalyzer and Chart set to the same CalculateOnBarClose setting.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Member
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
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. |
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
>> 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.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Member
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
|
Quote:
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.
Last edited by greentrader; 07-10-2008 at 05:11 AM.
|
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Set CalculateOnBarClose=false to get the EMA for the last bar.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Jul 2008
Posts: 80
Thanks: 0
Thanked 0 times in 0 posts
|
Okay, but that just means that NT is spending all day needlessly recalculating EMAs just so I can see the one calculation it does at the end of the day that matters. As noted in my previous post, I think the underlying indicator update callback is flawed in that it does not recognize when bars like daily index bars are truly "closed". Unless I'm missing something, this appears to be a simple bug that should be fixed (TradeStation, for example, knows the difference, and updates such indicators on the same afternoon that the bar closes).
|
|
|
|
|
|
#8 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
The previous bar is closed as the first tick of the next bar comes in. There is no "time based close" logic.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |