New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements
Do you have an example ?
What is the error ?
Please try replacing:
int timeframe, // Period
By:
ENUM_TIMEFRAMES timeframe = PERIOD_CURRENT; // Period
Overall the support for these functions in MQL5 in a MQL4 fashion is a very, very large milestone.
It seems they finally listened to the community.
This is my scripts for testing, then you get wrong result.
#property copyright "Copyright 2016, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property script_show_inputs //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- Print("iOpen = " + iOpen(_Symbol,PERIOD_CURRENT,1)); Print("iHigh = " + iHigh(_Symbol,PERIOD_CURRENT,1)); Print("iLow = " + iLow(_Symbol,PERIOD_CURRENT,1)); Print("iClose = " + iClose(_Symbol,PERIOD_CURRENT,1)); Print("iLowest = " + iLowest(_Symbol,PERIOD_CURRENT,MODE_LOW,15,1)); Print("iHighest = " + iHighest(_Symbol,PERIOD_CURRENT,MODE_HIGH,15,1)); }
How download new version MT5 build 1845
Open a demo account at MetaQuotes-Demo server, and your terminal will download the update automatically.
It works from build 1846
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements
The new beta version of the updated MetaTrader 5 platform will be released on June 8, 2018. We will update our public MetaQuotes-Demo server located at access.metatrader5.com:443. We invite all traders to join testing in order to evaluate updated platform features and help developers fix errors.
Are we going to get native mysql connectivity?
I know that this is something thousands of users want, but we still have to rely on third party .dll files for it.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New MetaTrader 5 Platform beta build 1845: MQL5 functions for operations with bars and Strategy Tester improvements
The new beta version of the updated MetaTrader 5 platform will be released on June 8, 2018. We will update our public MetaQuotes-Demo server located at access.metatrader5.com:443. We invite all traders to join testing in order to evaluate updated platform features and help developers fix errors.
To update the MetaTrader 5 platform up to build 1845, connect to access.metatrader5.com server:443.
The final build of the new MetaTrader 5 platform will be released after the public beta testing.
To make the search even more convenient, company logos are additionally shown in the list. If the desired broker is not shown in the list, type the company name or the server address in the search box and click "Find your broker".
Descriptions of account types have been added to the dialog to help beginners choose the right account. Also, to align with the General Data Protection Regulation (GDPR), the updated dialog may contain links to brokers' agreements and data protection policies:
The possibilities for opening real accounts have been significantly expanded. The functionality for uploading ID and address confirmation documents, which was earlier presented in mobile terminals, is now available in the desktop version. Now, MiFID regulated brokers can request any required client identification data, including information on employment, income, trading experience, etc. The new functionality will help traders to open real accounts faster and easier, without unnecessary bureaucratic procedures.
Earlier, most of tasks performed through these functions could be implemented using Copy* functions. However, users had to implement their own functions in order to find the High/Low values on the chart and to search for bars based on their time. Now, these tasks can be easily executed using iHighest, iLowest and iBarShift functions.
iTime
Returns the Open time of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iOpen
Returns the Open price of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iHigh
Returns the High price of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iLow
Returns the Low price of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iClose
Returns the Close price of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iVolume
Returns the tick volume of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iBars
Returns the number of bars of a corresponding symbol and period, available in history.
iBarShift
Search bar by time. The function returns the index of the bar corresponding to the specified time.
iLowest
Returns the index of the smallest value found on the corresponding chart (shift relative to the current bar).
iHighest
Returns the index of the largest value found on the corresponding chart (shift relative to the current bar).
iRealVolume
Returns the real volume of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iTickVolume
Returns the tick volume of the bar (indicated by the 'shift' parameter) on the corresponding chart.
iSpread
Returns the spread value of the bar (indicated by the 'shift' parameter) on the corresponding chart.
Changes in the optimization cache storage format
In earlier versions, optimization cache was stored as one XML file. All Expert Advisor optimization passes with the specified testing settings were added to this file. Therefore, the same file stored results of optimization with different input parameters.
Now, the optimization cache is stored as separate binary files for each set of optimized parameters. Strategy Tester operations involving the optimization cache have become significantly faster due to the new format and smaller file size. The acceleration can be especially noticeable when you resume a paused optimization pass.
Viewing results of earlier optimizations
Now, the results of earlier optimizations can be viewed right in the Strategy Tester, so there is no need to analyze huge XML files using third-party software. Open the "Optimization results" tab, select an Expert Advisor and a file with the optimization cache:
The list contains all optimization cache files existing on the disk for the selected Expert Advisor. Optimization date, testing settings (symbol, timeframe, interval) and input parameters are shown for each file. You can additionally filter optimization results by the trade server, on which the results were obtained.Recalculation of the optimization criterion on the fly
An optimization criterion is a certain variable parameter, the value of which determines the quality of a tested set of inputs. The higher the value of the optimization criterion, the better the testing result with the given set of parameters is considered to be.
Earlier, only one criterion selected before optimization start was calculated during optimization. Now, you can change the optimization criterion on the fly when viewing results, and the Strategy Tester will automatically recalculate all values.
Manual use of the optimization cache
In earlier versions, optimization cache was stored as an XML file, which could be opened and analyzed using third-party software. Now it is stored in closed binary files. To get data in XML format, export them using the context menu of the "Optimization Results" tab.
Please note that cross rates for converting profit and margin to the specified deposit currency must be available on the account, to ensure proper testing.
The update is available through the LiveUpdate system.