Errors, bugs, questions - page 1089
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
This was the standard full initialisation of the indicator, which is performed at its first startup and is done via Oninit().
Sometimes, when the history is updated, etc., it also needs to be done.
No one ever thought that the repeated initialization of the indicator via Oninit() would cause the arrays to stop responding.
Why?
"SetIndexBuffer Binds the specified indicator buffer to the one-dimensional dynamic array"
Are you linking the buffers to other arrays when you update the history?
This was a standard full initialisation of the indicator, which is performed at its first startup and is done via Oninit().
Sometimes, when the history is updated, etc., it also needs to be done.
No one ever thought that the repeated initialization of the indicator through Oninit() would cause the arrays to stop responding.
You have already been offered to show the source code here, to at least understand what the problem is.
Two lines of code (although the source code) do not allow to determine the problem.
This was the standard full initialisation of the indicator, which is performed at its first startup and is done via Oninit().
Sometimes when you update the history, etc., it also needs to be done.
This is not necessary.
You simply re-binding by mistake, and then you hope to save the data in the buffer and address it until the indicator is recalculated. That's why you get a legitimate out of range on accessing non-existent data at the wrong index.
There's no need for that.
It's just that you re-bind on error, then hope to save the data in the buffer and access it until the indicator recalculation arrives. That's why you get a logical out of range on accessing non-existent data at the wrong index.
I deliberately initialise with buffer zeroing, so I don't count on saving data in principle.
The problem is that after re-binding the array doesn't fill and it's when I try to write that the specified error appears.
If this is the norm, then fine...
The buffer is empty until the request to recalculate the indicator arrives.
And if you re-initialise/re-bind it forcibly, you have no right to access any of its elements until you get to the indicator handler OnCalculate.
Afternoon!
Help me sort out the activity of the terminal.
Signed up for a signal, the terminal worked for a while - opened and closed orders. Then account was blocked with comment "for high server load". Support said that my terminal was generating many requests to server (opening, closing, modifying etc.). I can see from the logs that metatrader tries to sync its state once every two minutes and nothing else happens.
Is there any way to keep track of the number of requests from the metatrader to the server so as not to get the whole account blocked?
1.Tell me, is the use of flags and static variables reliable when using a vps server?
Sometimes in complex EA conditions it is necessary to use up to ten or more flags, not counting static variables.
2.To reset all flags and static variables would it be sufficient to remove the EA from the chart?
3.What happens if the server is restarted, will the flags and static variables remain?
4. If the server suddenly goes down, will the flags and stat variables reset when the server is switched on?
The questions concern MQL4 and MQL5.
1.Tell me, is the use of flags and static variables reliable when using a vps server?
Sometimes in complex EA conditions it is necessary to use up to ten or more flags, not counting static variables.
2.To reset all flags and static variables would it be sufficient to remove the EA from the chart?
3.What happens if the server is restarted, will the flags and static variables remain?
4. If the server suddenly goes down, will the flags and stat variables reset when the server is switched on?
These questions are related to MQL4 and MQL5.
1. It does not matter if you have VPS or your own PC; the main thing is that MQL4/5 will work.
2. Yes.
3. No saving.
4. Yes, they will.
If you want flags to save, write their values to a file and then read them. Try to remove trading functions from the Expert Advisor, leave those that set flags, output them in the comment, write their values, reload MT4/5 and see what happens.
1. Yes, it doesn't matter if it's a VPS or your own computer, as long as MT4/5 works.
2. Yes.
3. No saving.
4. Yes, they will.
If you want flags to be saved, write their values to a file and then read them. Try to remove trading functions from the Expert Advisor, leave those that set flags, write their values in the comment, reload MT4/5 and see what happens.
Great solution with writing to file!