My advice to you: ALWAYS write the name of the indicator and its extension in the indicator header, and also attach the file using the button
...

Before you use GetLastError, you need to call ResetLastError.
Then you do your function call and after that you check the error code.
Do not assume the error variable is yours if your execution path is coming from the terminal.
The terminal might have been using it.
Always wrap your own calls with ResetLastError and GetLastError.
Else results are undefined.
MrWolfPST:
The code is for MT5 and works fine. The functions PlotSet... does not exist on MT4, it shouldn't even compile.
Hi
Consider simple code above, put a break point at line 49 Print(errorNumber);
Run debug, errorNumber will be 4014.
If comment the three PlotIndexSet calls, all works whithout errors
I wrong something or is there a bug?
Thanks
F.

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
Hi
Consider simple code above, put a break point at line 49 Print(errorNumber);
Run debug, errorNumber will be 4014.
If comment the three PlotIndexSet calls, all works whithout errors
I wrong something or is there a bug?
Thanks
F.