How to Create Custom Time Frames in Metatrader 4

How To Avoid Choppy Markets

Note: Do not download this script unless you are using an old MT4 build. All the new builds of Metatrader 4 come with this script now. Simply go to Scripts and drag the PeriodConverter onto your base chart. Everything else is the same.

Have you ever wanted to create your own custom time frames in Metatrader 4?  I’m going to show you how to do just that with a cool, easy-to-use period converter.  Creating custom chart periods is easy with the free Metatrader 4 platform.

Metatrader 4 is an award winning Forex trading platform, and is the most popular trading platform on the market today.  With Metatrader 4 (MT4), you can create custom trading robots called Expert Advisors (EAs), and you can even backtest trading strategies.

Users of Metatrader 4 also enjoy a community of traders that program and share their own EAs.  In fact, most of the custom indicators, scripts, and expert advisors are built and distributed by this tech savvy user community.  Almost anything can be found, and any trading strategy can be programmed.

Even with all its flexibility, Metatrader 4 does have its limitations.  For one, tick charts aren’t available for MT4.  Tick charts can be invaluable when trading news and other high volatility market situations, but the only tick chart solutions for MT4 so far are crude and frustrating to use.

I’ve yet to find a single tick chart solution that doesn’t have to be reset each time the custom tick chart is closed.  If you switch between profiles often, like I do, then something like that is simply not practical.

That being said, there are some features that Metaquotes (creators of MT4) overlooked that can be implemented fairly easily, and without a big headache from a practical standpoint.

One such feature that we can add is custom time frames, using a simple customer indicator for Mt4 called a period converter.

Create Custom Chart Times in MT4 with this Period Converter Indicator

All you have to do is download the Period_Converter_Opt file, and extract it or copy it into the custom indicators folder of your MT4 installation (Metatrader 4 > Experts > Indicators).  The next time you start MT4, you can drag your period converter onto any chart.

Note:  In the Common tab check ‘Allow DLL imports’ and clear the ‘Confirm DLL function calls’ checkbox, or this indicator will not work.

In the picture above, the PeriodMultiplier is set to 2.  This number can be changed to whatever you like.  The time frame to which you apply the indicator will be multiplied by this number.

Example:  If I applied the indicator with the setting of 2 (above) to a 5 minute chart, this would produce a 10 minute chart.  If I changed the PeriodMultiplier to 4, that same 5 minute chart would produce a 20 minute chart.

It is also possible to add multiple instances of the indicator to one chart.  In other words, you could create your 10 minute and 20 minute chart from the same 5 minute chart.  You would just have to add two of the period converter indicators to your original 5 minute chart.

In order to use these custom time frames in Metatrader 4, you must find and open them.  All of your custom time frames can be found in your offline charts (File > Open Offline). See the picture below.

Navigate to and open your new custom time frames for Metatrader 4 (see the picture below).  The new custom charts will stay active, as long as the original chart(s) stays open.  Setting these custom chart times up in separate profiles can save you some headaches.

Here’s an example of how I use this tool in my trading:  I open a GBP/USD chart and select the 1 minute default time frame in Metatrader 4.  Then I apply the period converter to my 1 minute time frame with the PeriodMultiplier set to 2.  This creates a 2 minute custom time chart.

I then apply the period converter to my new 2 minute chart.  Only this time, I change the PeriodMultiplier to 3.  This creates a 6 minute custom chart.  I repeat the process on the 6 minute to produce a custom 18 minute chart.

Now, I have a short, medium, and long time frame for short term trading.  I would then save this setup as a separate profile for this currency, and call it something like GBPUSD Short or GBPUSD Pound Dollar 2-6-18.

This way you can open other charts and profiles, but you can always come back to your custom GBPUSD profile without having to go through these steps again.  I personally use a separate profile for each currency and relative time frame (i.e. short GBP, medium GBP, long GBP, swing GBP, etc…).

Multiple time frame trading is a popular technique.  It’s great for triggers and fractal energy observations.  I typically trade with 3 relatively close time frames, according to the Top Dog Trading method.

I use this everyday, so I figured you guys might find it helpful.  I’m not sure who originally contributed this custom indicator, but it has been crucial to my trading system.  If you would also like to create your own custom time frames, download this free period converter for Metatrader 4.

Download the Period_Converter_Opt Indicator



  1. Hi Chris I liked your informative article on Custom Time Frames for Metatrader 4. This really solved my problem, thank you!

  2. Glad you liked it. I should do more how to articles in the future.

  3. Very interesting info! Perfect just what I was searching for!

  4. will it convert to a seconds chart ? and how please let me know .

    • Actually, Metatrader will only go as low as 1 minute. As far as I know, Oanda has a proprietary charting software that goes as low as 5 seconds, and I think they’re the only broker who offers such a thing. Google “oanda seconds chart,” and you’ll see what I mean.

  5. hi Chris thanks so much. But i would like to ask. Can an EA run on the offline chartS?

    • I’ve used them on offline charts before, but I’ve heard it both ways. I guess it depends on the EA. If it’s an EA that just needs to be run on the chart you are using, you could always just open another regular chart for your pair to run the EA on. 

      Also, the reason people usually say that EA’s don’t work on offline charts is because the offline charts don’t receive tick data, but this period converter gives the offline charts that you create tick data, so… I think most EA’s should work.

      Do you see what I’m saying? You are essentially creating active, custom charts out of offline charts using the period converter. My guess is that any EA should work on these.

  6. Thank you for this man!

  7. Hi Chris,
    Thanks, this indicator is really useful.

    Do you know if there is an indicator where you can pick the time you want the period to start? e.g. I would like to set up a 12 hour period and have it starting at 9am and 9pm, instead of 0:00 and 12:00

    • Not that I know of. Unfortunately, those periods are based on your Metatrader version. I’d like something like that as well, so that I could use NY based Forex charts for accounts abroad. I’ve never found anything like that, though. Let me know if you do.

  8. dlombard says:

    thanks for the converter. does the offline chart need to be continually refreshed or will it update just like a regular chart? I can’t seem to get it to give me real time data without refreshing.

    • It’s always given me real time data, but you have to keep the base chart open. In other words, if you’re multiplying a 5M chart by 4 to get a 20M chart, you have to keep the 5M chart open (with the converter attached).

  9. Go to scripts in mt4 and there is exactly the same period converter that you can drag on to your chart , then open offline chart with converted time.


    • Damien, it’s not exactly the same, but it works the same way. That’s a new addition. Thanks for bringing it to my attention.

      As for your second statement, I never said you couldn’t have tick charts in Metatrader 4. I said it was not practical. Every time you close MT4, you have to wait for the tick chart to rebuild itself.

      I stand by my statement, and most traders who actually trade live with MT4 will agree with me. Tick charts aren’t practical in MT4 just yet. For that you need to use Ninja Trader, Trade Station, proprietary platforms, etc. Hopefully that will change in the near future.

  10. Hi Chris: I have download the period converter and for some reason my platform is stuck. I can not click other window. How do I get rid off the offline window? Thanks

  11. This period indicator does not seem to work on the new build 604. Any advice to make it operational? I want to activate my Renko Charts on a 2 minute offline chart.

    • Dave, sorry for the late response. I’ve had a lot going on lately, and I’ve been falling behind on the site duties a bit.

      I’m not sure why it’s not working for you, but all the new builds of Metatrader 4 that I have used have included a period converter script of their own that works just like the one I originally uploaded to this site.

      You should find what you’re looking for in your “Scripts” folder.

  12. Jon Sigal says:

    Hi I am having problems with getting this indicator to work on my MT4 I put it in the experts/ indicator file close and reopen my MT4 see it on the customized list of indicators put when I click on it or drag it nothing happens? please help?

  13. Jon Sigal says:

    I found the answer on a different blog: Because of the new mt4 upgrade to 600+ i think thats why its not working.. But the period converter thats in the code base of your mt4 platform work .. Its under the scripts section .. I just tried it out and works ..

    • Yes… that was mentioned a few times above your first comment, but I’m glad you got it working for you. I need to update this article, now that MT4 includes this ability (and, like you said, the old indicator doesn’t work in the new MT4 builds).

  14. After add period converter example 2 hours, go to another profile 4 hours chats and come back to 2 hours charts profile, offline charts are not showing real time data. Again need to reload(drag period converter) to see real time data. Is any other ways offline charts still updated without reload period converter indicator

    • You always have to use offline charts when creating new timeframes, but they should work just like your regular charts. As far as switching profiles goes… I do this all the time without a problem.

      1. Make sure you’re using the built in period converter that is now offered directly from Metatrader 4.

      2. Make sure you save your profiles, and be sure you’ve included the original chart that has the period converter attached to it.

      Hope that helps. Let me know if you’re still having trouble.

  15. It’s so frustrating that MT4 creates a distinction between ‘standard’ timeframes, that can be opened immediately, and timeframes that are created by a script into a datafile.
    I am trading on multiple currencies, and my main EA takes decisions by looking at different distances to the market, I need at least 3 timeframes for each currency. When I realised that an indicator is able to take any of the enumerated timeframes BUT returns 0 if it’s not M1, M5, M15, M30, H1 etc, I was so disappointed. MT4 isn’t even able to return an error message to state the chart isn’t available.
    This article is very, very useful. Thank you.

    • Yeah. I use a bunch of indicators that work fine on the offline charts, but no EAs. Any EAs that I use (for break even, stop loss, etc.) can be added to the original base (standard) chart. Hope you get it working for you. Good luck.

  16. Ok, I have now imported this custom indicator into my Oanda MT4. If I attach it to a chart, nothing happens. No error message. No message in logs.
    Is it really compatible with MT4? as I see it was written in 2005.

    • Hello, Sylvain. All the new Metatrader 4 builds come with this script now. Just go to Scripts (under Indicators and Custom Indicators). The script is labeled PeriodConverter. Drag that onto a chart and change the Period multiplier factor to whatever you want (depending on what time frame you are trying to create). Remember to go to File > Open Offline to find your new chart. Also, remember that you have to keep the original chart open as well (the one that you dragged the PeriodConverter script onto). Hope that helps you.

  17. Hi, I have MT4 build 765 using the built in periodconverter script. The problem is the script gets removed when I close the platform. Is there a way to keep it on the chart when closing and reopening MT4?
    Thanks in advance

    • I’m not sure what the problem is. I have build 765 as well, and I’m experiencing the same issue you’re having. I just re-add the script to my original chart each time. It’s a pain. Hopefully they’ll get it sorted out by the next build, since this script adds a lot of functionality to the platform.

      • thanks for the reply. Its been a while since I’ve used that script, but I sure thought it stayed when opening and closing the platform. And thanks for the conformation I’m not going bonkers… yes hopefully this will get fixed. Maybe removing this script on close is by design, anyway to confirm that?

        • No problem. I’m not sure if it’s by design or not. If it is, that is a step in the wrong direction. You’re right; this script used to remain attached to a chart after reopening.

Speak Your Mind