Backtesting with Renko

 

Hello everyone,

Yesterday I stumbled across this lovely script (attached) that allows you to backtest EAs on renko charts (and other offline charts, I imagine) with the Strategy Tester in MT4. However, I need your help to make it work properly. I'm testing a strategy based on moving averages, and the problem I have is that it opens positions not where the candle first opens, but where the actual "block" begins. The picture below should illustrate what I mean. To solve this, the renko bars would need to actually begin to form at the previous bar's closing price when the direction changes. This would mean that every time there is a direction change, that renko bar would be twice as big as the rest.

I hope the picture makes this clearer. Would be really nice if someone could fix this so that we can start testing other EAs on offline charts!

All the best,

Axel

offlinetesthelper.ex4e_renkolivechart_v600.1.mq4

 
BlackCoq:
Hello everyone,

Yesterday I stumbled across this lovely script (attached) that allows you to backtest EAs on renko charts (and other offline charts, I imagine) with the Strategy Tester in MT4. However, I need your help to make it work properly. I'm testing a strategy based on moving averages, and the problem I have is that it opens positions not where the candle first opens, but where the actual "block" begins. The picture below should illustrate what I mean. To solve this, the renko bars would need to actually begin to form at the previous bar's closing price when the direction changes. This would mean that every time there is a direction change, that renko bar would be twice as big as the rest.

I hope the picture makes this clearer. Would be really nice if someone could fix this so that we can start testing other EAs on offline charts!

All the best,

Axel

offlinetesthelper.ex4e_renkolivechart_v600.1.mq4

BlackCoq

Did you try setting the ShowWick to false in the RenkoLiveChart parameters?

 
mladen:
BlackCoq Did you try setting the ShowWick to false in the RenkoLiveChart parameters?

I did, but it didn't change where the positions opened in the strategy tester. Again, there is only an issue when the renko bar changes direction. As you can see above, the sell order is placed exactly where it should be, but the buy should be a full renko bar below where it's at now.

 
BlackCoq:
I did, but it didn't change where the positions opened in the strategy tester. Again, there is only an issue when the renko bar changes direction. As you can see above, the sell order is placed exactly where it should be, but the buy should be a full renko bar below where it's at now.

If you mean aligning open to close, here you go.

offlinetesthelperforrenko.ex4

 
Ovo:
If you mean aligning open to close, here you go. offlinetesthelperforrenko.ex4

That was exactly what I needed. Thank you!

 

Obviously the back testing quality isn't very good. Anyone know how to make the bars more accurate?

 
BlackCoq:
Obviously the back testing quality isn't very good. Anyone know how to make the bars more accurate?

Even if the bars were accurate, the open and close prices are artificial values with Renko. I was about to generate a custom fxt file, but I fell ill meanwhile, postponing the task for a while.

 
Ovo:
Even if the bars were accurate, the open and close prices are artificial values with Renko. I was about to generate a custom fxt file, but I fell ill meanwhile, postponing the task for a while.

That would be really heroic (seriously).

Metatrader back test is poor at the least : any improvement is a great help

 

Just one thing : take an ea, set it to work on open bar, and watch the results from a couple of test. Genetic algorithm ? Yep. And I am Stephen Wolfram. They are not even capable of making pseudorandom generator

 
  • Closed Sell 0.1 Lots EURUSD 1.38119 for +10.0 pips, total for today +20.0 pips
 
noomi:
  • Closed Sell 0.1 Lots EURUSD 1.38119 for +10.0 pips, total for today +20.0 pips

????????????????

And I closed for +100 on EURUSD. Come on. Do you guys really thunk that this is a game? It takes years to learn to trade - and it takes only a second to post nonsense. Get serious - put your money where your words are. And what does it have with the thread itself?

Reason: