Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

How to Plot Any Timeframe in Metatrader using Period Converter MQL4

4 min read

The period converter MT4 indicator lets you build any non-standard timeframe in MetaTrader 4, such as a 90 minute, 2 hour or 12 hour chart, by multiplying a base chart’s period and writing the result to an offline chart that updates in real time. MT4 ships with only nine timeframes (M1, M5, M15, M30, H1, H4, D1, W1 and MN), so the period converter is the standard way to get anything in between.

Some strategies work better in a timeframe which is not provided by default in MT4. And I do have a specific requirement to plot 90 min charts in metatrader which is not available by default in metatrader. I am using 90 min charts for Ichimoku Shorter term Trading system. Moreover, this method will update your custom chart in real-time, so it really is just as good as the default timeframes of the platform.

Key Takeaways

  • Custom timeframe = base chart period × PeriodMultiplier. M30 × 3 gives M90; H1 × 12 gives H12.
  • Use the Period_Converter_OPT indicator (downloadable below) or the period_converter script that comes with MT4; both create an offline chart you open from the File menu.
  • Keep the base chart open with the indicator attached, or the custom chart stops updating.
  • Tick “Allow DLL imports” and keep UpdateInterval at 0 for real-time updates.
  • MetaTrader 5 has 21 built-in timeframes (including H2, H3, H6 and H8) but still has no 90 minute chart, so the period converter approach remains useful in MT4.

How to Use Period Converter MT4 to Plot a 90 Min Chart

1)Download the indicator (Period_Converter_OPT.mq4) and extract the file into your /experts/indicators/ metatrader directory, double click on it to bring it up in the Meta Editor, and hit F5 to compile it. (By the way, this is an indicator file, NOT to be confused with the script file period_converter, which is provided in your platform.) It will then show up under “Custom Indicators” in your Navigator box.

OpenAlgo Desktop: algo trading on your own computer

WINDOWS, MAC AND LINUX

OpenAlgo Desktop: algo trading on your own computer

Install, sign in, connect your broker and trade. No server to set up and no Python to install.

  • Same API and screens as OpenAlgo web
  • Strategy module, charting and scalping terminals
  • Keys stay encrypted on your machine

2) If you want 90min (M90) timeframe charts , for example, open a normal M30 chart, and apply the Period_Converter_OPT indicator to it (drag/drop it into your chart). In the indicator’s properties box, choose the desired PeriodMultiplier (e.g. 3 i.e 3×30 for M90). IMPORTANT: In the “Common” tab, check the “Allow DLL inputs” box. Also, keep the UpdateInterval “0″ to allow the updates to be in real-time. Sample Axis Bank 30 min charts is shown below.

Axis Bank 30 min chart

3)On the main MT4 platform, go to File>Open Offline and your new chart will be listed, so simply choose it (e.g.AXISBANK , M90). This will bring up the new chart. Any indicators you apply to this new chart (e.g. MAs, Stochs, RSI, etc.) will be based on the custom time-frame.

Converted Axis Bank 90 min chart

4)IMPORTANT: You must keep the original chart (onto which you had originally applied the Period_Converter_Opt.mq4 indicator in Step 2 above) always open if you want the new non-standard time-frame chart to automatically update with current ticks. If you close that chart or remove the indicator from it, the custom chart will not update. The bid line will automatically move on the custom chart to verify that the chart is being updated with new data.

Period Converter MT4 Settings for Other Timeframes

That’s basically it. All multiples will work. So, if you want H12, for example, use PeriodMultiplier=12 on an H1 chart, keeping that H1 chart open if you want the new chart to be continuously updated. (Remember to always check “Allow DLL inputs”, too.)
Just another thought:

Someone asked me if an H2.5 chart was possible. Not if you use H1 as the timeframe for the base chart. But acceptable equivalents would be M150 obtained in any of the following ways:

PeriodMultiplier
=150 on an M1 chart
= 30 on an M5 chart
= 10 on an M15 chart
= 5 on an M30 chart

All will give you the equivalent of an H2.5 chart

Here is a quick reference for common custom timeframes and the base chart and PeriodMultiplier to use with the period converter in MT4:

Custom timeframeBase chartPeriodMultiplier
M10M52
M45M153
M75M155
M90M303
H2H12
H2.5 (M150)M30 (or M15, M5, M1)5 (or 10, 30, 150)
H3H13
H6H16
H12H1 (or H4)12 (or 3)
Base chart × PeriodMultiplier = custom timeframe

The custom timeframe must be an exact multiple of the base chart. That is why H2.5 cannot be built from H1 but can be built from M30, M15, M5 or M1.

Indicator vs Built-in period_converter Script

MT4 also includes a script called period_converter in the Navigator under Scripts. You drag it onto a chart, set ExtPeriodMultiplier (for example 2 on an H1 chart for H2), and open the result from the File menu’s offline charts list. The indicator version used in this post does the same job, but because it is an indicator it stays attached to the chart and keeps updating the offline chart with every tick.

If the downloaded .mq4 file shows compile errors in a recent MT4 build, check that you placed it in the MQL4/Indicators folder (opened via File → Open Data Folder) rather than the old /experts/indicators/ path used before MT4 build 600. For help with installing indicators, see how to install custom MQL4 indicators in MetaTrader.

Common Problems and Fixes

  • Offline chart does not update: the base chart was closed or the indicator removed. Keep the base chart open, even if minimised.
  • Offline chart not listed under File → Open Offline: the indicator did not run. Check that DLL imports are allowed and look for errors in the Experts and Journal tabs.
  • Bars look wrong at the session start: the converter groups bars from the broker server time. If your broker’s server time is not aligned with the NSE session (9:15 am IST), the first 90 minute bar will not start at 9:15.
  • Indicators missing on the custom chart: apply them again on the offline chart. They are calculated on the custom timeframe bars.

Does MetaTrader 5 Need a Period Converter?

MetaTrader 5 offers 21 predefined timeframes, from M1 to MN1, including M2, M10, H2, H3, H6 and H8. As an MQL5 forum moderator confirms, you cannot create your own timeframe in MT5. So for a 90 minute chart you still need either custom symbols built from M1 data in MT5 or the period converter in MT4. I use the 90 minute chart with the Ichimoku setup; if you trade that way too, see the Marketcalls Ichimoku setup for MetaQuotes.

Frequently Asked Questions

How do I add custom timeframes in MT4?

Apply the Period_Converter_OPT indicator (or the built-in period_converter script) to a standard chart, set the PeriodMultiplier, then open the new chart from File → Open Offline. The custom timeframe equals the base chart period multiplied by the multiplier.

Where is the period converter in MT4?

The built-in period_converter script is in the Navigator window under Scripts. The Period_Converter_OPT indicator from this post appears under Custom Indicators once you copy it to the MQL4/Indicators folder and compile it.

Why is my period converter offline chart not updating?

The base chart with the indicator must stay open, DLL imports must be allowed, and UpdateInterval should be 0 for real-time updates. Closing the base chart stops the updates.

Can I get a 90 minute chart in MT5?

Not as a built-in timeframe. MT5 has 21 fixed timeframes and the nearest are H1 and H2, so a 90 minute chart needs a custom symbol or a third-party tool.

Marketcalls Elite Traders Club

MEMBERSHIP

Marketcalls Elite Traders Club

Every Marketcalls course and live mentorship in one membership: 127 courses and 2,500+ hours of learning.

  • Market Profile, Orderflow, AFL, Pine Script and Python
  • Live mentorship and TradEdge trading room
  • Premium tools and the Elite Slack community

Learn by watching: free videos every week

Market Profile, order flow, Python, AI and OpenAlgo tutorials on YouTube.

Rajandran R Creator of OpenAlgo Sketchmaker, RagZ. Building GenAI Applications. Telecom Engineer turned Full-time Derivative Trader. Mostly Trading Nifty, Banknifty, High Liquid Stock Derivatives. Trading the Markets Since 2006 onwards. Using Market Profile and Orderflow for more than a decade. Designed and published 100+ open source trading systems on various trading tools. Now the recent curiosity on building Trading AI Agents.

16 Replies to “How to Plot Any Timeframe in Metatrader using Period…”

  1. if i put 1min chart – y cany i have 7-8-9 as a muliple!!
    y cnt i have a 3-7-12min chart!!
    is it possible

  2. Hi Rajandran.

    Thanks for your custom time frame in metatrader article. This one is i want.

    Please tell me,
    Is the forex control demo account provide nifty and banknifty current month futures? How long the demo period is Valid.

    Please post a article about how to import the nifty futures ieod one month data in meta trader manually?

    In amibroker using import wizard its possible? How to do in metatrader? so I request you please post a article about that for backtesting purpose in metatrader?

    Thanks
    Krish

  3. yah irt works. but you need to keep open 2 charts. nt a problem though.
    i was wonderin if we can get tick count charts…on 1min chart can i apply the multiple of 0.5 or 0.1…

    or

    do you have any other way 2 get the tick charts on MT4

  4. Have tried several period converters in my 64-bit computer and none will open. Tried all in MetaEditor and get 32-bit error. any ideas?

  5. though this application works, it seriously hampers the speed of the metatrader platform. iam using 8mbps net, i5 processor, 4 gb ram – still it takes ages to open a new chart or maneuver between the charts or change indicators.

    something is wrong in this indicator.

  6. you wont believe the moment i delete that chart, i am relieved. instantaneously it speeds up the work. no hanging of teh platform.

  7. Hi Rajandran,
    I am able to creating a custom chart on demo account.but it is showing the chart offline.How can I resolve this problem?

  8. The period converter MQL takes a multiplier but the script can be modified in 2 secs with an absolute number of minutes instead of a multiplier. For example you can create a PeriodConverterH7 and a PeriodConverterM90 and apply whichever you want now. That way it can be attached to any timeframe of the same symbol. Why would you add a constraint in your system to only watch one given timeframe or change the multiplier for each different timeframe?
    Also it’s a script, not an expert.

  9. Hello Rajandran,
    is it possibile to use period converter for backtesting strategies on MT4? For example: if I have M1 data, is it possibile to use period converter to backtest a strategy on H4 or D1 tick by tick, using M1 data and keeping quality above 90%?

    Thank you and wish you a good trading!

  10. Simply wish to say your article is as amazing.

    The clearness in your put up is just nice and i can think you are knowledgeable in this subject.

    Fine along with your permission allow me to clutch your RSS feed to keep up to date with impending post.
    Thanks a million and please continue the gratifying work.

Leave a Reply

Get Notifications, Alerts on Market Updates, Trading Tools, Automation & More