Errors, bugs, questions - page 761

 

A service value needs to be held within a class. I declare it in privat section. I initialize it in the class constructor. Everything is ok.

Here is a subtlety. This value is actually a constant - it does not change throughout the lifetime of the program.

When attaching it to declaration "const", the compiler swears at an attempt to modify it (initialize it) in the constructor. Initialization directly in the declaration block also causes a compilation error.

How to declare and initialize a constant within one class?

Документация по MQL5: Основы языка / Типы данных / Структуры и классы
Документация по MQL5: Основы языка / Типы данных / Структуры и классы
  • www.mql5.com
Основы языка / Типы данных / Структуры и классы - Документация по MQL5
 
voix_kas:

A service value needs to be held within a class. I declare it in privat section. I initialize it in the class constructor. Everything is ok.

Here is a subtlety. This value is actually a constant - it does not change throughout the lifetime of the program.

When attaching it to declaration "const", the compiler swears at an attempt to modify it (initialize it) in the constructor. Initialization directly in the declaration block also causes a compilation error.

How to declare and initialize a constant within one class?

class MyClass
  {
public:
           MyClass(void): i(777), s("my string") {}
          ~MyClass(void) {}
private:
    const int    i;
    const string s;
  };
 
Is it some kind of mistake, or is there a 5 pips spread on the MetaQuotes demo server as of today? What is the reason for this change? And then why are the orders being placed so crookedly?
 

Hello!

I have a question: I know that MetaTrader 5 does not allow importing its quotes, but is there any software tool for importing quotes planned? For example, as it is done in Wealth Lab 6.3: on their website you can download various extensions that can be used to upload quotes into the terminal. For example, you can download free quotes from yahoo finance, google finance, quotes of Russian shares from finam.com, etc. It means that you do not even need a connection to your trading account!

It would be very convenient. Also it would be super to create a connector to Quik program to create robots for stock market.

Personally, I have a deep respect for MetaQuotes team, I work with their terminal with great pleasure and I am deeply convinced that Meta Trader has a great future.

However, the only thing that keeps me in Wealth Lab is the possibility of importing my quotes. I want to work with stocks, futures contracts, the market... when will it be done?

p.s. MetaQuotes, looking at all your latest updates, both for terminal and website, I want to sincerely thank you and wish you success! Thank you for the excellent MetaTrader 5 software.

 

Wait for MT5 to be launched on stock brokers and the entire quote history will be normal.

We do not allow third-party imports of other people's data, as this would completely break the "data always accessible, always correct, always synchronised, with all the right settings etc." mechanism.

We have such a complex and automated system, actively working with remote agents, visualiser, cloud agents, etc., that it makes no sense to overload it.

Our goal is simplicity and automatism. Look at how MetaTrader 5 has evolved. In it, almost everything is done automatically, there is a minimum of settings, all the data is available - you just have time to press the "Start" button.

 

I get it, you professionals know best. We will wait.

When are you planning at least demo access to quotations and stakes for RTS, MICEX and other exchanges? Are there already such brokers?

 
Renat:
About non-existing quotes: please provide a reproducible example in your code. There must be an error in your code.

Here's an example of absolutely crooked operation of CopyOpen() andSeriesInfoInteger() functions.

The code used:

   string symbol="USDHKD";
   datetime date=D'02.05.12 00:00'; 
   double Arr[];
   Print("SYMBOL: ",symbol);
   Print("SERIES SYNCRONIZED: ",(bool)SeriesInfoInteger(symbol,Period(),SERIES_SYNCRONIZED));
   Print("LAST BAR DATE: ",TimeToString(SeriesInfoInteger(symbol,Period(),SERIES_LASTBAR_DATE)));
   Print("WORK BAR DATE: ",date);
   int i=CopyOpen(symbol,Period(),date,1,Arr);
   Print("COPYOPEN RESULT: ",i);
   if(i>0){Print("OPEN VALUE: ",Arr[0]);}else{Print("OPEN VALUE: UNKNOWN");}

Results obtained:

2012.07.02 22:44:33     Ind (EURUSD,D1) OPEN VALUE: 7.787
2012.07.02 22:44:33     Ind (EURUSD,D1) COPYOPEN RESULT: 1
2012.07.02 22:44:33     Ind (EURUSD,D1) WORK BAR DATE: 2012.05.02 00:00:00
2012.07.02 22:44:33     Ind (EURUSD,D1) LAST BAR DATE: 2011.09.02 00:00
2012.07.02 22:44:33     Ind (EURUSD,D1) SERIES SYNCRONIZED: true
2012.07.02 22:44:33     Ind (EURUSD,D1) SYMBOL: USDHKD

2012.07.02 22:45:57     Ind (EURUSD,W1) OPEN VALUE: 7.79515
2012.07.02 22:45:57     Ind (EURUSD,W1) COPYOPEN RESULT: 1
2012.07.02 22:45:57     Ind (EURUSD,W1) WORK BAR DATE: 2012.05.02 00:00:00
2012.07.02 22:45:57     Ind (EURUSD,W1) LAST BAR DATE: 1970.01.01 00:00
2012.07.02 22:45:57     Ind (EURUSD,W1) SERIES SYNCRONIZED: true
2012.07.02 22:45:57     Ind (EURUSD,W1) SYMBOL: USDHKD

Build 655; MQ server.

Files:
Ind.mq5  2 kb
 
If I understand you correctly, you don't like that the Open price request for the Wednesday afternoon bar on May 2, 2012 is not the same as the Open price for the weekly bar, which includes May 2?

So you didn't understand the difference between the Wednesday afternoon bar's Open price and the weekly open price, which started on Monday April 30th?
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5
 
Renat:

Look at theLAST BAR DATE value. According toSeriesInfoInteger() there is nohistory for May or April 2012 for the specified instrument,

and CopyOpen() does not give an error.

 
I'll get to my computer and check.

In the meantime, you can copy the date instead of the opening price and see which date bar was issued on request.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы индикаторов / Ценовые константы - Документация по MQL5