Strategy tester issue in mql4

 

Hi everybody

Anybody know why:

When i have to test my EA in strategy tester with "Open prices only" Model everything is good(order send, order modify and etc.) but its a problem on "Every tick" Model.

for example i get a buy signal and EA try to open that position for several times not once. And for each trying to open position i get  Order send error 148(amount of open and pending orders has reached the limit).

 
Yaser Azizzadeh: Hi everybody. Anybody know why: When i have to test my EA in strategy tester with "Open prices only" Model everything is good(order send, order modify and etc.) but its a problem on "Every tick" Model.

for example i get a buy signal and EA try to open that position for several times not once. And for each trying to open position i get  Order send error 148(amount of open and pending orders has reached the limit).

Because when you use open price only, then the stops (Stop-loss and Take-profit) are simulated as being triggered at the exact prices that you have defined without any deviation/slippage.

In the other modes, the stops are also triggered without slippage, but the simulation is more accurate and closer to real trading.

So, unless your strategy is both opening and closing the trades on the open prices with no hard stops, then your back-test results will be unrealistic.

As for the error you are getting, it's because your EA is not properly coded to take into account the symbols contract specifications.

 
Yaser Azizzadeh: for each trying to open position i get  Order send error 148(amount of open and pending orders has reached the limit).
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. You are opening an order every tick.
  3. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.
 
William Roeder #:
  1. Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
              General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
    Next time, post in the correct place. The moderators will likely move this thread there soon.

  2. You are opening an order every tick.
  3. Do you really expect an answer? There are no mind readers here and our crystal balls are cracked. Always post all relevant code (using Code button) or attach the source file.

You are right, thank you for tips.

 
Fernando Carreiro #:

Because when you use open price only, then the stops (Stop-loss and Take-profit) are simulated as being triggered at the exact prices that you have defined without any deviation/slippage.

In the other modes, the stops are also triggered without slippage, but the simulation is more accurate and closer to real trading.

So, unless your strategy is both opening and closing the trades on the open prices with no hard stops, then your back-test results will be unrealistic.

As for the error you are getting, it's because your EA is not properly coded to take into account the symbols contract specifications.

Dear Fernando Thank you, I solved it. It was a mistake from me for detect new bar on the chart.