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
Somewhere I got the advice to always check if an object exists before using ObjectCreate (or ObjectSet? I don't remember)
In general, I use this variant
Good afternoon.
Spent half a day already and can't figure it out.
Please advise what may be the error here ? Could it be in INIT function ?the error could be
1. If you call WindowFind() in init() or in a function that is called in init
2. windowFind() and you have #property indicator_chart_window declared, since windowFind() is called for subwindow
3. there is no indicator with the name you are looking for in the window
3. the indicator with the name you are looking for is not in the window
mmm... what do you mean object?
what does this have to do with the object ?
The object is secondary, because it is trying to be rendered in a window which does not exist,
besides, if the object is created, there will be no error, if the object is created secondarily, ObjectCreate() will return false
what does this have to do with the object ?
The object is secondary, because it is trying to be rendered in a window that doesn't exist,
besides, if the object is created, no error will occur, if the object is created secondarily, ObjectCreate() will return false
error can be
1. if you call WindowFind() in init() or in function which is called in init
2. windowFind() and you have #property indicator_chart_window declared, because windowFind() is called for subwindow
3. the indicator with the name you are looking for is not present in the window
1. No, I call the function in START : object("Symbol1", Symbol_1, 11, Color_1, 5);
2. You have declared #property indicator_separate_window
3. So how can an indicator be missing if its window is present ?
Here is the function itself :
I don't call anything at all in INIT. Maybe I should add something there as well?Somewhere I got the advice to always check if an object exists before using ObjectCreate (or ObjectSet? I don't remember)
In general, I use this variant.
What name should I specify in (ObjectFind("AsignalGF") -
What should I set the name of the indicator or the name (array) of the line drawn by the indicator?
Which name should I set in (ObjectFind("AsignalGF") -
indicator name or the (array) name of the line drawn by the indicator?
I think I got it. I set the name of the object in the function.
ObjectCreate(name+ WindowExpertName(), OBJ_LABEL, WindowFind(WindowExpertName()), 0, 0);
I set the name of the object in the function. ObjectCreate(name+ WindowExpertName(), ....);