Detect if historical candle has X Minutes
-
Hello again, lovely people!
I've attempted to create a loop that goes through old candles and then marks them if they meet certain time criteria.
Specifically, if the loop hits a candle with six minutes (all hours), then draw something on the candle before.
So, what I need is a "condition" that will detect "true" when the time on the loaded candle has a set amount of minutes, but doesn't discriminate by hour or anything else.
I've tried a few different things, but this is the main one I feel is closest?

When I drop it on a chart, it's not ever making it to the draw commands I have. I put a custom MQL block with a print command down there and it's never printing anything (this is only able to be done after detecting a valid candle, and it never happens). So, I'm assuming that it's never flagging valid candles.
Thanks in advance for the help.
-
@l-andorrà Sorry to tag you. Is this something you're capable of answering? I know time is a quite tricky thing in Dreema. I'd like to refrain from dragging Roar in if I can avoid it. I feel bad for how he's basically the only person who can answer almost everything (that regularly answers anyways ahahaha).
-
Not sure if I fully understand what you exactly mean. Do you want to identify all candles lasting for at least 6 minutes? You can do that just by selecting a correct timeframe. Sorry for asking it but I simply don't get the idea.
-
@l-andorrà Thanks for the reply, bud. Sorry for not being clear enough.
I'm thinking every 1m candle (or any timeframe for that matter) with a server time of XX:05, I want it to give me a "true" output. And all others, a false.
So, I would like a condition, that when I run through a loop (increasing candle_id), then every time I hit an old candle with that server time, I want it identified.
-
Technically you can do it via loop, that is true, but now I don't see the logic behind that. Why not using the timeframe you need instead of searching for that info? In your example, if you select the 5M timeframe all candles will be of a XX:X5 type.