Errors, bugs, questions - page 1360

 
A100:
This is what I suggested:
...
Only the == and != operations are affected by the changes.
Everything else, including the = operator, should be left as it is now (unchanged)

How can the= operator be left unchanged if it now causes confusion between pointers and the objects themselves? If you use * for it, then it should be used for all other operators as well. There must be a single standard. What you suggest is that the compiler should choose the right one by itself - that's wrong. There will be a lot of hard-to-find errors. Everything should be unambiguous: actions either with an object or with a pointer.

Well, all those asterisks are, of course, forced crutches. We have to change the whole concept the developers chose not so well from the very beginning, I think.

We should have moved away from the binding to C++, and respectively abandoned the use of pointers as a separate type of variable, replacing them with references. References are essentially the same as pointers, only interpreted by the compiler as objects themselves.Therefore, all actions with these variables, including operators, are treated as actions with an object. If you need to compare or assign exactly the references, use the reference operator. Therefore, there will be no contradictions:

 A  a;                     // воздаём объект
 A& aref;                  // создаём неинициализированную ссылку

 &aref = &a;                // присваиваем ссылку на a
 bool equalref = &aref==&a; // сравниваем ссылки

 aref = a;                  //вызываем оператор=()
 bool equal = aref==a;      // вызываем оператор==()

All in all, if the developers ever conceive of MQL6, we should go in that direction. Binding to C++ makes no sense anymore, because it does not correspond to the language's concept.

 
A100:
What is the most recent update you have?

Both MetaTrader and MetaEditor build 1159 (Windows 10 32 bit). On a large PC (64 bit) I am not sure about MetaEditor, but MetaTrader definitely build 1159.
 
A100:
What is the most recent update you have?

I have 1150. can't see the upgrade to the later 1159
 
Gennadiy Stanilevych:
I have 1150. does not see updates to the later 1159
You need to connect to the MetaQuotes-Demo server to get the latest updates.
 
A100:
MetaQuotes-Demo is of interest since we used to receive updates 2-3 times per month. It is clear that brokers have much less frequent updates.
Karputov Vladimir:
You need to connect to the MetaQuotes-Demo server to get the latest updates.

Agreed, updated via MetaQuotes-Demo, still 1150! And the terminal informed me several times that the updates were downloaded and offered to reboot, still 1150.

Ok, I downloaded the distribution package from http://www.metatrader5.com/ru/download, opened a demo account on MetaQuotes-Demo, turned off and on the terminal for several times - 1150! UAC disabled, Windows 7 SP1 - 64

Скачать MetaTrader 5
Скачать MetaTrader 5
  • www.metatrader5.com
Скачать торговый терминал MetaTrader 5 для комфортной и успешной работы на финансовых рынках. Терминал обладает внушительными торговыми и аналитическими возможностями и является одним из лучших в мире
 

I'll repeat the question since nobody has answered it and it has gone down because of heated discussion on OOP. This question is really important, is it a bug or a feature? I noticed it on MT4.

I've encountered a situation where the extern variable changes during the execution of the program, but when I change the timeframe, it again takes the value I set in the properties window. For example, if before the start I set TradeEnable to EnableAll and change the value to EnableBuy during the program execution, the value will return to EnableAll when the chart switches to another timeframe. The value I define in the timer event and output through Comment, there can be no error.

enum ETradeEnable {EnableAll, EnableBuy, EnableSell, DisableAll};
extern ETradeEnable TradeEnable = EnableAll;

The TradeEnable variable is not affected by flipping between charts. Read the help - Unlike input variables, values of extern variables can be changed programmatically while the program is running.

That's how OnDeinit and OnInit are set up.

Question: I don't understand something or change of TradeEnable is a runtime error?

int LastDeinitReason = 0;

void OnDeinit(const int reason)
{
    LastDeinitReason = reason;
    if(reason==REASON_CHARTCHANGE || reason==REASON_TEMPLATE || reason==REASON_PARAMETERS)
        return;
    EventKillTimer();
// далее код при завершении работы советника
}

int OnInit()
{
    if(LastDeinitReason==REASON_CHARTCHANGE || LastDeinitReason==REASON_TEMPLATE)
    {
        LastDeinitReason = 0;
        return(INIT_SUCCEEDED);
    }
    if(LastDeinitReason==REASON_PARAMETERS)
    {
        SetParams();
        return(INIT_SUCCEEDED);                              
    }
// далее код инициализации при запуске
}
 
Karputov Vladimir:
You have to connect to the MetaQuotes-Demo server to get the latest updates.
This does not help. I even demolished MT5. Opened the demo on MetaQuotes. Still 1150.
 
Gennadiy Stanilevych:
It doesn't help. I even took MT5 down. Opened a demo on meta-quotes. Still 1150.
Just opening a demo account on the MetaQuites-Demo server is not enough: you also need to connect to this demo account for the update.
 
Karputov Vladimir:
Just opening a demo account on MetaQuites-Demo server is not enough: you also need to connect to this demo account for the update.

Of course I connected. Then rebooted the terminal again. Still doesn't see any updates.

Files:
20150826.log  7 kb
 
Gennadiy Stanilevych:

Of course I connected. Then rebooted the terminal again. Still doesn't see any updates.

Strange (looked through the log file). From experience - if there are updates, then after connecting literally within three seconds starts downloading.

Reason: