Download MetaTrader 5

Period converter optimized with real-time freshing support and low CPU cost

To add comments, please log in or register
Forex Trader
114299
Forex Trader  
Posted on mql4 codebase.

https://www.mql5.com/en/code/7673

The code is not fully tested, comments and suggestions are welcome.

Also a few suggestions for Metaquotes which i found might be useful while creating the converter.

1. option to disable certain indicator/experts/scripts temporarily without removing them,
to avoid losting of custom parameters.

2. a new catalogue in Navigator window to seperate script like indicator from the
custom indicator.
the script like indicator usually don't draw any line, and like the indicator,
start() will be called when new quotes income. also support more than one
running per chart. also, unlike indicator, they can call Print() function to
log message when needed.

3. option to enable reload scripts/indicators when changing server.

4. A possible bug:
MT4 don't confirm dll function call for indicators even when the option is checked and the indicator is calling a function.
Forex Trader
114299
Forex Trader  
This is pretty good, I like it. But 1 question...

Whats the effect of running an EA on an offline chart??
Since it is offline and doesn't have an incomming tick, will an attached EA still trigger??
Forex Trader
114299
Forex Trader  
This is pretty good, I like it. But 1 question...

Whats the effect of running an EA on an offline chart??
Since it is offline and doesn't have an incomming tick, will an attached EA still trigger??



EA won't trigger on offline chart, so it is still best if metaquotes decide to add some support in the client for the custom period timeframe.
Forex Trader
114299
Forex Trader  
MQ, you think you might be able to do something with this??? Maybe???
Forex Trader
114299
Forex Trader  
scripts can run on the offline charts. script can contain endless loop with RefreshRates function call
Forex Trader
114299
Forex Trader  
so you're saying write the EA as a script and just run it on an endless loop. hmm interesting.
Forex Trader
114299
Forex Trader  
Version 1.3 published, please update if you have an old version before reporting bugs :)


2005.12.04 1.3 Fixed missing data when there is large amount of data
loaded in several blocks, and support auto updating
when new history is loaded.
2005.11.29 1.2 Additional fix for missing data and server changing.
2005.11.29 1.1 Fixed missing partial data after restart.
Reinitialize after changing server or data corrupted.
2005.11.28 1.0 Initial release

Forex Trader
114299
Forex Trader  
so you're saying write the EA as a script and just run it on an endless loop. hmm interesting.

Have you try it?
How would you call indicator from the script to provide custom tick for the indicator?
Forex Trader
114299
Forex Trader  
Version 1.4 added, waiting to be approved.


2005.12.24 1.4 faster to detect if data changed by removing float point
operations, added support to output CSV file in real time.
OutputCSVFile = 0 means no CSV.
OutputCSVFile = 1 means CSV + HST
OutputCSVFile = 2 CSV only, no HST .
(useful if you want to generate CSV for builtin periods)
CSV Filename will be the same as HST file except the extension.
added safe checking for PeriodMultiplier.

Forex Trader
114299
Forex Trader  
wfy05 :
Version 1.4 added, waiting to be approved.


2005.12.24 1.4 faster to detect if data changed by removing float point
operations, added support to output CSV file in real time.
OutputCSVFile = 0 means no CSV.
OutputCSVFile = 1 means CSV + HST
OutputCSVFile = 2 CSV only, no HST .
(useful if you want to generate CSV for builtin periods)
CSV Filename will be the same as HST file except the extension.
added safe checking for PeriodMultiplier.

I am not a programmer but a trader so I don't have a deep understanding of code talk.

I want to create an ea using custom timeframe 10 mins 2hour etc. But as stated the price is not always live, and even when I refresh the offline chart it doesn't update to current market live price.

So is it possible to use custom timeframe to trade an ea?

To add comments, please log in or register