Find Obj_Text, get OBJPROP_ANCHOR for EA

 

Hello everyone. I'm trying to get the Object Text, specifically the Anchor text from a custom indicator to use it as an input signal. I'm having some errors and I can't fix them. Could someone help me?

Files:
 
Tiofelo Teles: Hello everyone. I'm trying to get the Object Text, specifically the Anchor text from a custom indicator to use it as an input signal. I'm having some errors and I can't fix them. Could someone help me?
  1. If you are obtaining the object name with "ObjectName()" then there is no need to find it again with ObjectFind() since it is already "found"!
  2. The property "OBJPROP_ANCHOR" is of an enumeration type and not a string. You should use ObjectGetInteger() to get its value. Please refer to the documentation:
    "OBJPROP_ANCHOR – defines the anchor point in object itself and can be one of the 9 values of the ENUM_ANCHOR_POINT enumeration. Coordinates in pixels are specified from this very point to selected chart corner"
  3. What specifically do you mean by "Anchor Text", because that concept does not really make sense. There are Anchor Points, but not anchor text. Text Objects however, do have a Description field that can be obtained with the OBJPROP_TEXT property. Is that what you are looking for?
  4. Since you have not provided information about the original graphic objects being scanned, nor the Indicator code producing them, we cannot offer much more help that the very basic of things.
 
Fernando Carreiro:
  1. If you are obtaining the object name with "ObjectName()" then there is no need to find it again with ObjectFind() since it is already "found"!
  2. The property "OBJPROP_ANCHOR" is of an enumeration type and not a string. You should use ObjectGetInteger() to get its value. Please refer to the documentation:
    "OBJPROP_ANCHOR – defines the anchor point in object itself and can be one of the 9 values of the ENUM_ANCHOR_POINT enumeration. Coordinates in pixels are specified from this very point to selected chart corner"
  3. What specifically do you mean by "Anchor Text", because that concept does not really make sense. There are Anchor Points, but not anchor text. Text Objects however, do have a Description field that can be obtained with the OBJPROP_TEXT property. Is that what you are looking for?
  4. Since you have not provided information about the original graphic objects being scanned, nor the Indicator code producing them, we cannot offer much more help that the very basic of things.

Many thanks for the reply! Ohhh, I was making a mistake, "OBJPROP_ANCHOR" is not text but a number !!! Now everything is clear. Thanks

 

I believe that there is a condition to detect the "New bar" and in this to detect the objects. Could anyone help me with books or articles that talk about detecting new bar? I thank.

 

Dear programmers and "Gurus" my EA has already given a sign of life !!! He opens up buying and selling positions though not exactly at the time that I would like him to open. I can detect the new candle and the previous candle. What function should I use to make the EA search for objects in one of these candles?

 
Tiofelo Teles: I believe that there is a condition to detect the "New bar" and in this to detect the objects. Could anyone help me with books or articles that talk about detecting new bar?
Tiofelo Teles: I can detect the new candle and the previous candle.
  1. Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.

  2. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
              New candle - MQL4 programming forum #3 2014.04.04

    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              Running EA once at the start of each bar - MQL4 programming forum 2011.05.06

 
William Roeder:
  1. Don't Hijack other threads for your off-topic post. Next time, make your own, new, thread.

  2. For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
              New candle - MQL4 programming forum #3 2014.04.04

    I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
              Running EA once at the start of each bar - MQL4 programming forum 2011.05.06

@William Roede, some times you can be somewhat short sighted! He did not hijack it. It IS HIS own thread! It is NOT off topic. He is just continuing it from where he left off last time!

@Tiofelo Teles, please disregard point 1 of William's message!
 
Tiofelo Teles: Dear programmers and "Gurus" my EA has already given a sign of life !!! He opens up buying and selling positions though not exactly at the time that I would like him to open. I can detect the new candle and the previous candle. What function should I use to make the EA search for objects in one of these candles?

You would have to loop through all graphic objects on the chart and check their time coordinates and see if they match the time of the candle in question.

You can get the time coordinate for an object with the ObjectGetInteger() function and the OBJPROP_TIME property.

 
Fernando Carreiro:

You would have to loop through all graphic objects on the chart and check their time coordinates and see if they match the time of the candle in question.

You can get the time coordinate for an object with the ObjectGetInteger() function and the OBJPROP_TIME property.

EA made sussefuly