Download MetaTrader 5

TP and SL reached in the same bar during backtest

To add comments, please log in or register
jmlocatelli
807
jmlocatelli  

hello,

In a situation, during backtest, where TP and SL are reached within the same 1-min bar, which is the execution priority in Metatrader?

I mean, for backtest purpose, does Matatrader consider the position closed at TP or SL price? 


tks,

jose marcio 

jmlocatelli
807
jmlocatelli  

Hi twalk,

TP and SL are triggered at tick level.

My question is regarding backtesting where the historical data is available only in a 1-min bar.

Yes, I would consider always the worse case. But I want to know if Metatrader will do the same when backtesting.

Tks for the comment. 

Alain Verleyen
Moderator
31204
Alain Verleyen  
jmlocatelli:

Hi twalk,

TP and SL are triggered at tick level.

My question is regarding backtesting where the historical data is available only in a 1-min bar.

Yes, I would consider always the worse case. But I want to know if Metatrader will do the same when backtesting.

Tks for the comment. 

It will consider the first reached by simulated ticks, it depends of the OHLC and tick volume. See https://www.mql5.com/en/articles/1511

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
To add comments, please log in or register