Bug when running visual backtesting in debug mode and pressing ctrl+f, when a breakpoint is hit.

 

Hi

It looks like there is an issue Issue with Metatrader 5 platform when running debug visual testing in the editor and hitting a breaktpoint, and pressing ctrl + F.

Indicators (all, even the included ones) repaint/shift 1 bar when pressing ctrl+f during debug on historical data)

To reproduce:

  1. Open Metatrader 5
  2. Add EMA 5 and EMA 10 (Built in)
  3. Set Strategytester to Daily, Modeling: Ticks or Real Ticks (Both produce same issue)
  4. Open Metatrader 5 Editor
  5. Open the included ExpertMACD.mqh
  6. Set break point at Line 651 in Expert.mqh
  7. Start with CTRL+F5 to run on historical data
  8. Put cursor on a fully closed candle (1-2 days back at least)
  9. When breakpoint hits, activate the visual tester, and press Ctrl+F
  10. All indicators shift 1 bar to the left as soon as you press CTRL+F in the visual backtesting window, and get the crosshair.
  11. Continue from breakpoint, and all indicators shift 1 bar to the right.
  12. Steps 8,to 11 can be repeated and always do the same.

The problem is when checking if an EA actually does what it should, it's impossible when the bars are shifted compared to what the EA sees.

It is not an issue with the indicators, as it happens even with the built in example expert advisors, and the built in indicators too. 


This youtube video demonstrates the issue at approx 0:25, ctrl+f is pressed.

https://youtu.be/_fyCv3Zla9A


Anyone else seeing this? I'm on build 2280 of Metatrader 5.

Thanks,
Leif

Reason: