How to Create Custom Time Frames in MetaTrader 4

MetaTrader 4 Custom Timeframes

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 MT4 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 automatically backtest trading strategies.

Users of MetaTrader 4 also enjoy a community of traders that program and freely 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 just about any trading strategy can be programmed.

Even with all its flexibility, MetaTrader 4 does have its limitations. For one, constant volume charts (also known as tick charts) aren’t available for MT4 by default. I’ve written an article on how to create tick charts in MT4, but I’m still keeping my eye out for a more practical solution.

I still haven’t found a single tick chart solution that doesn’t have to be rebuilt each time the custom tick chart or the MetaTrader 4 platform is closed. If you switch between profiles often, 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 custom indicator for MT4 called a period converter.

Note: MetaTrader 4 comes with a PeriodConverter script, but it has to be reapplied to your charts every time you restart the platform. The indicator downloaded from this page does not need to be reapplied to your charts after each restart.

Use the 7-step process below to create custom time frames in MT4:

Create Custom Chart Times with this Easy-to-Use MT4 Period Converter Indicator

Step 1 – Download the custom P4L PeriodCon 509 indicator.

Step 2 – Move the extracted file to your Indicators folder (File > Open Data FolderMQL4 > Indicators).

Step 3 – Start or restart MetaTrader 4.

Step 4 – Open a chart of the currency pair that you would like to make a custom time frame for.

Step 5 – Open your “Navigator” window (Ctrl+N), if it’s not already open, and drag the custom MT4 period converter onto your desired chart.

MT4 Period Converter

Step 6 – Adjust your settings under the “Inputs” tab, if needed and click “OK”. The only setting that most of you will need to adjust is the value for the “PeriodMultiplier” variable.

Note: Under the “Common” tab, make sure “Allow DLL imports” is checked or else this indicator will not work.

In the picture above, the “PeriodMultiplier” variable is set to a value of 2. This number can be changed to whatever you like. The chart that you apply this indicator to will be multiplied by this number.

Example: If you apply the MT4 period converter with the setting of 2 (above) to a 5 minute chart, this would produce a 10 minute chart. If you change “PeriodMultiplier” to 4, that same 5 minute chart will produce a 20 minute chart.

You can also 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.

Custom Chart Times MT4

Step 7 – To use your 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 above.

Navigate to and open your newly created custom time frames (see the picture below). Your new custom chart times will stay active, as long as the original chart (the one that you applied the MT4 period converter to) stays open.

Custom Time Frames MT4

Important! You must keep the original chart(s) open (the ones that you applied the indicator to) or else your newly created custom time frames will not update in real time.

How I Trade with this MT4 Period Converter

If I’m setting up my charts to trade a multiple time frame strategy, I could create groups of 3 custom time frames that are 3 periods apart from each other. Something like this: GBPUSD 8 Hours – 1 Day – 3 Days (8 Hours x 3 = 1 Day x 3 = 3 Days).

To accomplish this, I open a GBPUSD chart and select the 4-Hour default time frame in MetaTrader 4. Then I apply the custom MT4 period converter to my 4-Hour time frame with the “PeriodMultiplier” variable set to 2. This creates an 8-Hour custom time frame.

Since the 1-Day time frame is available by default, I simply need to open a new GBPUSD chart and set it to D1. Next, I apply a second instance of the custom MT4 period converter to my original 4-Hour chart. This time I set the “PeriodMultiplier” to 18, which produces a 3-Day chart.

Note: I could also apply the custom period converter to my 1-Day chart and set the “PeriodMultiplier” to 3 to produce a 3-Day chart.

Now, I have a short, medium, and long time frame group for swing trading setups. Lastly, I would save this as a separate profile for this currency, and call it something like GBPUSD 8H-D1-D3 or GBPUSD Swing Trade.

This way I can open other charts and profiles, but you can always come back to my custom GBPUSD profile without having to go through these steps again. I personally use a separate profile for each currency and relative time frame (e.g., GBPUSD Short, GBPUSD Medium, GBPUSD Swing Trade, etc…).

Note: Although this custom MT4 period converter is a big improvement over the default script, it can still be resource hungry when many custom charts are open at once. Setting up groups of custom chart times in separate profiles can save you some headaches, and your CPU will thank you.

Multiple time frame trading is a popular technique. It’s great for timing entry triggers and making fractal energy observations.

In the past, I used these custom chart period groups in MT4 regularly, so I figured you might find this guide helpful.  Now you know how to create your own custom time frames for MetaTrader 4 by using this free MT4 period converter. If you have any questions, please leave a comment. I’m happy to answer them.

121 thoughts on “How to Create Custom Time Frames in MetaTrader 4”

  1. Hello Chris,
    Can i possibly create a 3min chart with this and set it with indicators that have alerts?
    Would it work?
    Also what will be the timing between the chart and real data updates?

    • Yes, Victor, you can multiply a 1-Minute chart by 3 with this indicator and add any other indicators you want. The timing, as far as I know, is instantaneous or nearly so. There’s not enough of a delay that it would ever affect your trading in any case.

  2. I have gone through the above mentioned procedure and now I have H4, M3 and M2 charts on my Mt4 platform. But actually it does not update and the chart does not move. I wonder if there is any way to update the chart? If not what is the use of outdated chart?

    • I just tried this indicator again on the latest build (1090). I downloaded this indicator and installed it per the directions on this page. It works for me. My created charts update in real time. You’re doing something wrong. Remember, you have to keep the chart(s) that you attach this indicator to open or else your created charts will not update.

      “Your new custom chart times will stay active, as long as the original chart (the one that you applied the MT4 period converter to) stays open.”

  3. Hi, thanks for the indicator 🙂
    I just have problem when I apply the indicator on the monthly chart and try to create 3, 4 or 6 month timeframes….it keeps creating a candle non stop……….

  4. Hi Chris,
    I reviewed some comments about time frame converter. I am still curious. If I makes EA working at offline chart , do you think I must open the regular chart with EA first? For example, if I want to use 2 hour offline chart with EA, I must open 1 hour chart with EA? In this case, EA is working on what chart? 1 hour or 2 hours?

  5. Hi,

    I’ve had this indicator for a while, but it seems to be factoring in the weekend when there is no trading.

    For example, I want to create 2 Day charts but it’s factoring in the weekend days of no trading activity, so it’s not accurate. So for example; Friday and Saturday will produce just the “Friday” daily candle instead of the “Friday + Monday” candle.

    Ive been using it by opening a daily chart and then change the multiplier by “2”.

    I’ve also tried it by opening a 1 hour chart and changing multiplier by “48”, but the result is the same.

    Am I missing something?

    • Hey John,

      This indicator cannot create ticks where your broker has none, so it sounds like the weekend data issue is a broker issue.

      As for your “Friday + Monday” candle comment: You don’t want that anyway. A combined-day candle chart is wrong. MT4 brokers were known for doing that stupid stuff in the past, but most use charts with a 5-daily-candle week these days.

      That’s how it should be. It depends on the kind of trading you’re doing, but it’s extremely important in certain trading methods, like candlestick trading, to use 5-daily-candle charts with NY close on the Friday candle.

      Like I mentioned, most MT4 brokers do use the correct charts these days. If your broker doesn’t, don’t use their charts for trading decisions. Just use them for order entry. You’re just shooting yourself in the foot using bad charts. You can always use another broker’s demo for charting if you still want to use this indicator.

  6. how can run micro time frame like 5 seconds chart using backtest with fast speed,
    i have FlexiChart_2.0.ex4 expert can run micro time frame using backtest but is not fast and take cpu, and i have FX Blue – Custom Timeframe Generator.ex4 not work with backtest but is really fast on live
    plz help to find any good solution for backtest
    thank you

    • I’m not familiar with either of those EAs. To be honest, I’m not the person to ask about MT4’s backtesting feature. I’ve always done manual trading and manual backtesting myself.

  7. Hi Chris,

    Thanks for the indicator. i just have a problem. when i make a quarterly time frame. 2x of 1 month. the candles dont start from the beginning of the month. it starts from 14th, 25th or something random. how can i fix this please? i hope you are still following up with this post 🙂

  8. HI, Chris.. I am having an issue where the new offline chart doesn’t ever advance any new candles in real time. I dragged the converter to USD/JPy 1 hr and set up to multiply 12 with advance of 1 and then go to offline chart and open USD/JPY offline 12 H +1 chart and all loads, but the chart never moves forward. I always keep the original chart up that the converter script is using. Please help me get this working as this could make or break my strategy. Thanks a bunch in advance.

    • If you followed the instructions exactly and the indicator is not working for you, that means Metaquotes updated MT4 in a way that broke the indicator again. In the past, I’ve edited the code to get it to work, but that can take a long time. I don’t have that kind of time right now. You’re welcome to give it a shot.

      Edit: It’s working for the guy below you… at least he’s getting his custom charts to display.

  9. Chris, I have unchecked the “offline chart” box and the EA works find, but if I change my profile or close the platform I lose all the “offline chart” price data when I return. The offline chart turns into a standard H1 chart. Any idea on how to keep the box unchecked while saving the information during profile switching?

    • Hello Joyce,

      I’m not sure what you mean by “entry point.” Are you asking for tips on entry triggers. In other words, are you asking for advice on trade setups?

      If so, a large portion of this site is dedicated to that answer, and it’s not something that I could explain in one answer to your comment.

      However, price action is a good starting point for learning trade entries. Even if you don’t ultimately use price action for entry triggers, it’s still good to understand the concepts. They may give you clues that help you in the future, regardless of what trading system you end up using.

      I have a free price action course on this website. You can find it from the homepage, or just click here.

      If that’s not what you meant, please give me more details.

  10. Hi Chris. I was really excited to find your indicator. I use 2, 8, 6, and 12 hour charts so MT4 vanilla is pretty useless to me.

    However, your indicator doesn’t seem to work.

    Here’s the message I get after applying it to a 1-hour chart with a PeriodMultiplier of “2”:

    P4L PeriodCon 509,GBPJPY,H1 :Do File->Open_Offline of chart: GBPJPY,H2 (offline) (Time shifted 0min) and KEEP this Source H1 OPEN!

    However, the chart still shows “H1” and the chart data looks exactly like my other vanilla 1-hour chart. Seems to have done nothing.

    I’d love to get it to work. Any ideas?

    • Honestly, this indicator probably doesn’t work with your version of MT4. I didn’t create this indicator, but I used to update the code from time to time to make sure it was compatible with the latest versions of MT4. I haven’t had time to do that lately.

      It’s fairly simple to do, though. MetaEditor will tell you which lines are conflicting with the new version. If that’s too difficult for you, you can always pay a programmer to update it for you.

  11. Hello Chris, thank you for your hint in regards to the period converter. I would have the following question regarding timeframes: I know it is possible to create a 10 day chart ( timeframe ) with the period converter tool and it just works fine. Due to a specific trading strategy I would need a “10 day and 30 minutes” timeframe. A coach showed it on the platform thinkorswim, which he is using, but claims that the trading strategy would work on any platform which can trade forex. My question: Is there any way to create such 10days 30 minutes timeframe on the MT4?

    • Sure, Kris. You could just apply the period converter to a 30 minute chart and change the multiplier to 481. 10 days and 30 minutes = 14430 minutes / your 30 minute chart = 481.

  12. Hi Chris, Thank you for sharing your P4L PeriodCon 509 indicator. I downloaded it and it works perfect, which means I do not have to download all the indicators daily on the offline graph. Regards

  13. I followed the directions. Yet, my H2 Period looks exactly like my H1 after loading the indicator and choosing the DLL option in Inputs. If you can help with what may have gone wrong… Thanks!

    • Sorry for the late response. Had to be back at my home computer to check this out. Works fine for me. You must have done something wrong.

      Keep in mind that this does not work for MT5 – only MT4. You need to keep the chart open that you applied the indicator on and keep it on the time period you want multiplied as well.

      Sounds like you were expecting the indicator to modify the chart you applied it to, but it doesn’t work that way. It creates a new chart for you to open.

      The new chart you created will be in File > Open Offline. It’s all there in the instructions above. Just double check everything.

Leave a Comment