EAs are not cached but sometimes due certain conditions, EAs may be "stuck" in memory.
In those cases, simply closing the editor, terminal e maybe even deleting the offending ".ex?" file, will reset things.
Tester results however are cached, so you might as well clear those while you are resetting things ... "<data folder>/Tester/Cache".
Thanks for your reply.
I already tried deleting the .ex file and it did not help. I tried your suggestion of deleting the Tester/Cache folder even the logs (though sounds it doesn't matter) but doing so produces the same issue. What's interesting is if I delete both logic that Strategy Tester doesn't show any position opened. That indicates that the EA is being refreshed on each compile. But if leave only one logic, either Buy or Sell, both positions (long and short) show up on the chart. It doesn't matter which one I remove both will show up.
The problem is probably in your code. To prove this, rename the source file and then recompile it. If the new name ".ex?" file still has the issue, then it is your code that is causing the problem.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I've searched this forum and the internet and I did not find any discussion that hints that EAs are cached.
I am new to MQL programming and I am trying out a simple strategy to get my feet wet with how it works. I have a simple code that looks like the following:
The "sellNow" logic doesn't behave the way I expected it too. To isolate it and make sure that the opening of long positions has no issues, I removed it from the code such that there is only the if (buyNow) logic. However, when I run my code the Strategy Tester chart is still showing short positions. Now, I removed both conditions (buyNow and sellNow), compiled my code, and then tested it. I don't see both long and short positions on the chart, which is correct. I also tried compiling then closing the editor and my MT client and restarted everything. After testing my code the result is still the same.
What am I missing?