Coding help - page 138

 
RyuShin:
Okay I understand now. Thank you. Here's another question, is it possible to code X Y of texts so that they don't move? Maybe using OBJPROP_XDISTANCE and OBJPROP_YDISTANCE?

RyuShin

Yes. And that is how they are done usually. It can be done for label objects (OBJ_LABEL, can not be done for text objects - OBJ_TEXT)

 
mladen:
RyuShin Yes. And that is how they are done usually. It can be done for label objects (OBJ_LABEL, can not be done for text objects - OBJ_TEXT)

Okay. Is it possible to replace "OBJ_TEXT" with "OBJ_LABEL"? e.g. ObjectCreate(name, OBJ_TEXT, 0, Time[10], lvl) to ObjectCreate(name, OBJ_LABEL, 0, OBJPROP_XDISTANCE, 15, Time[10], lvl).

 
RyuShin:
Okay. Is it possible to replace "OBJ_TEXT" with "OBJ_LABEL"? e.g. ObjectCreate(name, OBJ_TEXT, 0, Time[10], lvl) to ObjectCreate(name, OBJ_LABEL, 0, OBJPROP_XDISTANCE, 15, Time[10], lvl).

Yes

But with labels you have to use ObjectSet() functions to set the X and Y distance (like this ObjectSet(name,OBJPROP_XDISTANCE,someXDistance); and ObjectSet(name,OBJPROP_YDISTANCE,someYDistance); )

 
mladen:
Yes But with labels you have to use ObjectSet() functions to set the X and Y distance (like this ObjectSet(name,OBJPROP_XDISTANCE,someXDistance); and ObjectSet(name,OBJPROP_YDISTANCE,someYDistance); )

Okay so... is this correct?

Files:
untitled2.png  9 kb
untitled.png  12 kb
 
RyuShin:
Okay so... is this correct?

No

You do not use time for labels

Use ObjectSet() for X and Y distance even in the lines after the "else" condition. Label does not use time it uses absolute position on chart, so you use ObjectSet() to set XDISTANCE and YDISTANCE for the two coordinates of the X and Y axes

 
mladen:
No You do not use time for labels Use ObjectSet() for X and Y distance even in the lines after the "else" condition. Label does not use time it uses absolute position on chart, so you use ObjectSet() to set XDISTANCE and YDISTANCE for the two coordinates of the X and Y axes

mladen, I concluded that I shouldn't modify labels. The indicator I was trying to modify was a daily pivot indicator. If I fix labels that are under resistance and support lines, it'll be non sense. Because labels use absolute positions and the indicator shows different support and resistance daily. Anyways, thank you for your help.

 

mladen, I have a weekly and a monthly pivot indicators. Yesterday before the market opened, they worked but after the market opened they stopped working. Pivot/support/resistance lines that the indicators showed disappeared. I have a daily pivot indicator and it still works before/after the market opened. It doesn't make sense to me because they should keep calculating by using weekly/monthly data. What seems to be a problem?

 
RyuShin:
mladen, I have a weekly and a monthly pivot indicators. Yesterday before the market opened, they worked but after the market opened they stopped working. Pivot/support/resistance lines that the indicators showed disappeared. I have a daily pivot indicator and it still works before/after the market opened. It doesn't make sense to me because they should keep calculating by using weekly/monthly data. What seems to be a problem?

Don't know

You have to check in the code what can go wrong in cases like that (without the code I can only make wild guesses)

 
mladen:
Don't know You have to check in the code what can go wrong in cases like that (without the code I can only make wild guesses)

I didn't want to post the code because I didn't want to give you a lot of work or something. Anyways I'll post the code soon. I hope it won't be messy.

 

I tried to post a code but damn it made my post so messy :/

Reason: