New MetaTrader 5 platform build 1930: Floating window charts and .Net libraries in MQL5 - page 9

 

Forum on trading, automated trading systems and testing trading strategies

New version of MetaTrader 5 build 1930: Floating graphs and .Net libraries in MQL5

Renat Fatkhullin , 2018.12.06 14:40

We are preparing soon to introduce a new type of software - services:


They will work constantly, regardless of whether there are connections to trade servers or active accounts. In the 1958 build, so far only preparation. 

Forum on trading, automated trading systems and testing trading strategies

New version of MetaTrader 5 build 1930: Floating graphs and .Net libraries in MQL5

Renat Fatkhullin , 2018.12.06 15:00

You can code independent programs, data feeds, analyzers, and so on.

Advantages in complete independence from attachment to charts, active accounts.

 

I found an issue drawing lines before the start time of the first data point on MT5

(this code draws fine on MT4)

#property strict
#property indicator_chart_window
#property indicator_plots 0

int OnInit()
{
   //Print("OnInit");
   return INIT_SUCCEEDED;
}

void OnDeinit(const int reason)
{
   //Print("OnDeinit");
   Comment("");
   ObjectsDeleteAll(0, "TestDrawLine");
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   static datetime prevTime = 0;
   static double prevPrice = 0;
   
   if (rates_total > 0)
   {
      int i = rates_total - 1;
      
      ArraySetAsSeries(time, false);
      ArraySetAsSeries(high, false);
      ArraySetAsSeries(low, false);
      ArraySetAsSeries(close, false);
   
      if (close[i] != prevPrice || time[i] != prevTime)
      {
         datetime zeroTime = 0;
         datetime currBarTime = time[i];
         datetime fifthBarTime = time[i-5];
         double   price1 = close[i] + Point() * 100;
         double   price2 = close[i] + Point() * 200;
         double   price3 = close[i] + Point() * 300;
         
         //Comment("i=", i, " open[i]=", open[i], " close[i]=", close[i]);
         
         DrawLine("TestDrawLine0a", zeroTime,     price1, currBarTime, price1, clrPurple);   // draw from datetime = 0
         DrawLine("TestDrawLine0b", fifthBarTime, price1, currBarTime, price1, clrGreen);    // draw from 5th bar
         
         DrawLine("TestDrawLine2a", time[0] - 60, price2, currBarTime, price2, clrPurple);   // draw from 60 seconds before time[0] *** This doesn't get drawn ***
         DrawLine("TestDrawLine2b", fifthBarTime, price2, currBarTime, price2, clrGreen);    // draw from 5th bar
         
         DrawLine("TestDrawLine1a", time[0],      price3, currBarTime, price3, clrPurple);   // draw from time[0]
         DrawLine("TestDrawLine1b", fifthBarTime, price3, currBarTime, price3, clrGreen);    // draw from 5th bar
         
         prevPrice = close[i];
         prevTime = time[i];
      }
   }
   return rates_total;
}


void DrawLine(string name, datetime time1, double price1, datetime time2, double price2, color col, int style = STYLE_SOLID)
{
   if (ObjectFind(0, name) < 0)
   {
      ObjectCreate(0, name, OBJ_TREND, 0, time1, price1, time2, price2);
      ObjectSetInteger(0, name, OBJPROP_RAY_RIGHT, false);
   }
   else
   {
      ObjectMove(0, name, 0, time1, price1);
      ObjectMove(0, name, 1, time2, price2);
   }
   ObjectSetInteger(0, name, OBJPROP_COLOR, col);
   ObjectSetInteger(0, name, OBJPROP_STYLE, style);
}
 
James Cater:

I found an issue drawing lines before the start time of the first data point on MT5

(this code draws fine on MT4)

That's an MT4 bug...
 
Alain Verleyen:
That's an MT4 bug...

Look more carefully....  it draws the line if you start at time = 0 but does not if time is between 0 and the first real bar

(I can add a workaround to use time 0 but it's not ideal)

 
James Cater:

Look more carefully....  it draws the line if you start at time = 0 but does not if time is between 0 and the first real bar

(I can add a workaround to use time 0 but it's not ideal)

I know, why are you expecting to be able to draw from outside the chart ?

Anyway, if you want this to be recognized as a bug, good luck.

 
Alain Verleyen:

I know, why are you expecting to be able to draw from outside the chart ?

Anyway, if you want this to be recognized as a bug, good luck.

Multi Time Frame (MFT) indicators draw lines from D1 or higher timeframes onto M30 or lower charts

The history of M30 and lower timeframes often stops way before the history on higher timeframes.

Therefore this can break lines and rectangles drawn on many MTF indicators.

That's why I think they should take this bug a little more seriously

 
lopTraderFx:

Hi Aytugan,

after apply last build update 1931 this morning, all my custom EAs stopped to work. It seems that "#Trade/SymbolInfo.mqh" fails, all object methods are returning empty data. Per example, I've build a blank expert to show you the evidences:


Please, how could I revert to a previous working version? Do you have a older build executable available?

Thanks in advance,

LopTrader

You should call mSymbol.Refresh() before you use mSymbol object to retrieve any symbol data. Best way is to call it on the OnTick function than use it to get the most recent symbol data.

 

Forum on trading, automated trading systems and testing trading strategies

New version of MetaTrader 5 build 1930: Floating graphs and .Net libraries in MQL5

Renat Fatkhullin , 2019.01.08 06:45

We have seriously optimized raising and synchronizing databases in MetaTrader 5 build 1968 (beta is already available).

The base rises 5 times faster during a cold start and 1.5 times faster when it is hot.

And in a hot mode, the rise of bases was faster than in MT4.

 

Just some news -

Forum on trading, automated trading systems and testing trading strategies

The latest beta version of the descope.

MetaQuotes Software Corp. , 2019.01.13 10:52

We will do so that the beta version can be rolled back to the latest release version via the command in the help menu.