fxDreema

    • Register
    • Login
    • Search
    • Back to the main page
    • Categories
    • Recent
    • Tags
    • Popular
    • Search

    Problem With Read Object Description

    Questions & Answers
    3
    3
    1814
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mashna1364 last edited by mashna1364

      hi, i have a currency power indicator but it isnt any buffer , i want read currency power number from indicator objects but EA not working . what is problem?
      any such thing is possible?

      0_1549722965676_1.JPG

      i want read gold color number . this object have name and description.

      0_1549723039970_2.JPG

      i write this EA .

      0_1549723071579_3.JPG

      i tested this value text but not working...

      0_1549723283088_4.JPG

      0_1549723507617_5.JPG

      1 Reply Last reply Reply Quote 0
      • fxDreema
        fxDreema last edited by fxDreema

        First make sure that you can really get the value, let's say in Comment block. If yes, then maybe the problem is that it is a string value, it is a text, which also contains "." and this probably makes it impossible to compare it with a numeric value. Comparing it with another text will not work for sure. But since there is no direct way to convert it to numeric, I will suggest plain MQL4 code. Something like this:

        0_1550001715645_5e84dbae-b6ef-4bee-a02c-41149ccc7e78-image.png

        I used these functions:
        https://www.mql5.com/en/docs/objects/objectgetstring
        https://www.mql5.com/en/docs/convert/stringtodouble

        This is the code:

        StringToDouble(ObjectGetString(0, "object_name", OBJPROP_TEXT)) > 5.0
        

        This is obviously the second Condition block, but the normal one can also be used.

        I didn't checked the code! I only assume that it will work, but I could be wrong.

        1 Reply Last reply Reply Quote 0
        • nguyenkien
          nguyenkien last edited by

          select atttribute set 1 (numberic)

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post

          Online Users

          A
          C
          A
          X
          J

          13
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors