Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1189

 

Please advise what to do with the robot? The test breaks in any terminal at any broker three months before the end of the test. The robot has no stops, but the test stops....

Tired of....


 
Stanislav Korotky:

How do I open a MT4 demo account on MetaQuotes Demo? It used to work without any problems, now on the last page of the dialog it says: Registration, Wait a little, please, and in this state it remains idle indefinitely, fields with login and password remain empty. No messages in log. Tried both "demo" and "real" and different types of accounts.

UPD: I tried one broker demo - same thing.

Checked, on Metacquot server too, no new demo registered, on roboforex without problems registered new demo


Mihail Matkovskij:

It shows error 4401.

Check the error in the help.

and it's not a specific function call, it's the queue, swap, the error goes to another area - the chart is not ready, then you have initiated history building and when you call it again, history may already be ready, just like it may not be


in indicators access to the history is asynchronous, if the history is not ready, an error is returned and the history is prepared, Sleep() does not work in indicators, so if you get an error, on the next tick read the history again, search for "multisymbol" or "multiperiod" indicators in kodobase and look how the history is read from another timeframe or symbol, the principles are the same

 
Stanislav Korotky:

How do I open a MT4 demo account on MetaQuotes Demo? It used to work without any problems, now on the last page of the dialog it says: Registration, Wait a little, please, and in this state it remains idle indefinitely, fields with login and password remain empty. No messages in log. Tried both "demo" and "real" and different types of accounts.

UPD I tried one broker`s demo - same thing.

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. Currently, the number of companies running MetaTrader 4 platform is so high, that we don't see the need to maintain our own server.

 
Igor Makanu:

look up the error in the help

and it's not about a particular function call, but about the order, swap, the error will go to another place - the chart is not ready, then you have initiated building the history and when you call it again, the history may already be ready, just like it's not ready at all

But why is history not ready with iBars(symbol, timeframe), while it is completely normal with iBars(Symbol(), Period())? And it happens only when the terminal is restarted, not always. And variables symbol, timeframe are initialized correctly, in initialization section (I checked it myself).

Try to squeeze my example:https://c.mql5.com/3/324/Test.mq5

Sequence of actions:

1. Throw the compiled file on the chart. The messages you get are:

2020.06.24 21:05:50.773 Loader::Loader symbol: EURUSD timeframe: PERIOD_H1

2020.06.24 21:05:50.773 Loader::Loader bars: 140433

2020.06.24 21:05:50.773 Loader::Loader Error: 0

2020.06.24 21:05:50.773 Loader::Loader bars (2): 140433

2. Terminate the terminal and restart it. Log messages will be as follows:

2020.06.24 21:07:34.963 Loader::Loader symbol: EURUSD timeframe: PERIOD_H1

2020.06.24 21:07:34.963 Loader::Loader bars: 0

2020.06.24 21:07:34.963 Loader::Loader Error: 4401

2020.06.24 21:07:34.964 Loader::Loader bars (2): 140433

 
Mihail Matkovskij:

But why with iBars(symbol, timeframe) the story turns out to be incomplete, while with iBars(Symbol(), Period()) it is quite normal? And it happens only when the terminal is restarted, not always. And the symbol and timeframe variables are initialized correctly, in the initialization section (I checked it myself).

once again... swap these 2 lines and get playback

i may be wrong, but i think it will be like i wrote above - i can't/can't elaborate

 
MakarFX:

@Artyom Trishkin

Are you a moderator in this thread?

Not only

 
Artyom Trishkin:

Not only that

How do I know who banned me yesterday?
 
Mihail Matkovskij:

But why with iBars(symbol, timeframe) the story turns out to be incomplete, while with iBars(Symbol(), Period()) it is quite normal? And it happens only when the terminal is restarted, not always. And variables symbol, timeframe are initialized correctly, in initialization section (I checked it myself).

Try to squeeze my example:https://c.mql5.com/3/324/Test.mq5

Sequence of actions:

1. Throw the compiled file to the chart. The messages you get when you do this:

2. Terminate the terminal and start it again. The messages in the log will be as follows:

Historical data is up to date within two minutes. In order to keep them "hot" at all times, a non-native symbol/period must be accessed at least once every two minutes.

The first time historical data is accessed from the indicator, if there is not enough local data, data loading is started and the function returns an error. In this case, you must exit OnCalculate() with return zero - so there will be no data in the variable prev_calculates on the next tick - it indicates the amount of already calculated data on the previous call to the OnCalculate() handler. As soon as enough data is loaded, you will stop getting a data access error and you can continue working with OnCalculate().

One more thing: do not use all functions which cause loading of historical data from the indicator - if you are trying to use data of the current symbol and period in them, this might cause a crash. Use rates_total data to get the number of history bars.

All this has been told many times on the forum and displayed in the documentation.

I don't want to look for it, but I remember well where I described it all myself with links to sources.

 
MakarFX:
How do I know who banned me yesterday?
You don't.
 
Artyom Trishkin:
No way.

Too bad(

That no good man, due to negligence, banned me for no reason.