fxDreema

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

    How to test if Candle’s open/close straddles a horizontal Trend Line.

    Questions & Answers
    2
    3
    622
    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.
    • S
      Smallous last edited by

      Hello,

      Upon certain conditions my EA draws horizontal Trend Lines (left to right) on my chart, which are given Object Names “Buy Line” & “Sell Line”.

      There can be many horizontal Trend Lines drawn in a typical day.

      1. I need to be able to test for if a Candle Opens below, then closes above the same “Buy Line”.

      2. I need to be able to test for if a Candle Opens above, then closes below the same “Sell Line”.

      I cannot work out how to refer to the “Buy Line” or “Sell Line” objects and its accompanying Price value in a Condition block.

      Regards

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

        Go here https://fxdreema.com/examples/ and find those examples whose names start with "Get chart object's attribute...".

        Note that you can only have 1 object with name "Buy line", because what makes objects unique is their name, they are indexed by their name.

        1 Reply Last reply Reply Quote 0
        • S
          Smallous last edited by

          Hello,

          Thanks very much. I think I got the hang of it. The example code below seems to be working.

          Trendlines.jpg

          ......
          Trendlines.jpg

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

          Online Users

          G
          F
          J
          D
          M
          R

          15
          Online

          146.7k
          Users

          22.4k
          Topics

          122.6k
          Posts

          Powered by NodeBB Forums | Contributors