.
. .
Of course we know that it HAS to be one of those periods... but still... that's the way it is..
No, it doesn't have to be one of those timeframes. Offline charts can use non-standard timeframes, e.g., M2, M6, M20, etc. See Chart Timeframes. If the chart's timeframe is non-standard, why not just return the custom timeframe? For example, the following code:
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Renders this result...

Download it and play with it and learn how to move it around...Have fun...PipPip..Jimdandy
. . .
Of course we know that it HAS to be one of those periods... but still... that's the way it is..
No, it doesn't have to be one of those timeframes. Offline charts can use non-standard timeframes, e.g., M2, M6, M20, etc. See Chart Timeframes. If the chart's timeframe is non-standard, why not just return the custom timeframe? For example, the following code:
.