fxDreema

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

    Indicator code mod help

    Questions & Answers
    2
    6
    1374
    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.
    • P
      Processman last edited by

      Hello
      How can I change "comment" to "object" in code(last line) ? Then EA can read value(Channel size) ... Any ideas?

        ObjectCreate("MIDL", OBJ_TREND, 0, T2, (P2 + PP + Step*AB) / 2, T1, (P1 + PP) / 2);
      ObjectSet("MIDL", OBJPROP_COLOR, Lime); 
      ObjectSet("MIDL", OBJPROP_WIDTH, 1); 
      ObjectSet("MIDL", OBJPROP_STYLE, STYLE_DOT);
      Comment(" Channel size = ", DoubleToStr(MathAbs(PP - P1) / Point, 0), " Slope = ", 
               DoubleToStr(-Step / Point, 2));
      

      channel.jpg

      ......
      channel.jpg

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

        Comment() prints information in the upper left angle, but it doesn't have any options to make it look different. I don't recognize this code, you are probably trying to learn MQL4 or something. You can look at the documentation for ObjectCreate() - this function can draw many types of objects, including OBJ_LABEL - https://www.mql5.com/en/docs/constants/ ... /obj_label

        Or, if you work with fxDreema, there is a block "Comment" that print the information using labels.

        1 Reply Last reply Reply Quote 0
        • P
          Processman last edited by

          Well ,i need check "Channel size" value to this indicator. I do not want to open a trade if the value is less than 150(example) ,
          flat channel. But value is "comment" , and fxdreema cant compare this ? ... Well , I'll be fine without this 😉

          https://www.mql5.com/en/code/9902

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

            Comment is just a function in MQL4/MQL5 to print some info on the chart. I don't even know if this text can be read from the chart, but it would be stupid anyway.

            There is a way to work with indicators, and this way is by reading their buffers. Here is more:
            https://fxdreema.com/help/-/you%20shoul ... indicators
            https://fxdreema.com/help/-/working%20w ... indicators

            Your indicator has only 1 buffer and it's name in the code is ExtMapBuffer1. It gives you information about this thisng iprice, whatever it is. But the indicator is pretty simple, so I guess you can add another buffers to output more information.

            1 Reply Last reply Reply Quote 0
            • P
              Processman last edited by

              OK , but this indicator has only one buffer. But i can read lines object value(by name) and compare.
              as you see in the picture(Channel)
              USDJPYM15.jpg

              ......
              USDJPYM15.jpg

              1 Reply Last reply Reply Quote 0
              • P
                Processman last edited by

                OK , I found the modified version which contains 3 buffer.
                So no longer need to bother with this question , thanks anyway.

                
                            //channel distance of last/current bar
                            ExtMapBuffer2[0]=NormalizeDouble(MathAbs(PP - P1)/Point,0);
                            //angle of channel
                            ExtMapBuffer3[0]=NormalizeDouble(-Step/Point, 2);
                
                
                1 Reply Last reply Reply Quote 0
                • 1 / 1
                • First post
                  Last post

                Online Users

                M
                G
                D
                A
                A
                R

                16
                Online

                146.7k
                Users

                22.4k
                Topics

                122.6k
                Posts

                Powered by NodeBB Forums | Contributors