Backtest on open and on every tick show very different results

 

Hi,

I backtested an EA on 1H timeframe (that only uses closes on previous 1H bars, no tick data) on tick and then on bar opening. The backtest on the tick gave me a 100% return, while the on open it gave me 10%, with of course very different graphics.

Assuming the 'every tick' backtest is the correct one, why didn't the 2nd one work? It says "only for EAs that explicity control bar opening", maybe it was because of this? I don't know what they mean by this though, I think any EA that doesn't use tick data ( like Close[0] ) fits into this description...

 

Jasus5457:

Assuming the 'every tick' backtest is the correct one, why didn't the 2nd one work? It says "only for EAs that explicity control bar opening", maybe it was because of this? I don't know what they mean by this though, I think any EA that doesn't use tick data ( like Close[0] ) fits into this description...

The correct one is the one you design the EA to work as so if you make your EA to work on candle times it should give the same result whether you select every tick or open only. The Close[0] is not a fixed value until it becomes Close[1] until then it will flick up and down with the price on every tick. Have a search on candle time and see the previous discussions.
 
An EA that controls opening has code like
int start(){    static datetime Time0;  bool new.bar    = Time0 < Time[0];
    if (new.bar) { Time0 = Time[0];
        ...
It only opens new orders or modifies stops at the beginning of a new bar.
 
WHRoeder:
An EA that controls opening has code like It only opens new orders or modifies stops at the beginning of a new bar.
Thanks for the explanations, does that code really work?
 

i belive that stoploss/takeprofit are also not executed at the level set when testing on bar Opening, they are only executed when an new bar Opens above/under the stoploss/takeprofit. high/lows are not used in the simulation.

i am not 100% shure, since i never run a full test only on open prices.

can somebody please confirm or negate?

Reason: