New MetaTrader 5 Platform Build 1595: Access to the price history

 

New MetaTrader 5 Platform Build 1595: Access to the price history

The MetaTrader 5 platform update will be released on April 21, 2017. The update will feature the following changes:

  1. Terminal: Added access to the bar and tick history. Now, it is possible to download the full 1-minute and tick history from the server through the trading platform interface, not only using the MQL5 language. Access to price data is expanded as part of preparations for the launch of custom data-feed functions. In the near future, the platform will provide the possibility to build charts based on users' price data, as well as to create synthetic symbols and use offline charts.

    To download the data, open the symbol management dialog from the context menu of the "Market Watch" window:


    The dialog features two new tabs: "Bars" and "Ticks". Select the symbol, the desired time interval and click "Request". The platform will request from the server all available data, and will immediately display the data if they have already been downloaded. Saved price data can be exported to a CSV file.

  2. Terminal: Added display of time with a millisecond precision for positions, deals and orders.




  3. Terminal: In the trade dialog, fixed notifying about the refusal to execute a Close By request.
  4. MQL5: Fixed the PositionSelect function. The function could occasionally select a position different from the one having the lowest ticket number.
  5. MQL5: Fixed operation of the CopyTicks and CopyTicksRange functions when requesting very deep tick history data.
  6. Signals: Fixed copying of operations that increase the size of an existing position. The error could occasionally occur on netting accounts.
  7. Tester: Fixed processing of limit orders for exchange instruments. Orders placed better than the market (the buy price is below the market price or the sell price is above that) are executed without slippage. Orders placed worse than the market or at the market price are executed immediately at the market price as of the order placing time.
  8. Updated documentation.

The update will be available through the LiveUpdate system.

 
Cool.
 

New release 1595 has a serious bug in the function HistorySelect (I'm already post it in service desk).

Here is the sample of Expert that freeze when the date changed from one day to another.

Just start it in the tester in any pair since 2016.01.01 on OHLC M1 and any timeframe. When the day changed - tester freezed permanently.

I have a bad feeling that it has same problem on the real trade account's Experts that using HistorySelect.

Code:

//+------------------------------------------------------------------+
//|                                                      bug1595.mq5 |
//|                        Copyright 2017, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

#include <Trade\Trade.mqh>

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
     if (PositionsTotal() == 0)
     {
       CTrade trd;
       CSymbolInfo s;
       s.Name(_Symbol);
       s.Refresh();
       s.RefreshRates();
       trd.PositionOpen(_Symbol, ORDER_TYPE_BUY, s.LotsMin(), s.Ask(), s.Ask() - 1000 * s.Point(), s.Ask() + 1000 * s.Point());
    }
     datetime dt_from = D'2016.01.01', dt_to = TimeCurrent();
     if (HistorySelect(dt_from, dt_to))
     {  
         
         printf("OK");
         Sleep(1000);
     }
  }
//+------------------------------------------------------------------+


 
Maksim Emeliashin:

New release 1595 has a serious bug in the function HistorySelect (I'm already post it in service desk).

Here is the sample of Expert that freeze when the date changed from one day to another.

Just start it in the tester in any pair since 2016.01.01 on OHLC M1 and any timeframe. When the day changed - tester freezed permanently.

I have a bad feeling that it has same problem on the real trade account's Experts that using HistorySelect.

Code:


It works without problem for me.

It's a bad idea to load all history on each tick.

 
Alain Verleyen:

It works without problem for me.

It's a bad idea to load all history on each tick.

Really, it just a sample for showing the problem. I'm not asking the history each tick in the real Expert :)

But my tester freeze when the TimeCurrent() changing one day to another. I'm check it on the Alpari Build and clean MT5 build from site.

By the way, freeze happen on debugging from MetaEditor (Ctrl+F5).


 
Maksim Emeliashin:

Really, it just a sample for showing the problem. I'm not asking the history each tick in the real Expert :)

But my tester freeze when the TimeCurrent() changing one day to another. I'm check it on the Alpari Build and clean MT5 build from site.

By the way, freeze happen on debugging from MetaEditor (Ctrl+F5).


Ok I can confirm it freezes with Alpari-MT5, but not with FxPro or Metaquotes. Weird.
 
Maksim Emeliashin:

New release 1595 has a serious bug in the function HistorySelect (I'm already post it in service desk).

Here is the sample of Expert that freeze when the date changed from one day to another.

Just start it in the tester in any pair since 2016.01.01 on OHLC M1 and any timeframe. When the day changed - tester freezed permanently.

I have a bad feeling that it has same problem on the real trade account's Experts that using HistorySelect.

Code:

Sorry for inconvenience. This issue is fixed. Please wait a new build soon.
 
This update removed all the chart history beyond 2014, which I was using to develop my algorithm, and seemingly there is now no way to get it back. What can be done, is it possible to revert back to the previous version?
 
Object Tooltip is not showing up during indicator backtest. But its perfectly showing okay on live chart. Can you anyone please tell me is it a coding problem or software bug?
 
Tom Clayson What can be done, is it possible to revert back to the previous version?
  1. Restore your history files from your backup. You do backup your machine, don't you?
  2. Restoring the previous version will do nothing to your history files.
Reason: