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
Now the problem is reoccurring!
I closed MT5 and then reloaded, and the lines reappeared... in totally different places.
I have also just typed out another blank custom indicator that only has the properties included, exactly the same problem with this program too, here is a screenshot:
It's probably due to :
You declared 2 buffers/plots, so the memory is reserved, but you don't initialize them or anything, so they got random contents.
It's probably due to :
You declared 2 buffers/plots, so the memory is reserved, but you don't initialize them or anything, so they got random contents.
If this is the case then surely the problem could be reproduced on your system... but you said you were unable to, which makes me think something has gone seriously wrong with mine.
Even with SetIndexBuffer added the problem still occurs.
If this is the case then surely the problem could be reproduced on your system... but you said you were unable to, which makes me think something has gone seriously wrong with mine.
Even with SetIndexBuffer added the problem still occurs.
No it depends of available memory and usage. It's random because the memory reserved is not initialize, on my side memory is empty so nothing show, on your side there are some "old" data so it draws them. Either don't use unneeded buffers or initialize them.
Okay thank you.
I have managed to eradicate most of the problems that were occurring yesterday, but I am still having some issues with the buffers printing 'old data', despite the buffers all being properly initialised from the first compile.
The indicator in the picture below works fine, except for at the start of each line printing where some totally random stuff is still happening. In the picture below, the arrow points to the random data that the indicator is still drawing.
I have installed a totally separate version of the MT5 client terminal and compiled the code to run on this new terminal, and unfortunately, the issue still occurs.
I am a bit lost in terms of trying to figure out what exactly I am doing (or what I am not doing), which is causing this error.
I have posted the code underneath the below screenshot, if anyone is able to advise on possible issues inside the program which may be causing this random plotting, or if somebody can just compile this on their terminal and see if they get the same result it would be greatly appreciated.
EDIT: If I compile the program whilst it is still attached to the chart, SOME of the lines disappear. Vertical lines remain in position of the first plotted element.
I have managed to eradicate most of the problems that were occurring yesterday, but I am still having some issues with the buffers printing 'old data', despite the buffers all being properly initialised from the first compile.
...Wrong. Your buffers are not initialized at all.
Wrong. Your buffers are not initialized at all.
Ah. I wasn't aware of this function. By 'initialise' I thought you meant using SetIndexBuffer in OnInit().
The documentation states that "The function initializes a numeric array by a preset value." - why do we need to do this? I apoligise if my questions sound silly, I understand that this is probably why my program is failing but I just don't really understand how setting all the elements to empty value 'initialises' the array. Would you mind explaining this a bit further? Again I apologise if my question sounds silly I just can't really get my head around it. Thanks.
And I'm still having random lines appear on the chart even after using that function. I have deleted and removed the program from the recycle bin, then retyped the whole program out, with ArrayInitialize added, pressed compile ONCE, and I'm still getting three vertical lines on the chart where each line starts printing.