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
Hello, I want to make a script to place vertical lines at the opening times of the major world markets.
I have quite a bit of programming experience, but am only now using MQL4, mostly with the aim of drawing things on my charts.
Well, the script below compiles without errors, but when used on a chart it draws the vertical line, but doesn't change the style of the line (the ObjectSet isnt working). The error that occurs is 4201, and the documentation description is
I have no idea why it's giving me this error. Anyone know why?
Btw, I get the same error if I use ObjectSet for a different property of the vertical line, for example ObjectSet("London", OBJPROP_LEVELCOLOR, 32768).
int start() {
ObjectCreate("London", OBJ_VLINE, 0, Time[1],0);
stat=ObjectSet("London", OBJPROP_LEVELSTYLE, STYLE_DASH);
err=GetLastError();
Print("error(",err,"): ");
}