NinjaTrader_Ray
01-15-2007, 02:02 PM
The method "Bars.GetBar(DateTime time)" returns the bar index value representing thefirstbar (from left to right)holdingthe specified time.
For example:
int barsAgo = CurrentBar - Bars.GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 0, 0, 0));
double closingPrice = Close[barsAgo];
Ray
For example:
int barsAgo = CurrentBar - Bars.GetBar(new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 9, 0, 0, 0));
double closingPrice = Close[barsAgo];
Ray