EA closing the position immediattley

 

Hi there! In my case, in brazil, EA clears profits on the backtest by closing the transaction right after entry. Already checked stops and tps in debug and are ok. Under debug, it also does not close the position under other conditions of closing the operation. Already switched to BRL in the backtest. I already deactivated the agent, exit the program and rehabilitated. I'm only able to test during the trading session. See pictures of the backtest below. Grateful for any help

   

Testing trading strategies on real ticks
Testing trading strategies on real ticks
  • www.mql5.com
The article provides the results of testing a simple trading strategy in three modes: "1 minute OHLC", "Every tick" and "Every tick based on real ticks" using actual historical data.
 
We can't see your broken code. Fix your code.
 
Shengjie Mao:
We can't see your broken code. Fix your code.

Thank you. I just want some tip. How come broken? What is broken?

There s no error on the code and it doesnt happen by any closing condition. I have debugged it.

 
Without seeing the code? Bring me the crystal ball
 
amando:
Without seeing the code? Bring me the crystal ball

It was almost a situation to make that joke...

But if this is a common problem, if it has been seen before,  nobody needs a cb

And, repeating, it only happens on the backtester and the debugger (and it is not by a closing condition) 

The pictures I have posted are on the backtester

The code runs perfectly during the market trading time. 

The code runs perfectly during the market trading time. 

just to make clear, I can´t backtest because of that

As I wrote, Brazil´s forum suggested the settings of money "BRL" or to turn off/on the agents. Didn´t worked.

Best

How to quickly develop and debug a trading strategy in MetaTrader 5
How to quickly develop and debug a trading strategy in MetaTrader 5
  • www.mql5.com
Scalping automatic systems are rightfully regarded the pinnacle of algorithmic trading, but at the same time their code is the most difficult to write. In this article we will show how to build strategies based on analysis of incoming ticks using the built-in debugging tools and visual testing. Developing rules for entry and exit often require years of manual trading. But with the help of MetaTrader 5, you can quickly test any such strategy on real history.