How to ACCURATLY BackTest EAs on offline chart like renko, rangebars? - page 2

 
RaptorUK:

Just to be clear, I haven't ever used Renko bars, what I was working with was something completely different. It needed an offline chart though and that was where the similarity came in. My issue was that my M1 data was not synchronised with my offline chart so my ticks generated from my M1 data did not make sense when viewing my offline data in the Strategy Tester.

The issue you are going to have is you need to get the Renko bars into the Strategy Tester . . . they do not have uniform timings . . and you will probably end up with the same timing issues that I had, try it and you will see . . or maybe you won't have an issue.

Hi RaptorUK,

This is what exactly the issue I am seeing. As you said " My issue was that my M1 data was not synchronised with my offline chart so my ticks generated from my M1 data did not make sense when viewing my offline data in the Strategy Tester", I am seeing the same problem.

As I mentioned in my first message "In some cases I found that the tick movements in these Bars are not in the same order as they are in M1 chart and as a result STOPLOSS used in EA run on these chart do not exactly taken-out in the same way it would be on NOrmal Bars (like M1, M15,M30,H1 ...). Therefore, during backtesting of these bar closing of (short or long) of orders results in profit which in reality it would have resulted in Stop Loss.:"

Synchronization between tick movement on M1 chart from which offline chart are derived is not there.

The order of tick movement(moving up or down) is totally different from what is captured in OFFLINE chart derived from M1 chart.

As far as RENKO chart is concenred I am using RENKO chart generated specifically for back testing where OPEN of the bar is also captured correctly unlike traditional RENKO where OPEN for the bar is modified before displaying next new bar.

This is what my RENKO chart look like:

 
RaptorUK:


1. The TDS has nothing to do with creating your fxt file, that is done using different code, for example I used CSV2FXT to create my fxt files.

2. You will have to try it, but my initial thoughts were that this wouldn't work correctly. When you run your EA in the ST using this H4 data you will see your renko bars but I suspect that if you run the ST in slow speed, maybe 30, you will see that the renko bars are not forming correctly . . . shouldn't you be overwriting your M1 data with your renko hst file ? and then using M1 in the ST ?

3. It's good to try unconventional things sometimes, it's often the way you will learn the most.

I also use CSV2FXT too.

Since TDS isn't using the offline renko hst file, I need to give it up.

"shouldn't you be overwriting your M1 data with your renko hst file ? and then using M1 in the ST ?" - why would there be a difference between using M1 or H4? I guess they would produce the same result as ST doesn't care the 'period' selected but the datetime within the HST file. Let me double check (1). However, I couldn't really use M1 as I still want to perform 'faked every tick' simulation and I believe it will make use of the M1 data for interpolation tick simulation and ST will assume it is really M1 and cannot be renko. I do want to verify (2) if "Open Price" and "Fake Every Tick" will produce the same result if I change my strategy not to refer to any [0] data anymore.

 
lingwuchung:

Thanks Raptor. I just haven't figured out how TDS works internally. What you describe certainly makes sense to me now.

I am using the EA RenkoLiveChart to overwite my H4 data to give me the renko offline hst data. Why ask? It's not use if TDS doesn't make use of offline hst data.

Suddenly think of this. Why on earth (pretending your tone, ha ha :) am I trying to use tick backtesting on renko? To make my life easier, maybe I should give up renko backtesting by tick. If I change my strategy to make decision on [1] but no [0] data, I don't have to worry how the ticks are moving within the [0] bar and could have just use "Open Price" backtest provided by MT4 natively. Let me verify if that will work. Maybe it doesn't make too much difference in real life. Actually when I think back now, why would I refer to [0] data if I'm using renko, for renko is exactly used to filter fluctuation without the current bar which I shouldn't refer to?????!!!!

Just think that my hypothesis won't work perfectly. Even though I don't use any [0] in my strategy, the bid/ask is still [0]!!!! I need to use the first bid/ask price of [0] rather than anything after that.

 
RaptorUK:


1. The TDS has nothing to do with creating your fxt file, that is done using different code, for example I used CSV2FXT to create my fxt files.

2. You will have to try it, but my initial thoughts were that this wouldn't work correctly. When you run your EA in the ST using this H4 data you will see your renko bars but I suspect that if you run the ST in slow speed, maybe 30, you will see that the renko bars are not forming correctly . . . shouldn't you be overwriting your M1 data with your renko hst file ? and then using M1 in the ST ?

3. It's good to try unconventional things sometimes, it's often the way you will learn the most.

Raptor,

My point 3 is sort of ok. After I don't refer to [0] anymore, the "Open Prices" and "Real Tick" simulation produce the same magnitude of profit factor (e.g. 1.23 vs 1.07). If use "Tick simulated from M1" previously, the PF is 3.x which is totally unrealistic as I can observe in demo trade.

 
lingwuchung:

I also use CSV2FXT too.

Since TDS isn't using the offline renko hst file, I need to give it up.


Check out this post: http://www.az-invest.eu/backtesting-eas-on-rangebars-renko-median-renko-pointo-charts-using-tick-data-on-mt4

Should solve your problem.

 

No it does not.

W.r.t. az-invest script, although the rangebar data ends up in ST, when running the backtest the tick movements do not match the bar printing, particularly on closing of the bar.

------------

What I've tried so far is:

1. Generated HST and FXT files based on Dukascopy data, importing both into a non-connected, no-account test MT4 install

2. Run my own rangebar generator script on the FXT file, producing rangebar charts.

3. Exported the rangebar data to (CSV) file, imported it into a standard HST file (e.g. M5) via History Center.

4. Tried to run an EA against the HST file from 3, using the same FXT file from 1.

Same result as everybody else, timings off.

Could run rangebars internally except, EA strategy requires data from TWO rangebar charts, and my intention is to run it on a connected offline chart (which works fine) with the 2nd chart being generated internally.

So if I modify the code jst to test it in ST, it wont be the same code that I'd run with in demo or live.

Does anyone have any ideas on resolving this?

 
HarriMQL4:

No it does not.

W.r.t. az-invest script, although the rangebar data ends up in ST, when running the backtest the tick movements do not match the bar printing, particularly on closing of the bar.

------------

What I've tried so far is:

1. Generated HST and FXT files based on Dukascopy data, importing both into a non-connected, no-account test MT4 install

2. Run my own rangebar generator script on the FXT file, producing rangebar charts.

3. Exported the rangebar data to (CSV) file, imported it into a standard HST file (e.g. M5) via History Center.

4. Tried to run an EA against the HST file from 3, using the same FXT file from 1.

Same result as everybody else, timings off.

Could run rangebars internally except, EA strategy requires data from TWO rangebar charts, and my intention is to run it on a connected offline chart (which works fine) with the 2nd chart being generated internally.

So if I modify the code jst to test it in ST, it wont be the same code that I'd run with in demo or live.

Does anyone have any ideas on resolving this?


Hi Guys,

Are you running the strategy tester in "Open prices only" mode or "every tick". If "every tick" then the tester will put in a fake 0 bar, and try to model the Renko bars using fractal interpolation. I believe this is what NetFx observed when he said "In some cases I found that the tick movements in these Bars are not in the same order as they are in M1". FWIW, I create Range/Renko charts using my own generator (there are several issues with RenkoLiveChart (and some commercial generators ;) when parsing historic data. I find that if I use "Open Prices Only", and code my EAs to also only take signals on a new bar, then every thing is as expected. I would be happy to have a TeamViewer session with anyone if it will help, just PM me,


Best

John

 

hello John, thanks for the tip, will try it out when I get a chance.


cheers!

 
Hello friends
Please advise me

How can we build Renko tick chart for detailed backtest?

thanks all

Reason: