This forum is in read-only mode now. You may discuss your questions on forums of MQL4.community and MQL5.community

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


Back to topics list
avatar
13
wfy05 2005.12.02 03:20 
Posted on mql4 codebase.

http://www.mql4.com/codebase/indicators/277/

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.


avatar
242
GT48aec42c270a6 2005.12.03 05:50 
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??

avatar
13
wfy05 2005.12.03 18:15 
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.



avatar
242
GT48aec42c270a6 2005.12.05 03:15 
MQ, you think you might be able to do something with this??? Maybe???
avatar
4464
Slawa 2005.12.05 12:26 
scripts can run on the offline charts. script can contain endless loop with RefreshRates function call
avatar
242
GT48aec42c270a6 2005.12.05 12:28 
so you're saying write the EA as a script and just run it on an endless loop. hmm interesting.
avatar
13
wfy05 2005.12.05 14:02 
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

avatar
394
sub 2005.12.21 20:32 
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?
avatar
13
wfy05 2005.12.30 05:04 
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.

avatar
1
Prento 2010.04.22 19:30 
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?

Back to topics list  
Download MetaTrader 5 (450 Kb, web installer) — a new terminal for financial markets