Thanks. This is great! Will save me a lot of time. Thanks again.
Hendrick
Hendrick
Hello,
May I alter your script to get a range of data based on the 2 dates?
In your script: http://codebase.mql4.com/en/code/11173
where should I insert this "if" test to cut data (generated by periodgen. mq4)
- before the starting date dateStart
and
- after the ending date dateEnd
Which datetime's variable should be used in my IF test ?
Thanks a lot.
May I alter your script to get a range of data based on the 2 dates?
In your script: http://codebase.mql4.com/en/code/11173
where should I insert this "if" test to cut data (generated by periodgen. mq4)
- before the starting date dateStart
and
- after the ending date dateEnd
Which datetime's variable should be used in my IF test ?
datetime dateS=D'2005.03.01 00:00:00';
datetime dateE=D'2007.03.01 00:00:00';
// d is the date recorded in the files /databank/XXXXXXYY.hst
if (dateStart<=d && d<dateEnd) {
... (part of periodgen.mq4 script filling the the files)
}
Thanks a lot.
budhax:
Hello,
May I alter your script to get a range of data based on the 2 dates?
In your script: http://codebase.mql4.com/en/code/11173
where should I insert this "if" test to cut data (generated by periodgen. mq4)
- before the starting date dateStart
and
- after the ending date dateEnd
Which datetime's variable should be used in my IF test ?
I guess you can try it right where the write is
But why would you want to do that.
When backtesting you can always select a range of dates there.
When loading into history thru tools/history you can always select a range of records to load.
I wouldn't vouch for the code above as I've never tested it.
Hello,
May I alter your script to get a range of data based on the 2 dates?
In your script: http://codebase.mql4.com/en/code/11173
where should I insert this "if" test to cut data (generated by periodgen. mq4)
- before the starting date dateStart
and
- after the ending date dateEnd
Which datetime's variable should be used in my IF test ?
I guess you can try it right where the write is
datetime dateS=D'2005.03.01 00:00:00';
datetime dateE=D'2007.03.01 00:00:00';
// d is the date recorded in the files /databank/XXXXXXYY.hst
if(newtime != pTime[i] || isEndOfFile) { if (dateStart<=d && d<dateEnd) {
... (part of periodgen.mq4 script filling the the files)
FileWriteInteger(pFile[i], pTime[i]); FileWriteDouble(pFile[i], pOpen[i]); FileWriteDouble(pFile[i], pLow[i]); FileWriteDouble(pFile[i], pHigh[i]); FileWriteDouble(pFile[i], pClose[i]); FileWriteDouble(pFile[i], pVolume[i]);
rest of the code }
}
But why would you want to do that.
When backtesting you can always select a range of dates there.
When loading into history thru tools/history you can always select a range of records to load.
I wouldn't vouch for the code above as I've never tested it.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
periodgen:
Author: Iggy