Open Prices Only (OPO) method, How it works ?

 
Hi All

I have an EA works on the last bar completed events, as described in this article: https://www.mql5.com/en/articles/1511. So I would like to test it with Open Prices Only (OPO) method. In the two pictures here, If EA places a BUYSTOP at the end of the first bar with predefined SL and TP, now after completion of the second bar, if the pending order's open price, and also both of its SL and TP, were in the range of the second bar, then strategy tester OPO method, how understands that SL have been reached first or the TP one ? I want to validate output of Strategy Tester in OPO mode ! 


Thank you


End Of First BarEnd Of Second Bar
Strategy Tester: Modes of Modeling during Testing
Strategy Tester: Modes of Modeling during Testing
  • 2005.09.13
  • MetaQuotes Software Corp.
  • www.mql5.com
Many programs of technical analysis allow to test trading strategies on history data. In the most cases, the testing is conducted on already completed data without any attempts to model the trends within a price bar. It was made quickly, but not precisely
 

No you can only know after the new last bar has opened with it's open price.

Not before so even if price goes over or drops below your TP and SL values nothing will happen until the new last bar open price comes in and this is where it differs from ticks.

So your order will be closed, or a new order will be opened only when a new bar opens that breached the values of your triggers.

 
Marco vd Heijden:

No you can only know after the new last bar has opened with it's open price.

Not before so even if price goes over or drops below your TP and SL values nothing will happen until the new last bar open price comes in and this is where it differs from ticks.

So your order will be closed, or a new order will be opened only when a new bar opens that breached the values of your triggers.

Dear Marco vd Heijden

Thank you for the reply.

Maybe I should rephrase the question. I mean if OPO method knows nothing else than just OHLC of candle prices, then how it can determine for the trades in the range of its completed candle, they have been closed with SL  or TP ??


I mean maybe OPO knows and uses more information than just OHLC of candles? Is it true ?
Files:
 

This depends are you talking about SL and TP levels residing on the trading server side, or are you talking about SL and TP triggers that reside on the trading terminal side ?

These are two different things, of course if your triggers are set on the trading server they will obey every tick, but if you keep your levels hidden from your broker then they will only obey bar open price when it is coded to deal with bar open only.

Now bar open means bar open it does not mean bar close or bar high or bar low so it can not be more then just bar open.

If you run only bar open then thats what it will be so unless you code it to deal with other prices but then it would not be bar open only obviously.

 
Marco vd Heijden:

This depends are you talking about SL and TP levels residing on the trading server side, or are you talking about SL and TP triggers that reside on the trading terminal side ?

I am talking about Strategy Tester. I want to validate behavior of strategy tester in OPO model/method. You and me are common on the meaning of 'bar open' for EAs.

When we test an EA which is designed to work on 'bar open', we can test it with OPO or with 'every tick' or with 'control points'. The other methods use more information than OHLC of candles. It is obvious.

But what about OPO method ? I want to assert MT4 OPO strategy tester mode, if relies on OHLC of testing time frame candles, can not determine which one of SL or TP has been triggered.

If it is true then OPO how works.
 
Farshad Rezvan:


can not determine SL or TP has been triggered.

This depends on :

Marco vd Heijden:

This depends are you talking about SL and TP levels residing on the trading server side, or are you talking about SL and TP triggers that reside on the trading terminal side ?

To determine if anything has been changed, can only be done after a new bar.

Also:

Farshad Rezvan:


if relies of OHLC of testing time frame candles, can not determine SL or TP has been triggered.

It does not rely on OHLC but just O .

In this mode, first, bar is opened (Open = High = Low = Close, Volume=1)

 
No. It is our EA that relies on O, Open Price.

What about MT4 Strategy tester OPO method ? I am asking about strategy tester not EA design!
 
 

It's the same thing.

Either your EA is coded to only work with open times or your EA is not coded to work with open times but you set strategy tester to open times only.

It's the same thing.

Even if your EA would rely on anything else then open time it would not be available when run strategy tester open mode only.

Or when your EA IS coded to run open only then you can even set it to on tick it should still results open only but with a lot of wasted time in between for the ticks that are not handled.

It's the same thing.

 
Farshad Rezvan:
No. It is our EA that relies on O, Open Price.

What about MT4 Strategy tester OPO method ? I am asking about strategy tester not EA design!
 
I think I read somewhere that it relies on the bar direction. (So for a BUY a bullish candle will trigger the TP), I am not 100% sure though.

Anyway Marco is right, use "Open prices only" testing mode only if your strategy relies on new candle (Open) for both opening and closing your trades.
 
I have a question regarding the 'Open prices only' modelling in Metatrader 5. In a multi symbol EA, is the opening of a bar considered only for the selected symbol (in the tester settings) or is the tester checking the opening of a bar individually for each involved symbol?
Reason: