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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    43 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    21 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    30 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Working...
    X