Errors, bugs, questions - page 1153
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
The video in the forum posts does not play. in place of video empty space. tried many browsers. device - Lenovo K900.
How do you run a program installed in Windows 8.1? With /portable?
If working in Windows 8.1 as a normal user, the MT5 terminal does not remember the account numbers entered. Also MetaEditor does not save MQL5 Storage state. This can only be fixed if you work as an administrator or if "Run this program as administrator" is selected in the metaeditor64.exe and terminal64.exe file properties.
P.S. The terminal is the latest - but the problem is not new.
Good afternoon.
I have quite a resource-intensive indicator (which is calculated from 7+ arrays), it loads normally only "intermittently" in the terminal, I don't know for what reason. No errors in it, it's something with MT5 terminal itself...
I would like to test it in the tester, but in the tester it keeps giving error: I attached a screenshot.
Please advise, is there any possibility to process the error before the start of the tester and forcibly reload the indicator in the tester, if it appears?
Good afternoon.
I have quite a resource-intensive indicator (which is calculated from 7+ arrays), it loads normally only "intermittently" in the terminal, I don't know for what reason. No errors in it, it's something with MT5 terminal itself...
I'd like to test it in the tester, but in the tester it keeps giving me an error: I attached a screenshot.
Please advise, is there any way to handle the error before the start of the tester and forcibly reload the indicator in the tester, if it appears?
.
The error is in your code, not in the terminal. There is even a hint where to look for the error: line 302, position 49. This error is an array exit from its range. For example, you have an array with size [4], but you are trying to get value [5].
I can't fix it, the array is filled with quotes (100%) or indicator values. In the terminal at a certain moment the value of quotes or indicators X outputs NULL, and at another moment it outputs a normal value (not on the 0th bar). I do not know why it happens.
The NULL value is always present in the tester. The error occurs when I try to multiply a quote or indicator value, but there NULL.
I can't fix it, the array is filled with quotes (100%) or indicator values. In the terminal at a certain moment of time the value of quotes X gives NULL, and at another moment it gives a normal value (not on the 0th bar). I do not know why it happens.
The NULL value is always present in the tester. The error occurs when I try to multiply a quote or indicator value, but there NULL.
This code is the code from the indicator and the OnInit() function. Accordingly, OnInit() is processed at the moment of terminal start - and this code correctly displays tick price. It is OnInit() and not init() - like yours. If the error repeats, please send the code and the terminal version.
The error is that you are trying to receive market information (MarketInfo...) in OnInit() from the indicator. The indicator has no trading functions and therefore, during initialization it is not waiting for update of account and market information.
To get market data, use OnInit() of the EA, not the indicator.
If you want to use the market information in the indicator, you should enter a flag (bool) and check the correctness of the account information (Account...) in the OnCalculate() function in the case of the first run or in OnInit() if you change timeframe or indicator settings.
Do not mislead people. Regardless of whether the init() or OnInit() of the indicator is used, the terminal doesn't guarantee that this handler will be called when the login is done and the tick value is known. So it's easy to get zero in OnInit as well. Also there is no prohibition on the use of market information in indicators. But in this case we really have to transfer the initialization to the calculation part of the indicator and execute it on the first ticks.
There are no trading functions in the indicator. The Expert Advisor has trade functions. Therefore, when the EA calls the market environment and/or account information, everything goes correctly in OnInit().
To prove my words, here is a simple EA in which OnInit() refers to the trading environment and to the account information:
There are no trading functions in the indicator. The Expert Advisor has trade functions. Therefore, when the EA calls the market environment and/or account information, everything goes correctly in OnInit().
To prove my words, here is a simple Expert Advisor that OnInit() calls the market environment and account information: