Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1190
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Closing MetaQuotes Demo Server
MetaQuotes Software Corp.
4 March 2009
On April 5, 2009 server "demo.metaquotes.net" will be shut down. However, the History Center with the minute history will continue its work.
From this day our company refuses to use demo server. Nowadays, the number of companies running MetaTrader 4 platform is so high, that we do not see the need to maintain our own server.
This is some kind of antiquity (another server is mentioned). It's been done many times this year, the last time was a month ago on MetaQuotes-Demo a new demo account was created normally.
Also, if the server is removed why is it shown and pinged in the account opening wizard? The jam happens only on the last step.
The first time historical data is accessed from the indicator, if there is insufficient local data, data loading starts and the function returns an error.
This I understand perfectly. If it were about insufficient bars in the history, then both functions would return 0. However, one of them returns 0, while the other one correctly returns the number of bars in the history. Moreover, they are called one after the other:
Only the data in the first case is taken from the ready premembers (symbol and timeframe) of the Loader class (correctly initialized), but in the second case, from Symbol() and Period() functions (which return exactly the same values as written in symbol and timeframe). The values of the variables are identical to those of the functions (I checked). But it's not clear where iBars(symbol, timeframe) messes up with absolutely correct symbol and timeframe. While iBars(Symbol(), Period()) doesn't make a mistake. So I decided that it must be an error in the terminal itself or incorrect compilation of the source code.
I understand this very well. If it were about lack of bars in the history, then both functions would return 0. But as it is, one function returns 0, while the other correctly returns the number of bars in the history. Moreover, they are called one after the other:
Only the data in the first case is taken from the ready premembers (symbol and timeframe) of the Loader class (correctly initialized), but in the second case, from Symbol() and Period() functions (which return exactly the same values as written in symbol and timeframe). The values of the variables are identical to those of the functions (I checked). But it's not clear where iBars(symbol, timeframe) messes up with absolutely correct symbol and timeframe. While iBars(Symbol(), Period()) doesn't make a mistake. So I decided that there is an error somewhere in the terminal's operation.
Now write it like this, as Igor advised:
And don't forget that this is a class constructor, and it is called before initialisationI understand this very well. If it were about lack of bars in the history, then both functions would return 0. But as it is, one function returns 0, while the other correctly returns the number of bars in the history. And they are called one after another:
You come up with a story
and then you decide to write it as a claim and then the question
What does the 4401 error help say?
what did I write?
Do you understand the difference between a lack of bars and a chart not being ready ?
you have the situation after the restart of the terminal with the start of the indicator, and you request the data in the global initialization of MQL-program (class constructor), which will be executed before OnInit()
gone, you write faster than you read, search the forum 4401 - all the answers
I calculate the lot as follows
It is at the beginning of the EA...and I put it at the very end of the code
When the Lots variable is called in the OnTick function, the EA finds and recalculates it.
It can't be like that. The declaration and initialization are going on, and theLots variable is being assigned with an expression.
This assignment can be performed only once at startup. It can't be the case, that an expression is automatically assigned each timeLots is accessed. I haven't heard that mql can do that.
It can't be like that. You have declaration and initialization, and an expression is assigned to theLots variable.
This assignment can be done once at startup, it can't be that each time you accessLots, an expression is automatically assigned. I haven't heard that mql can do that.
I checked, when the balance changes, the lot also changes
Wow, I'll check it out. I know you can initialize variables with array elements with functions, but I didn't know it automatically changes, I don't think there's any such thing in C++ either, I'll check later.
And do not forget that this is a class constructor, and it is called before initialization
This is if the object is automatic. But I create it with keywordnew (in OnInit()) and delete it with keyword delete (in OnDeinit()). That is, I use a pointer to an object of Loader type. But I think you know all the details about it. That's why the loader is created in OnInit() and there cannot be any error here.
If you mean swapping functions, I've tried it and the result is the same. Only the messages go in a different sequence :)
Result:
2020.06.24 23:10:48.568 Loader::Loader symbol: EURUSD timeframe: PERIOD_H1
2020.06.24 23:10:48.568 Loader::Loader bars (2): 140435
2020.06.24 23:10:48.568 Loader::Loader bars: 0
2020.06.24 23:10:48.568 Loader::Loader Error: 4401
You made up some story.
and then decided to make it into a complaint.
No claims! And what's the story if I provided the source code and even described the sequence of actions to test its work? Obviously, you have misunderstood me ...
And you're asking for data in global initialization of MQL-program (class constructor), which will be executed before OnInit()
gone, you're writing faster than reading,search the forum 4401 - all the answers
It should not be executed beforeOnInit(), I wrote in a previous post. It's you who are not reading carefully, both the posts and the source code I added for testing.
This is some antiquity (another server is mentioned). More than once this year, last time a month ago on MetaQuotes-Demo a new demo account was created normally.
Also, if the server is removed why is it shown and pinged in the account opening wizard? The jam happens only on the last step.