Timeframe of the chart

 
Hi
How to change PERIOD_M5 (5 minutes) to PERIOD_M10(10 minutes)?
Can anyone help me?
Thanks
Scott
 
 

mgw666, I have just been working on the same thing, adding different timeframe charts that can be opened along with, or instead of some of the built-in timeframes. Here is what I have found out so far.

Use the Period Converter Optimized mq4 file. Download this custom Experts Indicators file and paste it into the Experts/Indicators file in MT4 Program file. When you restart MT4, this Custom Indicator will appear in the Custom Indicators list in the MT4 Navigator.

I will use the creating of a 10 minute timeframe chart as an example of how to proceed. This Custom Indicator uses any built-in timeframe chart to enable the creation of a new, different timeframe chart of a LARGER timeframe, using a whole number multiple applied to the built-in timeframe chart that you select to start from.

Open a 5 minute timeframe chart. Go to Custom Indicators and right click on "Period_Converter_Opt" and select "Attach to a chart." At this point a window for this Custom Indicator should appear on the screen and you have to do two things. One, on the Common tab, check off "Allow DLL imports." Two, on the Inputs tab, select for the "Period Multiplier" a whole number that yields the new timeframe you want. In this case, to generate a 10 minute chart from the opened 5 minute chart, select the multiplier "2" (5min x "2" = 10min). Then click "OK". By the way, this Custom Indicator does not accept decimal numbers for multipliers. It only accepts whole numbers, so your new chart must be for a larger timeframe than the opened chart you are using to create the new timeframe chart from.

At this point you will not see any change in the chart. This is because this remains the opened 5 minute chart, which must remain opened for your 10 minute chart to work. To open the newly created 10 minute chart go to File at the upper left of MT4 window. Left click on File and you will see the second item down is "Open Offline", which you will left click on and then see a list of available charts, including the new 10 minute chart you created. Put the cursor on the line for this new chart and left click to highlight it. Then left click on "Open". Now your new 10 minute chart window appears! It is just like any other built-in chart, but the 5 minute chart must remain opened for it to work.

You can close the MT4 application and reopen it and the new 10 minute chart will reappear. In other words the new timeframe chart remains an active chart SO LONG AS THE 5 MINUTE CHART FROM WHICH IT WAS MADE REMAINS ACTIVE. If you close the 5 minute chart, the 10 minute chart will cease to be refreshed. I have not experimented with this yet during live market hours to know yet if the entire process needs to be repeated if you close the 5 minute chart and wish to have the 10 minute chart back again. The entire process, starting with opening a 5 minute chart, might need to be repeated. Or, maybe after opening the 5 minute chart you can go directly to File/Open Offline and open the 10 minute chart WITHOUT first re-applying the Custom Indicator to the 5 minute chart. I have the feeling the Custom Indicator must be reapplied, but you can experiment during live market hours to see if this is necessary.

I have requested that the Period Converter Optimized mq4 file be upgraded to accept decimal multipliers, which would add some flexibility. I want a 3 minute chart, as a lowest chart on display. Unfortunately, I can only produce it from the 1 minute chart using the whole multiplier of "3", and then keep the 1 minute chart open, too.

I hope this information helps you and any others looking to add custom timeframe charts to MT4.

 

It does work, But it is limited in capability. MT4 does not allow this code to work on more than one "breeder" chart at a time, and even then only to create one custom timeframe.

For example, while I was able to use a 1 minute chart for one currency pair to make a 3 minute chart, I could not also make a 360 minute chart (6 hours). Only the 3 minute chart would refresh. I tried to also use a 1 hour chart to breed a 6 hour chart, but it would not refresh either.....not while the 1 minute/3 minute charts were still active. Also, all attempts to use the indicator on another pair to create a 3 minute chart from a 1 minute chart failed while the original 1min/3min charts for the other pair remained active.

In other words, and contrary to statements made by the author of the code, it seems you can use this indicator in MT4 on only one chart at a time, and to "breed" only one custome timeframe from it. Making multiple timeframe charts from one "breeder" chart does not work....the additional charts do not refresh. And after you have your first custom timeframe chart running, you cannot get the indicator to work on ANY other timeframe for that pair, or for any other pair.

 
omgw666 wrote >>
Hi
How to change PERIOD_M5 (5 minutes) to PERIOD_M10(10 minutes)?
Can anyone help me?
Thanks
Scott

I have been looking for a 2 minute time period as i find it works really well with stochastics providing a reliable by/sell indicator (from another platform).

Is there no way to add to or change the default time buttons on MT4? If not, why is that?

Other platforms have 2 min or 10 min etc built in and MT4 should be customizable in that regard - could it not be an option to simply modify the time period shown on the screen by modifying or allowing changes to the time period buttons?

The period converter mentioned is an option but it sounds like it has limitations and issues. Any insight into why it hasn't been done yet would be great.

Reason: