Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get current price value of Ray object

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

    Get current price value of Ray object

    Hello guys,

    I need to get the y value (price) of a ray that I draw using the Draw.Ray() function. I would like to know how I could access the value of the projection of that line on the current bar.
    For example I used as the first anchor 120 bars ago, for the second anchor 60 bars ago. BUT, I would like to know the value of the line on the current bar.

    Thank you!

    #2
    Hello facuevasm,

    Thanks for your post.

    We apologize for not responding sooner, it seems the system didn't provide notification of your post.

    I've attached an example of how you can calculate the ray on a per bar basis. The example will draw a ray and then calculate the run rate and apply that to the bar position and draw a dot over the line, bar by bar, to provide visual feedback.

    YAxisProjectionOfLine.zip

    A colleague just reminded me that you can also look at the indicator "TrendLines" as another example of calculating slope.
    Attached Files
    Last edited by NinjaTrader_PaulH; 11-30-2021, 03:15 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X