Just like the subject says, I can create an object fine in init but if I try it in start I get nothing. I'm playing around with the FX Multi Meter II code and was wondering if there is something that might be preventing it from being created but I can't find anything. I've tried it in all different locations within the start function and still get nothing.
- [ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4.
- Help a learning coder fix an indicator?
- EA tester + ObjectCreate() Function
Difficult without seeing the code.
What error report are you getting?
Possibly, if you have already created the object, you cannot create a new object with the same name unless you delete the first one.
I am using the following code to create the object which I use in all my programs to debug certain variables, the main body of the start function is about 700 lines so IDK if it will fit.
ObjectCreate("ObjName", OBJ_LABEL, 0, 0, 0); ObjectSetText("ObjName","Open Trade: "+OpenTrade+" Position: "+Position+" Arrow: "+ArrowUp+ArrowDown+" Strength: "+Strength+" Error:"+GetLastError(),25, "Verdana", Red); ObjectSet("ObjName", OBJPROP_CORNER, 0); ObjectSet("ObjName", OBJPROP_XDISTANCE, 20); ObjectSet("ObjName", OBJPROP_YDISTANCE, 20);
Don't call GetLastError (_LastError) unless you have an error. Your snippet is showing the ObjectCreate error which will always fail after the first tick.
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