I've downloaded this Opening Range indicator from NT8 Ecosystem (see link below) I have modified the code so it is based on Open and Close of bar rather than High and Low of the bar. (See code below.). Basically I changed lines 136 to 145 to this. (See snippet below)
The open/close version (My version) works fine on bar close mode and on historical data but when I switch to On Each Tick in Replay Mode or Real time it reverts to High and Close. Not sure if I am missing to modify something? Please advise. Thanks in advance any help will be appreciated. I posted at the bottom the original code and modified versions.
LINK TO ORIGINAL INDICATOR
CODE MODIFICATION Lines 136 to 145 of original code.
// If we're in the range (inclusive), then start tracking highs/lows... if (Time[0] >= openDT && Time[0] <= rangeEndDT) { //CONDITION HIGHEST CLOSE if (Close[0] > highestHigh)//Changed High to Close { highestHigh = Close[0];//Changed High to Close highBar = CurrentBar; } //CONDITION HIGHEST OPEN if (Open[0] > highestHigh)//Changed High to Close { highestHigh = Open[0];//Changed High to Close highBar = CurrentBar; } //CONDITION LOWEST OPEN if (Open[0] < lowestLow)//Changed Low to Open { lowestLow = Open[0];//Changed Low to Open lowBar = CurrentBar; } //CONDITION LOWEST CLOSE if (Close[0] < lowestLow)//Changed Low to Open { lowestLow = Close[0];//Changed Low to Open lowBar = CurrentBar; } }
Comment