X

## Attention!

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

 NinjaTrader Support Forum Help With Strategy

 General Programming General NinjaScript programming questions.

 06-29-2011, 02:42 PM #31 NinjaTrader_Josh NinjaTrader Product Manager     Join Date: May 2007 Location: Denver, CO Posts: 17,458 Thanks: 1 Thanked 106 times in 70 posts Not sure I follow. You don't actually need to create an array just to be able to inject that into your nom/dem calculations. You already have the basis down for all the historical dates for nom/dem. So all you need to do now is before you do any of the historical dates, you want to do the current date first. Assuming BarsInProgress == 0 is a 1min series and session closes at 2PM (aka 140000). Code: ```if (BarsInProgress == 0) { if (ToTime(Time[0]) == 135900) { ArrayList nom = new ArrayList(); nom.Add(Close[0] - Math.Min(MIN(Lows[dailyBars], k-1)[0], CurrentDayOHL().CurrentLow[0])); x=0; while (x < d) { nom.Add(Closes[dailyBars][x] - MIN(Lows[dailyBars],k)[x]); x++; } // denoms ArrayList den = new ArrayList(); den.Add(Math.Max(MAX(Highs[dailyBars], k-1)[0], CurrentDayOHL().CurrentHigh[0]) - Math.Min(MIN(Lows[dailyBars], k-1)[0], CurrentDayOHL().CurrentLow[0])); x=0; while (x < d) { den.Add(MAX(Highs[dailyBars],k)[x] - MIN(Lows[dailyBars],k)[x]); x++; } ... ... } }``` Now you will have to play around with the idea here as I have not tested it, but it should give you a framework as to where to go. Above shows an example of adding the current day's info into the first [0] index and then adding all the historical stuff after it so you can access the ArrayList in proper chronological order. Josh NinjaTrader Customer Service Use Kinetick, NinjaTrader’s preferred market data service - Learn More Free online training events - View Schedule