if (getBarState() == BARSTATE_NEWBAR) {
lastKnownHigh = high();
// This resets the control variable to the current high. It gets reset with every new bar so we can track NEW BAR NEWER HIGHS.
}
if ((high() > high(-1)) && (high() > lastKnownHigh)) {
// This represents a NEW INTRA-DAY HIGH.
lastKnownHigh = high();
}
thanks brad,
i'm not looking at intraday. i'm looking at history bars locating lower lows & lower highs and drawing colored bars in a separate window. i want to locate the bar where the 'higher' low occurs indicating a possible turn-around .
not sure if this makes sense.
I created a new efs and pasted this code but I get the following error : Error: Failed to call function 'getBarState': not appropriate context 'global'. ? any ideas how to get this to work ?
if (getBarState() == BARSTATE_NEWBAR) {
lastKnownHigh = high();
// This resets the control variable to the current high. It gets reset with every new bar so we can track NEW BAR NEWER HIGHS.
}
if ((high() > high(-1)) && (high() > lastKnownHigh)) {
// This represents a NEW INTRA-DAY HIGH.
lastKnownHigh = high();
}
Comment