Download MetaTrader 5
To add comments, please log in or register
Download MQL5 library codes via MetaTrader. It is convenient!
jmlocatelli
807
jmlocatelli 2016.03.08 20:11 

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 2016.03.09 00:44  

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
28659
Alain Verleyen 2016.03.09 14:18  
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