modify time frame - how to ?

 

hello frds

i am using standard 4 hours candle, how can i get customised periods like 3.5 hours or 210 minutes ?

tks frds

lerecidiviste

 
lerecidiviste:

hello frds

i am using standard 4 hours candle, how can i get customised periods like 3.5 hours or 210 minutes ?

tks frds

lerecidiviste

Use script period_converter.

 
Irtron wrote >>

Use script period_converter.

tks i try it have a good day frd

 
lerecidiviste:

i am using standard 4 hours candle, how can i get customised periods like 3.5 hours or 210 minutes ?

The period_converter script will let you create a history file which can then be opened as an offline chart (using File/Open Offline). For example, you could run period_converter on an M1 chart, and enter 210 as the ExtPeriodMultiplier. Or you could run it on an M15 chart, and enter 14 as the ExtPeriodMultiplier. Or an M30 chart, and use 7 as ExtPeriodMultiplier etc. These all ought to give the same result, but you never know with broker history data...


However, those are offline charts. It's a different kettle of fish if you want an EA which trades off bespoke time periods. If so, I'm not aware of any alternative to building your own aggregated bars in memory in the EA, using the same sort of technique as period_converter. Things then become interesting if you want to calculate indicators on your bars. Only a subset of the built-in indicators have versions with work on arrays as well as on native MetaTrader price data.

 
jjc:

However, those are offline charts. It's a different kettle of fish if you want an EA which trades off bespoke time periods. If so, I'm not aware of any alternative to building your own aggregated bars in memory in the EA, using the same sort of technique as period_converter. Things then become interesting if you want to calculate indicators on your bars. Only a subset of the built-in indicators have versions with work on arrays as well as on native MetaTrader price data.




This is not entirely accurate. 

There is no problem with customer indicators running on an offline chart whatsoever.

As per EA there is a technique that allows to run it on a non-standard time frame too.


I mentioned period_converter for an example that can produce asked periods. It's far from perfect anyway. In my opinion of course.

 
Irtron wrote >>

This is not entirely accurate.

There is no problem with customer indicators running on an offline chart whatsoever.

As per EA there is a technique that allows to run it on a non-standard time frame too.

I mentioned period_converter for an example that can produce asked periods. It's far from perfect anyway. In my opinion of course.

Hi Irtron,

You state there is a technique that allows you to run non-standard time frames too. How do you do this? I am very interested as I am new to MT4 and am building an EA that works on 1hr, 3hr and 7hr timeframes, so need to find a way to force EA to work on this. Any direction you could provide would be appreciated.


Thanks

Steve

 
SteveD:

Hi Irtron,

You state there is a technique that allows you to run non-standard time frames too. How do you do this? I am very interested as I am new to MT4 and am building an EA that works on 1hr, 3hr and 7hr timeframes, so need to find a way to force EA to work on this. Any direction you could provide would be appreciated.


Thanks

Steve

This involves writing data in real-time to a none standard time-frame HST file, having that file on an offline chart and having the chart update continually every x secs. This is none-trivial but can be done. You can search for 'offline chart update' and also check Period Converter Optimized for more info.

Reason: