I'm trying to figure out how to create a isNewBar function that works across multiple timeframes.
What I've created is this but it doesn't seem to be working and I can't work out why!
It's called by these instructions:
const bool isNewBar(const datetime time, int period)
static datetime time_prev;
if(time_prev!=time && MathMod(TimeMinute(time),period)==0)
seems to work.
doesn't. Any help will be appreciated.