Hope someone can help.
protected override void OnBarUpdate() { int hour = Time[0].Hour; double currentHigh = High[0]; double currentLow = Low[0]; if (hour != currentHour) { // Start of a new hour, reset high and low currentHour = hour; hourHighs[hour] = currentHigh; hourLows[hour] = currentLow; } else { // Update high and low if necessary if (currentHigh > hourHighs[hour]) hourHighs[hour] = currentHigh; if (currentLow < hourLows[hour]) hourLows[hour] = currentLow; } // Plot high and low for the entire hour Values[0][0] = hourHighs[hour]; Values[1][0] = hourLows[hour]; } }
Comment