Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DrawRay() and the *next* bar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DrawRay() and the *next* bar

    Let's say I use DrawRay() to draw a ray from Open[2] to Open[1]. Is there a way to tell when the CurrentBar closes if Open[0] is above or below the extended ray? I guess I would need to know the price where the ray would intersect each future bar.

    Thanks!
    Bryan
    cassb
    NinjaTrader Ecosystem Vendor - Logical Forex

    #2
    Yes, this is possible with some advanced programming. For an example, look at the code in the Automatic Trend Line indicator at this link:
    DenNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ben View Post
      Yes, this is possible with some advanced programming. For an example, look at the code in the Automatic Trend Line indicator at this link:
      http://www.ninjatrader-support.com/v...ks.php?catid=1
      Well that's funny, because that's the code that I was modifying! :-)

      Ok, so where in that code is it determining what the value of the extended ray is -- when it's finding out whether the trendline has been crossed?
      cassb
      NinjaTrader Ecosystem Vendor - Logical Forex

      Comment


        #4
        In the code there are comments, something like "Check for trend line break" etc...This is from memory. You will have to rip through the code to understand what is happening. In a nutshell, it grabs the xy values of the start and end point of the trend line and calculates the slope (change per bar) and then add this to each subsequent bar to determine the line value which then can be checked against the close price etc...
        RayNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Ray View Post
          In the code there are comments, something like "Check for trend line break" etc...This is from memory. You will have to rip through the code to understand what is happening. In a nutshell, it grabs the xy values of the start and end point of the trend line and calculates the slope (change per bar) and then add this to each subsequent bar to determine the line value which then can be checked against the close price etc...
          Yes, thank you, that's what I thought too. Now where are those old geometry books... ;-)

          Bryan
          cassb
          NinjaTrader Ecosystem Vendor - Logical Forex

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by mmenigma, Today, 02:22 PM
          1 response
          3 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by frankthearm, Today, 09:08 AM
          9 responses
          35 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by NRITV, Today, 01:15 PM
          2 responses
          9 views
          0 likes
          Last Post NRITV
          by NRITV
           
          Started by maybeimnotrader, Yesterday, 05:46 PM
          5 responses
          26 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by quantismo, Yesterday, 05:13 PM
          2 responses
          21 views
          0 likes
          Last Post quantismo  
          Working...
          X