Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawRay

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

    DrawRay

    If I have drawn a DrawRay() line, is it possible to check if the GetCurrentAsk() has crossed that line?

    Or is there any other way to check if the price crosses a trend line?

    Thank you.

    #2
    Hi nigeleyre, unfortunately there isn't a NinjaScript method that would accomplish this.

    A way to do this would be to create a slope and intercept from the ray's data (y = mx + b) and checking the value every bar and then comparing that value to GetCurrentAsk().
    AustinNinjaTrader Customer Service

    Comment


      #3
      Thank you, do you have any sample code for this, I'm not quite sure what you mean by (y = mx + b)? It would be most helpfull if you do?

      Many thanks,

      NIgel.

      Comment


        #4
        nigel,

        To clarify, Austin is saying the only way you can check against the Ray is if you actually did your own calculations to know where the Ray's value is at each point because you can't access the values of it from code. The only way for you to know the values is if you calculated it by hand through the equation for a line.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        57 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        276 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X