Download MetaTrader 5

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

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
182658
MetaQuotes Software Corp.  

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.

Pham Duy Duc
660
Pham Duy Duc  
Cool.
Maksim Emeliashin
161
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:

//+------------------------------------------------------------------+
//|                                                      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);
     }
  }
//+------------------------------------------------------------------+


Alain Verleyen
Moderator
31186
Alain Verleyen  
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.

Maksim Emeliashin
161
Maksim Emeliashin  
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).


Alain Verleyen
Moderator
31186
Alain Verleyen  
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.
Aleksey Pak
3593
Aleksey Pak  
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.
To add comments, please log in or register