fxDreema

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

    Get values from Trendlines on a Chart

    Questions & Answers
    2
    9
    3428
    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.
    • E
      ezzakt last edited by

      Hi,

      I am using a custom indicator drawing a trend channel on the chart. The indicator has no buffers. So I would like to get values from the trendlines where I have the object name of.

      The indicator is attached. It draws 3 lines.
      An upper one, middle one and a low one...

      I am aware that there are other indicators like that using buffers, but I came across this problem for me several times, where I had the need to get values from lines on the chart or arrows. Would be great to get an example from you on how to use the lines from the indicator attached to generate buys/sells.

      Cheers
      Andy

      ......
      #AutoTrendChannel.mq4

      1 Reply Last reply Reply Quote 0
      • E
        ezzakt last edited by

        btw. Obj names are

        "LowLine" color used "Red"
        "MidLine" color used "White"
        "UppLine" color used "SkyBlue"

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

          If object names are not changing over time, you can see what's in "Condition -> Chart object attributes", and pick "Trendline...." from "Property".

          Objects are identified by name in, so if you want to pick some object for other attributes like type, color, or other attributes, things goes a little bit complex, because you have to create a loop (cycle) for the available objects and ask each one of them for it's attributes. If you have many objects on the chart, this can eat some resources. In any case, there is a group of blocks (orange color, just below the big group of blocks with pink color) to create a loop for objects and with combination with "Condition" you can do some things. But again, if you know the name of the object - use it's name to select it.

          1 Reply Last reply Reply Quote 0
          • E
            ezzakt last edited by

            ok, I seem to get some values here. One thing is not clear for me.

            Lets say I choose object by name, and enter the name of the trendline.
            What does "Property" now exactly mean ? If I choose trendline, I get the values, if I choose "color" I do not get values.

            I dont get the logic for what property means here. Can you clarify please ?

            1 Reply Last reply Reply Quote 0
            • E
              ezzakt last edited by

              or e.g. what happens if I choose the trendline name and select property "Price Level 1" or something else...thats just my missing part

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

                There is a big list of object properties: http://docs.mql4.com/constants/objects/properties

                There are many types of objects - arrows, trendlines, fibonacci - and each of them has some of these properties. Some objects, like arrows, have only one price. Others have 2 or 3 price coordinates - trendlines, rectangles.

                Some properties are numeric, others are represented by numbers, like COLOR for example - each color has it's own number. Well, I was still not included colors in Condition block, but they are represented with system constants that you can write directly in "Numeric (value)". So, the red color is "Red", blue is "Blue", and this is the whole list of available colors: http://docs.mql4.com/constants/colors

                In MT5 there are even more objects, predefined constants and properties.

                1 Reply Last reply Reply Quote 0
                • E
                  ezzakt last edited by

                  ok I think I get it. Did some successful tests on trend channel indicators

                  As I keep experimenting with different indicators, I now have a new issue. Attached is an indicator having 3 buffers and in general changing color from "DeepSkyBlue" to "PaleVioletRed"

                  I exported buffer values to an excel file. I could possibly work with the buffer values, but the indicator logic in this case looks strange to me. Not sure how it uses that buffers for the trend change.

                  I simply like to open a buy if color is "DeepSkyblue" and close it if it changes to "PurpleVioletRed" and add a sell order.

                  what would I have to do to grab the color and color changes directly from the charts ? As its no objects in this case...

                  Thanks for any help

                  ......
                  averages - mtf & alerts.mq4

                  1 Reply Last reply Reply Quote 0
                  • E
                    ezzakt last edited by

                    Great, I got it to work with the buffers...still would be interesting how to achieve it without them and instead using the colors

                    cheers
                    Andy

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

                      The normal way is to use buffers of course, not the objects. There is a block with name like "Levels tester..." that can show visually how any buffer behave.

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

                      Online Users

                      E
                      F
                      E
                      G
                      M
                      C
                      E
                      L
                      K
                      E
                      S
                      E
                      P
                      G
                      R
                      N

                      55
                      Online

                      146.7k
                      Users

                      22.4k
                      Topics

                      122.6k
                      Posts

                      Powered by NodeBB Forums | Contributors