how to write text under or up candle

faustf
373
faustf  

hi guys i try to write text  under or up a candel i  try with this code but write in left up corner o_O

      ObjectCreate("Demade", OBJ_LABEL, 0, Time[0], (Low[0])); 
      ObjectSetString(0,"Demade",OBJPROP_TEXT,"GAOGA");
      ObjectSetString(0,"Demade",OBJPROP_FONT,"Arial");
      ObjectSetInteger(0,"Demade",OBJPROP_FONTSIZE,10);
      ObjectSetDouble(0,"Demade",OBJPROP_ANGLE,0.0);
      ObjectSetInteger(0,"Demade", OBJPROP_COLOR,Yellow);

anyone can help me ?  thankz at all

William Roeder
23417
William Roeder  

Perhaps you should read the manual. OBJ_TEXT
    How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
          RTFM and STFW: How To Tell You've Seriously Screwed Up.

Levente Csibi
150
Levente Csibi  

William, you are not being helpful at all by systematically downgrading and bullying every single commenter in this forum. If you want to help, do so without arrogance and aggression. People come here to get help in their programming, not to read hateful messages directed towards them without any help. 

Unfortunately, MQL4/MQL5 is not a very well-documented programming language, even the existing documentations are - even though thorough and all-encompassing - very tough for an absolute beginner to handle. The lack of practice examples and systematic structure make it a real challenge for someone without much (if any) programming background to pick it up. That's why such forums are more needed than anything else, provided that fellow forum members are decent and benevolent enough to help those in need, instead of slapping them on the face. 

Having said that and moving on to the question of @faustf: You did almost everything correctly and I'm not surprised that you got confused here, it took me quite some time to understand the difference between OBJ_LABEL (which you used) and OBJ_TEXT (which you should have used) as well. OBJ_LABEL is an object that has a preset location on the screen, it is always fixed to the screen itself. That's not what you need, you want your object to be set not to the screen, but to the price. This is why you'll need to use OBJ_TEXT that makes this possible. If you make this change, it's immediately in the right position and you can continue tinkering with the additional settings that I see you have started already (shifting the location upward/downward, setting the angle, etc.).

   ObjectCreate("Demade", OBJ_TEXT, 0, Time[0], Low[0]); 
   ObjectSetString(0,"Demade",OBJPROP_TEXT,"GAOGA");
   ObjectSetString(0,"Demade",OBJPROP_FONT,"Arial");
   ObjectSetInteger(0,"Demade",OBJPROP_FONTSIZE,10);
   ObjectSetDouble(0,"Demade",OBJPROP_ANGLE,0.0);
   ObjectSetInteger(0,"Demade", OBJPROP_COLOR,Yellow);
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types
Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types
  • www.mql5.com
When a graphical object is created using the ObjectCreate() function, it's necessary to specify the type of object being created, which can be one of the values of the ENUM_OBJECT enumeration. Further specifications of object properties are possible using functions for working with graphical objects.
Keith Watford
Moderator
26007
Keith Watford  
Levente Csibi:

William, you are not being helpful at all by systematically downgrading and bullying every single commenter in this forum. If you want to help, do so without arrogance and aggression. People come here to get help in their programming, not to read hateful messages directed towards them without any help. 

William is direct and to the point.

You are totally wrong to say that he is not helpful at all.

He gave all the help that should be necessary with a few words.

William Roeder:

Perhaps you should read the manual. OBJ_TEXT

Many of us believe that it is better to point somebody in the right direction than to just give them the complete answer. That way they are forced to learn something.

Your answer means that they will probably continue to make the same mistakes over and over again because you have removed the necessity for them to think..

Levente Csibi
150
Levente Csibi  
Keith Watford:

Many of us believe that it is better to point somebody in the right direction than to just give them the complete answer. That way they are forced to learn something.

I totally agree on that. We need to encourage newbies to learn on their own by pointing them in the right direction. But this mustn't involve downgrading the other. I am active on a number of programming forums and have been programming myself for over 5 years in other languages, and this forum is the only one where this kind of aggressiveness is thoroughly present. I believe an answer like "Check out the difference between OBJ_TEXT and OBJ_LABEL." points them to the right direction without the additional implied aggression in phrases like "Perhaps you should read..." and "How to tell you've seriously screwed up"...

Keith Watford:

Your answer means that they will probably continue to make the same mistakes over and over again because you have removed the necessity for them to think..

I honestly disagree. My answer not only directs them to the problem but explains to them that one tiny piece of information that they should look out for in the future when dealing with TEXT and LABEL objects. Again, as it is commonplace on other programming forums... 

William Roeder
23417
William Roeder  
Levente Csibi:… not being helpful at all by systematically… I'm not surprised that you got confused here, … (which you should have used) a
  1. Snowflake, steams at the slightest heat. I do not downgrade "every single commenter." But if you ask questions you should already know the answer to, you are wasting everyone's time and deserve a rebuke. Did you bother to read the links provided?
  2. The languages are documented very well. They just assume that you already know how to code. This isn't high school. You want to make money trading, grow up and learn.
  3. I posted no code. I did not get confused. I did not use OBJ_LABEL. I did not refer to them. You are confused.
faustf
373
faustf  

wo wowowowwwoo relax man

i appreciate a @Levanate Cisibi  help , because i had  just  read   manual. OBJ_TEXT but   I hadn't picked up the smudge  OBJ_LABEL  vs  . OBJ_TEXT  and example  inside is not very basical , but  i  appreciate also  @William Roeder help , but this time  , i was from manual.