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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    89 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    135 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    69 views
    0 likes
    Last Post PaulMohn  
    Working...
    X