Data Deterioration constant pain 'TRYING' to use Strategy Tester: No evidence that 'period converters' work!

 

The Constant Data Deterioration in the History Center is a constant pain TRYING to use the Strategy Tester. Also :

- There is NO evidence that the 'period converters' work!

- How to add more currency pairs and time intervals to the ‘OffLine Charts' selections?

This is a never ending pain! I have both the options to allow the maximum amount of data bars in both the history center and the charts. I’ve deleted all of the data in the history center. I then double click on all of the 1 minute intervals for all of the currency pairs as opposed to using the ‘DownLoad’ button. I’m not sure if I get the data from my broker's server or the amalgamated data from MQ. It seems to be from the broker as I don’t get the ‘MQ’s ‘Disclaimer’ about the data when the 'DownLoad' button is used. I then go through ALL the 1 minute data in the history center and change the last entry to the year 1970. Then open up all of the charts offline in a 1 minute interval and ‘refresh’ them all leaving them for as much as two days to complete this task and thus supposedly fully completing all of the data that the broker has for all currency pairs. I’ve tried both closing out these charts and leaving them open to harvest new data. I then delete all of the last data entries dated to 1970 and then run the period converters: all three of them: The ‘Standard’ one, the ‘new ‘all time periods’ script (thanks to the Author ) and the optimized version that can be attached as an indicator. There is no evidence that this is actually doing anything! The data that supposedly gets converted to the different time periods doesn’t show up in the ‘History Center’ at all unless I double click on the time periods for the various currency pairs. So I don’t know where this data has actually been generated from? I’ve likewise tried opening up the higher time periods OffLine and with the last data point being set to 1970 and the longer interval charts ‘refreshed and updated’ again. I then delete all of the data points that were changed to 1970 again.

I run the tester a few times and then the data gets corrupted in all of the longer time periods and I’m back to square one and have to start the (Black!) hole process all over again! There HAS to BE a better, more reliable method than this continuously ongoing unproductive time wasting farce!?

If anyone sees a fault in my methodology and has any (hopefully effective) suggestions I’m sure that MANY others along with myself will be VERY happy to learn about them!

I have a number of different MT4 demos with different brokers. Some of them only have 4 ‘OffLine’ charts available. Does anyone know how to add more currency and time frames to the ‘OffLine’ Charts?

Addendum: NONE of the strategy testers in any of the various brokers and different MT4 clients, charts nad interval periods owrk at all now. They are all coming back with mismatched errors inspite of all that I have done as stated above.

For everyone’s sake, I VERY much hope that MQ figures out some sort of effective ‘workaround’ to this ongoing grief in MT5/MQL5!

Thanks to any and all for ANY assistance with this lame continuous ongoing, frustrating wasteful and seemingly never ending problem!

 
I know lots of others have similar problems. I've posted these before and have followed the suggested feedback, but to no avail. If anyone has any helpful insight to this ongoing problem over and above everything that I've tried, PLEASE post it!
 

FourX it sounds like you are using the process I posted about a while back (including the "all time periods" script) to refresh your hst files with the broker's data.

The "evidence" that the script has done something is found on your harddrive in the history folder for your MT4 application, look for the newly minted *.hst files.

So to answer initial question - yes they do work.

As to your comment regarding "data gets corrupted" I am not sure what it is exactly that you think is corrupted. Can you explain what it is that you are observing which is leading you to believe your data files are being corrupted?

Are you referring to the "mismatch" errors as being corruption? If so then that is easily explainable..nothing is corrupted. Mismatch errors refer to the tick volumes not matching for equivalent corresponding time frames between chart periods. For example in theory the tick volume for five M1 candles should be identical to the tick volume of the same single M5 candle that covers the identical time frame.

For instance take 12:05:00 to 12:09:59...the total tick volume for the 12:05, 12:06, 12:07, 12:08, and 12:09 M1 candles should equal the tick volume for the M5 candle that opened at 12:05...but sometimes it doesn't always happen perfectly and the tick volumes don't match up. That is what a mismatch error in strategy tester is telling you.

The reason why it seems to get worse over time after running the scripts is because the NEW data you have been collecting from your broker AFTER having ran the script contains NEW data mismatches whereas the script generates hst files that does not contain mismatch errors.

We previously talked about having seperate MT4 installations dedictated to specific purposes...aka the data harvesting MT4 instance seperate from your active trading MT4 instance. Likewise I would say the vast majority of MT4 folks I have worked with in the past keep yet another MT4 installation instance solely for strategy testing which does not actually log in to any server (when you open the MT4 app and it asks you to login or create demo account you just cancel out and you are left with an MT4 terminal which is not logged in to any broker so price data never changes, etc).

This prevents you from having your strategy tester runs changing over time without your having specifically changed the hst files in a controlled fashion. It is not necessary, and there are probably better solutions to be had, but it does get the job done.

 

I got fed up the data errors while testing so used

MyBid=NormalizeDouble(Bid,4) ; //To solve test data errors
MyAsk=NormalizeDouble(Ask,4) ; //To solve test data errors

as a workaround

Only really need the MyBid and MyAsk in OrdersSend(......)

 
Ickyrus:

I got fed up the data errors while testing so used

MyBid=NormalizeDouble(Bid,4) ; //To solve test data errors
MyAsk=NormalizeDouble(Ask,4) ; //To solve test data errors

as a workaround

Only really need the MyBid and MyAsk in OrdersSend(......)

I wouldn't call this an 'error' and this is not a 'workaround'. The requirement to normalize prices is well documented and makes perfect sense. Since decisions in MT4 'cost money', the platform is designed to make no assumptions about user requests. Specifically, it requires prices to be exact and accurate.

 
1005phillip:

Coments InLine (CIL)

Hi Phillip et al,

FourX it sounds like you are using the process I posted about a while back (including the "all time periods" script) to refresh your hst files with the broker's data.

Yes: My confusion arose from the fact that they do not show up in the 'History Center" (F2) which is rather strange. But 'strange' is 'common practice' with MQL.

.

Are you referring to the "mismatch" errors as being corruption? If so then that is easily explainable..nothing is corrupted. Mismatch errors refer to the tick volumes not matching for equivalent corresponding time frames between chart periods.

Again: correct. The net result is that it renders utilizing the strategy tester useless.

.

The reason why it seems to get worse over time after running the scripts is because the NEW data you have been collecting from your broker AFTER having ran the script contains NEW data mismatches whereas the script generates hst files that does not contain mismatch errors.

Running the 'All periods' script should take care of this problem?

Though as their is no indication of the progress and duration of this task to know when it is finished.

.

We previously talked about having separate MT4 installations dedicated to specific purposes...aka the data harvesting MT4 instance separate from your active trading MT4 instance.

I often use numerous MT4 clients that are running Demos for forward testing to also do back testing as well, thus they are logged on.

.

Likewise I would say the vast majority of MT4 folks I have worked with in the past keep yet another MT4 installation instance solely for strategy testing which does not actually log in to any server.

I'll try this out though my computer is getting close to reaching the 'limits of it's capacity' Trying to add more simultaneous tasks just ends up making everything slow down so much or (almost) completely grind to a stop and renders everything useless. Then periodically LogOn and update the history files. Though I should be able to copy the larger, more up to date history files with more current history data from the clients that have been logged onto the same server as the client that is not Logged on and solely used for back testing when this back test client in not active then start it up and hopefully it will incorporate the added data correctly and then run the 'All Periods' script to properly integrate and 'equalize' them.

.

I still need to find out how to add more 'OffLine Charts' to new installations of MT4. Some of them (mysteriously) add more as time goes on, but I have no idea how. I've looked for and tried to find out how to do this manually, but with no luck so far.

As always, any and all info, assistance and feedback offered and on how to accomplish this is and will be greatly appreciated.

Many thanks to one and all! (< 8)



 
gordon:

I wouldn't call this an 'error' and this is not a 'workaround'. The requirement to normalize prices is well documented and makes perfect sense. Since decisions in MT4 'cost money', the platform is designed to make no assumptions about user requests. Specifically, it requires prices to be exact and accurate.

Ickyrus wrote >>
I got fed up the data errors while testing so used:

MyBid=NormalizeDouble(Bid,4) ; //To solve test data errors
MyAsk=NormalizeDouble(Ask,4) ; //To solve test data errors


I tend to agree with Gordon on this one as orders HAVE to be normalized in order to submit them in the proper form that the server will accept them in.

I'm not sure what this method would accomplish in regards to 'data errors'? Please expand on it and explain it further if I am incorrect on this.

Thanks again to one and all for you assistance!

 

The code I was testing stopped having errors when I changed from using Ask and Bid to MyAsk and MyBid.
Maybe the code is too simple. The Point iand digits in EUR/USD on the Chart is 5 decimal places but tester only responds well to 4 decimal places
In functions to the simulated server for the tester I Normalized the format to 4 decimal places and stopped having error messages.

 
FourX wrote >>

Coments InLine (CIL)

Hi Phillip et al,

FourX it sounds like you are using the process I posted about a while back (including the "all time periods" script) to refresh your hst files with the broker's data.

Yes: My confusion arose from the fact that they do not show up in the 'History Center" (F2) which is rather strange. But 'strange' is 'common practice' with MQL.

It is intentional on MetaQuote's part as a method of reducing the memory (ram/pagefile) footprint any given MT4 instance occupies. Until you "load" the hst file into memory (by either opening a chart or double-clicking the relevant timeframe in history center) the datafile remains on your hard-drive and has no effect on ram usage.

Are you referring to the "mismatch" errors as being corruption? If so then that is easily explainable..nothing is corrupted. Mismatch errors refer to the tick volumes not matching for equivalent corresponding time frames between chart periods.

Again: correct. The net result is that it renders utilizing the strategy tester useless.

Strategy tester is of questionable value even in the event of having no mismatch errors. For example you are only using the historical BID data during a backtest, 100% of all historical ASK prices are assumed to be BID+SPREAD with the spread being a fixed value over the entire duration of the backtest regardless the fact the spread actually changes over time on live accounts.

An additional guaranteed inaccuracy in using Strategy Tester is the lack of historical information regarding SWAP rates which do vary over time. Once again Strategy Tester simply uses the most recently known/established swap rate for the given currency pair and applies this swap rate to all transactions across the entire duration of the backtesting time period.

And thirdly backtesting on cross-currency pairs is nearly pointless as the Strategy Tester does not do the necessary calculations using the base pairs for determining the proper value of MODE_TICKVALUE which itself changes in value for a cross-currency pair as the base currency of the user's account changes value.

However there is a higher-level of reasoning as to why no one really worries about making strategy tester 100% reflective of live market conditions with historical data and that reason is that past performance simply doesn't reflect future results, so why worry with making sure you know the past performance to fifth decimal place when you'll be lucky of future performance comes with 50% of replicating those past results?

You are needlessly (imo) worried about measuring historical results to a level of accuracy that will not add value towards increasing the liklihood of your future results being anymore profitable.

The reason why it seems to get worse over time after running the scripts is because the NEW data you have been collecting from your broker AFTER having ran the script contains NEW data mismatches whereas the script generates hst files that does not contain mismatch errors.

Running the 'All periods' script should take care of this problem?

Yes it does, for all data present in the M1 hst file up to the time in which the "All Periods" script was most recently ran. As you collect newer and more recent M1 data you need to rerun the script to create equally up-to-date hst files for the other time periods.

Though as their is no indication of the progress and duration of this task to know when it is finished.


There is indication, you just need to know where to look for it. Prior to launching the script be sure and to select the "Experts" tab in the terminal window. Then launch the script and take note of the following information being logged while the script iterates:


.

We previously talked about having separate MT4 installations dedicated to specific purposes...aka the data harvesting MT4 instance separate from your active trading MT4 instance.

I often use numerous MT4 clients that are running Demos for forward testing to also do back testing as well, thus they are logged on.

.

Likewise I would say the vast majority of MT4 folks I have worked with in the past keep yet another MT4 installation instance solely for strategy testing which does not actually log in to any server.

I'll try this out though my computer is getting close to reaching the 'limits of it's capacity' Trying to add more simultaneous tasks just ends up making everything slow down so much or (almost) completely grind to a stop and renders everything useless. Then periodically LogOn and update the history files. Though I should be able to copy the larger, more up to date history files with more current history data from the clients that have been logged onto the same server as the client that is not Logged on and solely used for back testing when this back test client in not active then start it up and hopefully it will incorporate the added data correctly and then run the 'All Periods' script to properly integrate and 'equalize' them.


You will find that the MT4 instances which are not doing backtests actually consume rather little CPU time and the ram usage can be well controlled/limited by adjusting the "Max Bars in Chart" value (does not effect the actual hst files on the hard drive).

You can move hst files around on your hard-drive. Briefly close both your harvester MT4 instance and your backtesting MT4 instance whenever you want to refresh your backtesting MT4 instance hst files. Copy the hst files from the harvester MT4 instance historical data folder over to the similar historical data folder for your backtesting MT4 instance (overwriting the existing hst files). Startup your harvester MT4 instance (which was only shutdown for a minute while you did this process) and then restart your backtesting MT4 instance (and don't log in). Now run the "All periods" script on any given offline M1 chart and you are ready to start strategy testing again.

I do this process monthly, with 6+yrs of historical data I am not overly concerned with having the most recent 30days of data factored into my backtesting results. And besides if it were to turn out that the most recent 30days of price data actually made a significant difference to the outcome of my strategy tester results then I probably have an unacceptably volatile strategy to begin with and need to move on anyways.



 
Ickyrus:

The code I was testing stopped having errors when I changed from using Ask and Bid to MyAsk and MyBid.
Maybe the code is too simple. The Point iand digits in EUR/USD on the Chart is 5 decimal places but tester only responds well to 4 decimal places
In functions to the simulated server for the tester I Normalized the format to 4 decimal places and stopped having error messages.

Hi Ickyrus,

I know that summer is on the way, and the Sun is beckoning you; but be mindful of it and don't get caught up in the allure of it and fly to high! (< 8)

It won't take much to implement and definitely isn't going to do any harm, so it's definitely worth a try. Anything that makes the strategy test stabler is a plus.

So far my 'normalizing' method is a bit of a cluge, but works. But as I am climbing the learning curve here I might as well start learning how to and using the proper 'Normalize' function as opposed to calling the 'Digits' and doing it 'manually' to each (custom) variable and trailing digits combination.

Thanks for the assistance.

 

Hi Phillip,

Strategy tester is of questionable value.

There is a lot of consensus on that, with good reason. I use it to get into the ball park, and then forward test.


Strategy Tester simply uses the most recently known/established swap rate for the given currency pair and applies this swap rate to all transactions across the entire duration of the backtesting time period.

It just keeps getting lamer and lamer!


past performance simply doesn't reflect future results,

To true, it's only an approximation. But it is also useful for NuBs like me to do test runs on my code. I just wish they had a 'tracer' & /or a 'single' step capacity in the Editor. It makes troubleshooting SO much easier, more effective and faster and helps make for better, more stable, efficient and faster code structure. I'll add it to the suggestions for v5.


.....select the "Experts" tab in the terminal window.

Thanks.


MT4 instances which are not doing backtests actually consume rather little CPU time and the ram usage can be well controlled/limited by adjusting the "Max Bars in Chart" value

I have both the history and all the in all my mT4's set to max. Going to leave them there. I monitor the load and utilize accordingly.

I have found that to be true. I'm on my back up PC: 32 bit with 2.8 dual CPU & 4GB RAM. Was running Vista, but the boot files got corrupted so on my B/U XP on my B/U LoL (< 8)

My primary PC is an all 64 bit 2.2 GHz Quad core with fast SATA RAID 1/0 & 8GB RAM. Has both bit Win7 & Vista 64 bit on it. Worst MoBo I have ever used, and that is going back over 30 years! When I 'GetAroundToIt' I'm gong to hold the MoBo manufacturers 'feet to the fire' and demand a replacement with a better model that i can still use all of the same components in it.

FYI: Found an interesting fact while searching MS the other day: both Vista & Win7 have a little app that allows the usage of USB memory sticks as system RAM! Being USB, not going to be that fast, but there is more 'bang for your buck' with RAM than any other upgrade.

FYI: When I went to the 2.2GHz Quad core from the 2.8GHz Dual core, I didn't notice much performance increase. Until I put 64 bit OS on it!

Many that haven't used Vista run it down. Having used both Vista & XP extensively, IMO I can say with some authority that Vista IS better than XP.


I do this process monthly, with 6+yrs of historical data I am not overly concerned with having the most recent 30days of data factored into my backtesting results.

I take the MT4 instance with the largest Hst files from any one broker and use the SyncToy to keep the rest as comprehensive as possible.

I would think that the Hst files have to be from the same broker in order for them to work properly? But perhaps not. I can make a case for both I'll have to check it out.

If this is NOT the case, any chance of getting copies of your 6 year ForEx Hst DataBase

Will take longer to run, but the more data one has, the more accurate the back testing is going to be. Can always specify the dates and use partial data sets anyway.


(does not effect the actual hst files on the hard drive).

I have mountains of RAID 1/0 HDD space, so no worries there.

Thanks again Phillip