![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Feb 2010
Posts: 150
Thanks: 1
Thanked 1 time in 1 post
|
Example from manual:
if (Close[0] > Close[1]) Print ("We had an up day"); If CalculateOnBarClose is true, isn't every single tick the "close" so that if you run this code with that option on, you don't really know if you had an up day when you're running this test as you could always wind up lower at the end of the bar?. Now, if CalculateOnBaClose is false, you don't know when the bar has ended until you get the first tick of the next bar and then isn't Close[0] really Close[1] at that point? As I wrote above, I'm confused. Thanks, Stephen |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,560
Thanks: 261
Thanked 1,015 times in 996 posts
|
Stephen, it's more the other way around - CalculateOnBarClose = true calcs only on the bar close == the opening tick of the new bar, so you would then be in the position to know if you had an upday or not as the closing tick of the bar is in.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Dec 2010
Posts: 470
Thanks: 0
Thanked 4 times in 4 posts
|
Quote:
That explains the perverse behavior I have seen. If you are working with EOD data then you must always set COBC false. If it is true, then you will not process the last bar on your chart until the next day. For example, if you examine your charts in the evening, your indicators will not be up to date as of that day. Suggestion: NT ought to know when time-based bars are complete, and process them right away, without waiting for the next day. Otherwise you sit there wondering "What do you mean that today's NYSE trading has not closed? Try telling the NYSE that!" --EV |
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,560
Thanks: 261
Thanked 1,015 times in 996 posts
|
Thanks for the suggestion EV - NT's framework is event based and not time based .
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Dec 2010
Posts: 470
Thanks: 0
Thanked 4 times in 4 posts
|
Quote:
Whether or not you have them now, there certainly could be time events. Perhaps for those markets that do have a set open and close, such as NYSE, an event could be generated for the market open and close. I have not paid attention to strategies yet, but I can easily imagine wanting to do things with respect to market open and close. Market close could be used to mark bars for that market closed, rather than waiting for the next market day's trading to begin. As I said, no big deal for me personally -- just one of those little oddities. After all, it is "Calculate On Bar Close", not "Calculate When The Next Bar Opens". --EV |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Confused about Bars | skyholder84 | Automated Trading | 27 | 10-27-2010 12:42 PM |
| Confused | Mindset | Indicator Development | 6 | 09-02-2009 07:18 AM |
| Confused... | d.allen101 | Automated Trading | 1 | 06-16-2009 02:58 PM |
| Confused | Duval | Strategy Analyzer | 24 | 12-05-2008 03:19 PM |
| really confused about bid/ask/last... | behealed | Miscellaneous Support | 4 | 04-06-2008 09:47 PM |