I need to do the logic below:
I need to calculate the gap between RTH sessions (chart with 30 minutes bar and only RTH session) and i use the code below with the priorDayOHLC:
// If the current date is not the same date as the current bar then its a new session
if (currentDate != sessionIterator.GetTradingDay(Time[0]) || currentOpen == 0)
{
// The current day OHLC values are now the prior days value so set
// them to their respect indicator series for plotting
priorDayClose = currentClose;
priorDayHigh = currentHigh;
priorDayLow = currentLow;
priorDayClose = PriorDayOHLC().PriorClose[0];
priorDayHigh = PriorDayOHLC().PriorHigh[0];
priorDayLow = PriorDayOHLC().PriorLow[0];
// Initilize the current day settings to the new days data
currentOpen = Open[0];
currentHigh = High[0];
currentLow = Low[0];
currentClose = Close[0];
currentDate = sessionIterator.GetTradingDay(Time[0]);
}
else // The current day is the same day
{
priorDayClose = PriorDayOHLC().PriorClose[0];
priorDayHigh = PriorDayOHLC().PriorHigh[0];
priorDayLow = PriorDayOHLC().PriorLow[0];
}
Please, can you help me providing the code?
Thanks

Comment