| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Script to (ATTEMPT) Force Download of historical data https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=254 |
Page 1 of 6 |
| Author: | mbkennel [ Sun Jan 15, 2012 6:54 pm ] |
| Post subject: | Script to (ATTEMPT) Force Download of historical data |
Here's a script I cooked up to ATTEMPT to download historical data on all found symbols. Sometimes iBars() forces a read, sometimes it doesn't work. Why? Empty4. It Print()s messages to Experts, so read it to see what didn't work. Try it again, or go do those pairs manually by opening a chart and changing to every time frame and trying PageUp. UPDATE: new improved version uses error checking as described below, puts up Alert() at end for failures. |
|
| Author: | gaheitman [ Mon Jan 16, 2012 7:32 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Nice work. I was looking into this as well and stumbled across this: http://forum.mql4.com/45525#567226 Basically, it says that ArrayCopyRates() will also grab data, and it seemed they were satisfied that it worked for recent data. It may have the same results as iBars or your other methods, but I thought it worth mentioning. Also, the call to iBars triggers a download, but doesn't wait. So for the first call, it will return zero bars, but it will have queued a request to download the information. I also ran across mention of error 4066. From the documentation: Code: Select all George |
|
| Author: | mbkennel [ Mon Jan 16, 2012 8:10 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Thanks. I updated top-post with an updated version with that error check & minor tweaks (like I forgot about PERIOD_W1) Let me know how it goes everyone. This is very crim-dependent. |
|
| Author: | SteveHopwood [ Tue Jan 17, 2012 11:34 pm ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Fantastic again Matt. Many thanks. I am busy catching up following my internet downtime and have not looked at the code. Is it easily added to our shell code and other EA's such as Graeme, or does it need a lot of adapting? Cheers Matt. I believe I have mentioned occasionally that you are a star? |
|
| Author: | MichaelM [ Tue Jan 17, 2012 11:43 pm ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Matt you're awesomeness |
|
| Author: | blazko [ Tue Jan 17, 2012 11:56 pm ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
great great! Thank you. |
|
| Author: | MiTija [ Wed Jan 18, 2012 12:21 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Well Done!!! Thank you, MiTija |
|
| Author: | hanover [ Wed Jan 18, 2012 12:39 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Great work, Matt. Your script is very useful for loading OHLC data across all pairs/TFs for subsequent use in the Recent Strength indy that I developed, which is the prerequisite data source for Steve's 'hanover' EA (here: http://www.stevehopwoodforex.com/phpBB3 ... p?f=5&t=31) Previously it was necessary to manually visit each TF for every pair, and then hold down the PageUp key to load the data. Or alternatively, wait for the RS indy to load the data, which (if using all 9 Empty4 TFs) for some crims would take anything up to 20 minutes. I just ran your script across AxiTrader's Empty4 and then when I attached the RS indy – presto! – the plots took shape immediately. Many thanks for your efforts. David |
|
| Author: | mbkennel [ Wed Jan 18, 2012 1:21 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
It should be easy to add (it is mostly modularized in subroutines), but it can take quite a while to execute. It tries to download all timeframes. If the EA doesn't use all timeframes, it would take too much time. And if it is not multipair then it doesn't need to test the other pairs. And it can fail, or appear to fail, and the next time you run it succeeds as Empty4 and your crims internet catches up. Or doesn't. We could design a 'library' (I know you hate using real libraries vs cut and paste) bool attemptDownloadSymbol(string symbol, int time_frame) if symbol is StringLength()==0, do all, if time_frame is 0, do all. returns true if successful, false otherwise. This could be put into various EA's init(). |
|
| Author: | SteveHopwood [ Wed Jan 18, 2012 2:16 am ] |
| Post subject: | Re: Script to (ATTEMPT) Force Download of historical data |
Much food for thought here guys. Thanks. |
|
| All times are UTC | Page 1 of 6 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|