PDA

View Full Version : Price data on specific time frame.


The Shadow
03-16-2007, 09:35 AM
Hi,

Is it possible to take the data from 9:30AM - 10:30AMtime frame and get the high, low, median, and close of that time frame so I can plot this on a chart without using a 60 minute chart?

I would like to be able to get that information from the first 5 and 60 minutes of market data after 9:30 AM. This would be based off a 1 minute or 5 minute chart.

On a 5 minute chart this would be easy as I just need the first 5 minute bar but I do not want to have a seperate 60 minute chart in order to calculate the first 60 minutes.

Thanks,

Matt

NinjaTrader_Dierk
03-16-2007, 09:56 AM
Yes, you have to write code which after 10:30 goes X bars back until you cross the 9:30 and manually calculate the values you are looking for.

The Shadow
03-16-2007, 12:02 PM
Currently I am using this code to get to a certain time on the chart. Is there a better method for this as it seems this will not work for scrolling to past days on the chart. It only works on the current day.


CurrentBar - Bars.GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 35, 0);

Thanks,

Matt

NinjaTrader_Dierk
03-17-2007, 12:57 AM
- you should refer to "current" time by Time[0] and not DateTime.Now
- you should use the Open[barsAgo] (or High[barsAgo] etc.) to access the OHLC values and make sure barsAgo >= CurrentBar >= 0

The Shadow
03-17-2007, 01:04 PM
Thanks, everything is working now. :cool:

Matt