Scrips are loaded on a chart and execute once, then disappear.
They are not trading robots like EA's.
Can you please refer me to more details about that ?
How I actually combines those scripts or use them as a robot code ?
I think you need to invest some time learning the basics, like how MetaTrader works as well as read a few introductory books, while referencing the MetaTrader and MQL documentation.
Forum on trading, automated trading systems and testing trading strategies
Sergey Golubev, 2017.09.16 05:40
Expert Advisor Programming for MetaTrader 4
This book will teach you the following concepts:
- The basic of the MLQ4 language, including variables and data types, operations, conditional and loop operators, functions, classes and objects, event handlers and more.
- Place, modify and close market and pending orders.
- Add a stop loss and/or take profit price to an individual order, or to multiple orders.
- Close orders individually or by order type.
- Get a total of all currently opened orders.
- Work with OHLC bar data and locate basic candlestick patterns.
- Find the highest high and lowest low of recent bars.
- Work with MetaTrader’s built-in indicators, as well as custom indicators.
- Add a trailing stop or break even stop feature to an expert advisor.
- Use money management and lot size verification techniques.
- Add a flexible trading timer to an expert advisor.
- Construct several types of trading systems, including trend, counter-trend and breakout systems.
- Add alert, emails, sounds and other notifications.
- Add and manipulate chart objects.
- Read and write to CSV files.
- Construct basic indicators, scripts and libraries.
- Learn how to effective debug your programs, and use the Strategy Tester to test your strategies.
All of the source code in this book is available for download, including an expert advisor framework that allows you to build robust and fully-featured expert advisors with minimal effort.
Forum on trading, automated trading systems and testing trading strategies
Sergey Golubev, 2017.09.16 05:48
Expert Advisor Programming for MetaTrader 5
This book will teach you the following concepts:
- Learn the basics of MQL5, including variables and data types, operators, functions, event handlers, and object-oriented programming.
- Place, modify and close market and pending orders.
- Calculate, verify and add stop loss and take profit prices to an open position.
- Add a flexible trailing stop and/or break even stop to your strategy.
- Manage your trade risk with money management.
- Use pending orders to scale in and out of positions.
- Use price, time and indicator data in your expert advisors.
- Control program execution by trading on new bar open, and add flexible trade timers to your strategies.
- Walk through the creation of several basic trading strategies from start to finish.
- Inform the user with dialog boxes, email alerts, mobile notifications and sounds.
- Draw trend lines, arrows and text labels on the chart.
- Read and write data to CSV files.
- Learn the basics of creating indicators, scripts and libraries in MetaEditor.
- Debug, test and optimize your trading strategy.
- And much more!
Whether you’re an experienced programmer moving from MQL4, or a novice just starting with MQL5, this book will give you the foundation to quickly program fully-featured and robust trading systems.
It seems the real issue here is the following:
Trade commands executed by experts in the Strategy Tester will open/close/modify tickets in the Strategy Tester (you can see the results in the "Results" and "Graph" tabs). However, trade commands executed by scripts in the Strategy Tester (by dropping a script on the Strategy Tester chart window if VisualMode=On) will not open/close/modify tickets in the tester but - surprise, surprise - will work on your live account outside the tester. Therefore you see "empty results" in the "Results" and "Graph" tabs. And if you have been lucky you didn't lose any money from the trades instead executed in your real account. You might thank Metaquotes for this "useful" and completely undocumented "feature".
Trade commands executed by experts in the Strategy Tester will open/close/modify tickets in the Strategy Tester (you can see the results in the "Results" and "Graph" tabs). However, trade commands executed by scripts in the Strategy Tester (by dropping a script on the Strategy Tester chart window if VisualMode=On) will not open/close/modify tickets in the tester but - surprise, surprise - will work on your live account outside the tester. Therefore you see "empty results" in the "Results" and "Graph" tabs. And if you have been lucky you didn't lose any money from the trades instead executed in your real account. You might thank Metaquotes for this "useful" and completely undocumented "feature".
Actually, it is documented and only an Expert Advisor or an Indicator (see below) can be tested at a time (never combined):
I have the same problem with Experts , for example testing :
https://www.mql5.com/en/code/19109
gives the same empty Results and Graph tabs
- 2017.09.18
- Simonas Aukscionis
- www.mql5.com
https://www.mql5.com/en/code/19109
gives the same empty Results and Graph tabs
You can't back-test Multi-Currency EA's in MT4. Only a single-symbol EA's can be back-tested in MT4's Strategy Tester.
On MT5 however, you can back-test Multi-Currency EA's in the Strategy Tester, but obviously MT4 EAs will not run on MT5.
Thanks
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
A beginner question.
Tried scripts from:
https://www.mql5.com/en/code/mt4/scripts
with the MT4 strategy tester . In some of them I get 0 errors 0 warnings
but Results and Graph are remaining empty .
(Testing MACD Sample.ex4 and Moving Average.ex4 on the other hand, gives the Results and Graph tabs)
Thanks in advance