I have use SessionIterator, Bars.IsFirstBarOfSession, etc. But nothing seems to work. I did take NT8 custom CurrentDayOHL and got those values to plot only the RTH OHL. Here's my example of that:
if (!Bars.BarsType.IsIntraday) return;
lastDate = currentDate;
currentDate = sessionIterator.GetTradingDay(Time[0]);
if (Time[0] >= sessionIterator.ActualSessionBegin && Time[0] <= sessionIterator.ActualSessionEnd || Bars.IsFirstBarOfSession)
//if (Bars.IsFirstBarOfSession)
//if (lastDate != currentDate || currentOpen == double.MinValue)
{
currentOpen = Open[0];
currentHigh = High[0];
currentLow = Low[0];
//Print(Time[0] + "|" + "lastDate" + lastDate + "|" + "currentDate" + currentDate);
}
currentHigh = Math.Max(currentHigh, High[0]);
currentLow = Math.Min(currentLow, Low[0]);
//Print(String.Format("Time[0]: {0} lastDate: {1} currentDate: {2}",
//Time[0], lastDate, currentDate));
if (ShowOpen)
CurrentOpen[0] = currentOpen;
if (ShowHigh)
CurrentHigh[0] = currentHigh;
if (ShowLow)
CurrentLow[0] = currentLow;
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 1)
return;
if (Times[0][0].TimeOfDay >= new TimeSpan(17, 00, 00) || Times[0][0].TimeOfDay <= new TimeSpan(08,30, 00))
{
CurrentOpen[0] = CurrentOpen[1];
CurrentHigh[0] = CurrentHigh[1];
CurrentLow[0] = CurrentLow[1];
}
Thanks.
Comment