Testing against real data

 

Hello everyone, total beginner here : 

I'm trying to develop an Expert Advisor, and while I am able to test against historical data (backtesting) using the strategy tester, I can't find a way to simply "attach" to a chart and receive live data continuously (most likely in the OnTick() function).

What am I missing here? Is it even possible while debugging? Any pointers are greatly appreciated.

The Fundamentals of Testing in MetaTrader 5
The Fundamentals of Testing in MetaTrader 5
  • www.mql5.com
What are the differences between the three modes of testing in MetaTrader 5, and what should be particularly looked for? How does the testing of an EA, trading simultaneously on multiple instruments, take place? When and how are the indicator values calculated during testing, and how are the events handled? How to synchronize the bars from different instruments during testing in an "open prices only" mode? This article aims to provide answers to these and many other questions.
 
marc.insight-fx: I can't find a way to simply "attach" to a chart and receive live data continuously (most likely in the OnTick() function).

What am I missing here? Is it even possible while debugging? Any pointers are greatly appreciated.

  1. Stop debugging. That is part of the editor, not the terminal.
  2. Compile your EA.
  3. In the terminal, open the navigator (control+N) and drag your EA on to a chart.
 
William Roeder #:
  1. Stop debugging. That is part of the editor, not the terminal.
  2. Compile your EA.
  3. In the terminal, open the navigator (control+N) and drag your EA on to a chart.
Thanks so much! That also explains why I was receiving OnDeinit() event with reason 1, as after receiving the historical data, I was not actually attached to any chart, thus getting terminated, which makes perfect sense.
Reason: