- Added the "Exporting Funсtions" section.
- Extended the "Description of External Functions" section.
- Changed the description of the library property pre-processor in the "Program Properties (#property)" section.
- Added description of classes in the "File Operations" section.
- Fixed the type of the FileSeek() function from bool to void.
- Added the description of the CString class in the "String Operations" section.
- Added a new constant IS_DEBUG_MODE in the "Other Constants" section and an example in it:
//+------------------------------------------------------------------+ //| Check_DEBUG_MODE.mq5 | //| Copyright © 2009, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2009, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- string label_name="invisible_label"; if(ObjectFind(0,label_name)<0) { Print("Object",label_name,"not found. Error code =",GetLastError()); //--- создадим объект Label ObjectCreate(0,label_name,OBJ_LABEL,0,0,0); //--- установим координату X ObjectSetInteger(0,label_name,OBJPROP_XDISTANCE,200); //--- установим координату Y ObjectSetInteger(0,label_name,OBJPROP_YDISTANCE,300); ResetLastError(); if(IS_DEBUG_MODE) // debug mode { //--- выведем сообщение о режиме выполнения скрипта ObjectSetString(0,label_name,OBJPROP_TEXT,"DEBUG MODE"); //--- зададим красный цвет текста if(!ObjectSetInteger(0,label_name,OBJPROP_COLOR,Red)) Print("Unable to set the color. Error",GetLastError()); } else // release mode { ObjectSetString(0,label_name,OBJPROP_TEXT,"RELEASE MODE"); //--- зададим невидимый цвет текста if(!ObjectSetInteger(0,label_name,OBJPROP_COLOR,CLR_NONE)) Print("Unable to set the color. Error",GetLastError()); } ChartRedraw(); DebugBreak(); // here will interrupt, if we are in debug mode } }
- Added a new constant WHOLE_ARRAY in the "Other Constants" section and made corresponding corrections to functions FileWriteArray(), FileReadArray(), ArrayCopy(), ArrayMinimum(), ArrayMaximum().
- Added the statement that "Destructors are always virtual, regardless of whether they are declared with the virtual keyword or not" into sections of "Structures and Classes" and "Virtual Functions".
- Modified the error description in the "Compilation Errors" section: "270. Function must have a body".
- Added the ChartWindowFind() function into the "Operations with Charts" section.
- Into the "Runtime Errors" added the error 4113: "Subwindow containing the indicator was not found"
- Improved the design of the PDF version of the MQL5 Reference.
MetaTrader 5 Client Terminal build 228
- MQL5: Fixed request of the time value of points for plotting graphical objects.
- MQL5: Added a method of searching a chart window containing the specified indicator - ChartWindowFind.
- MQL5: Fixed an error in the call sequence of complex object destructors.
- MQL5: Added the possibility to initialize structures containing strings, using the initializing sequence.
- MQL5: Fixed an error of implicit string casting when passing it as an integer parameter.
- MQL5: Changed the behavior of object destructors - class destructors are always virtual.
- Terminal: Fixed output of trade error alerts.
- Terminal: Fixed errors in quotes unpacking.
- Terminal: Implemented binding of the account base to a computer and user's Windows account, to prevent information theft. When changing the Windows account or carrying a terminal to another computer, the login and password must be specified again.
- Terminal: If the terminal help file hasn't been loaded yet, it's updated without the terminal restart.
- Terminal: Fixed an error that occurred when moving graphical objects, if one of construction points is out of visibility area.
- Terminal: Fixed an error in the trading history.
- MetaEditor 5: Fixed checking for the necessity to convert ANSI files into Unicode when loading files.
- MetaEditor 5: Fixed selection of the file extension during saving.
- MetaEditor 5: Fixed changing of the file modification time during debugging.
The live update is available through the LiveUpdate system.
The MetaTrader 5 client terminal can be downloaded at https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe
List of changes in the Help for MQL5:
- Added description of the Organizing Data Access part in the Access to Timesries and Indicator Data section.
- Added the ENUM_POINTER_TYPE enumeration in the Named Constants section.
- Changed the return value type for the CheckPointer function; corrected its description.
- Added a new constant WRONG_VALUE in the Other Constants section.
- Added description in the following sections:
- Added the GetPointer() function in the Common Functions section.
- Added an example for the IndicatorCreate() function.
- Added the TerminalClose() function in the Common Functions section.
- Added description in Classes for working with indicators.
Automatic updates are available in the CHM format (1.4 Mb) by pressing F1 in MetaEditor 5.
In addition, Help can be downloaded independently:
List of changes in the Help for MQL5:
- Fixed descriptions of technical indicator functions:
iBearsPower, iBullsPower, iChaikin, iEnvelopes, iMomentum, iBands,
iStochastic, iVolumes.
- Extended description of the Drawing Styles section.
- In Calling Imported Functions added description of Parameter Passing.
- Added new errors 297, 298, 299 and 300 in Compilation Errors.
- Added new section in the Custom Indicators group: Connection between Indicator Properties and Respective Functions.
Automatic updates are available in the CHM format (1.4 Mb) by pressing F1 in MetaEditor 5.
In addition, Help can be downloaded independently:
List of changes in the Help for MQL5:
- Added description of new events CHARTEVENT_OBJECT_CREATE and CHARTEVENT_OBJECT_DELETE to the Event Handling Functions and Types of Chart Events sections.
- Fixed description of the FileTell() and FileSize() parameters.
- Added description of the "codepage" default parameter to the FileOpen(), CharArrayToString() and StringtToCharArray() functions.
Automatic updates are available in the CHM format (1.4 Mb) by pressing F1 in MetaEditor 5.
In addition, Help can be downloaded independently:
List of changes in the Help for MQL5:
- Fixed descriptions of functions StringGetCharacter and StringSetCharacter;
- Added example to the ArrayInitialize function;
- Fixed description of the ArrayResize function;
- Fixed definition of the ChartWindowFind function;
- Improved example for the GetPointer function;
- Added description of the File Opening flags section;
- Added Character Constants section;
- Added CHARTEVENT_CLICK in the Types of Chart Events section, its example improved.
- Added the GlobalVariableTime function.
Automatic updates are available in the CHM format (1.4 Mb) by pressing F1 in MetaEditor 5.
In addition, Help can be downloaded independently:
- Terminal: Fixed an error in calculation of free margin in Assets (Exposure tab).
- Terminal: Fixed an error in the "Chart on foreground" property.
- Terminal: Fixed and redesigned the "Print Preview" window for a chart.
- Terminal: Fixed an error in temporary global variables.
- Terminal: The "Standard" and "Charts" toolbars are merged.
- MQL5: Fixed crashes and errors reported at forum.
- MQL5: Changed the behavior of Copy* functions for Expert Advisors and scripts - now the functions will wait for the loading and construction of requested data. The timeout is 30 seconds. Details will be available soon in MQL5 documentation.
- MQL5: Added the possibility of event handling by custom indicators, similar to that by Expert Advisors. The details will be available soon in the MQL5 documentation.
- MQL5: Fixed errors in the operation of the optimizer.
- MQL5: Fixed errors in navigation through charts (ChartNavigate method).
- MetaEditor: Added the possibility to search in the "Search" window of the toolbar.
- MQL5: Fixed an error that resulted in the incorrect determination of the type of a parameter passed to the function Comment (Print, Alert).
- MQL5: Added checking in custom indicators: if the indicator_colorN property is not set for a graphical series, and no value is set to the PLOT_COLOR_INDEXES property, 1 is assigned to the property value by default.
- MQL5: Fixed an error in the operation of Copy* functions for the case when data are requested for the specified time period.
The live update is available through the LiveUpdate system.
The MetaTrader 5 client terminal can be downloaded at https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe (web-installer 300 kb)- MQL5: Fixed errors reported at Forum.
- MQL5: Fixed initialization of static arrays.
- MQL5: Fixed error in synchronous access to history in Expert Advisors and scripts.
- MQL5: Fixed error in custom indicators (check for restriction in the number of colors of a graphical layout).
- MQL5: Fixed and redesigned work of timers – Expert Advisors and custom indicators now have their own separated timers.
- Terminal: Added saving of parameters of a working Expert Advisor after it is recompiled.
- Terminal: Modified an algorithm of additional history data loading during the left scrolling of a chart – data are requested with a certain reserve, which is proportional to the number of bars requested.
- Terminal: Corrected errors in receiving and storing of news.
- Terminal: Rewritten an algorithm for the "Refresh" command of the chart – the full synchronization of initial minute bars is performed with the reconstruction of the period selected and all indicators attached to chart.
The live update is available through the LiveUpdate system.
The MetaTrader 5 client terminal can be downloaded at https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe
- MQL5: Fixed crashlog errors and errors reported on Forum.
- MQL5: Fixed an error in synchronous access to history for Expert Advisors and scripts.
- MQL5: Fixed an error with reading of a string from a file by function FileReadString.
- MQL5: Fixed an algorithm of timeseries copying by Copy* functions for the case of "from date to date".
- MetaEditor: Fixed sorting of variants in case-sensitive auto completion, exactly matching variants are placed at top of the list.
The live update is available through the LiveUpdate system.
The MetaTrader 5 client terminal can be downloaded at https://download.mql5.com/cdn/web/metaquotes.software.corp/mt5/mt5setup.exe
MetaTrader 5 Client Terminal build 249
- MQL5: Fixed an error in the access to a selected position.
- MQL5: Fixed an error in passing of NULL as a string parameter to a system call.
- MQL5: The definition of the fifth parameter (parameters_array[]) of the IndicatorCreate() function has changed - now it's a constant parameter.
The live update is available through the LiveUpdate system.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
List of changes in the Help for MQL5:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
//--- incorrect file opening method
string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);
string filename=terminal_data_path+"\\MQL5\\Files\\"+"fractals.csv";
int filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV);
if(filehandle<0)
{
Print("Failed to open the file by the absolute path");
Print("Error code",GetLastError());
}
//--- correct way of working in the "file sandbox"
ResetLastError();
filehandle=FileOpen("fractals.csv",FILE_WRITE|FILE_CSV);
if(filehandle!=INVALID_HANDLE)
{
FileWrite(filehandle,TimeCurrent(),Symbol(),PERIOD_CURRENT);
FileClose(filehandle);
Print("FileOpen OK");
}
else Print("Operation FileOpen failed, error",GetLastError());
//--- another example with the creation of an enclosed directory in MQL5\Files\
string subfolder="Research";
filehandle=FileOpen(subfolder+"\\fractals.txt",FILE_WRITE|FILE_CSV);
if(filehandle!=INVALID_HANDLE)
{
FileWrite(filehandle,TimeCurrent(),Symbol(),PERIOD_CURRENT);
FileClose(filehandle);
Print("The file most be created in the folder "+terminal_data_path+"\\"+subfolder);
}
else Print("File open failed, error",GetLastError());
}
Automatic updates are available in the CHM format (1.3 Mb) by pressing F1 in MetaEditor 5.
In addition, Help can be downloaded independently: