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

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 llanqui, Today, 08:32 AM
        1 response
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by lollers, Yesterday, 03:26 AM
        1 response
        53 views
        0 likes
        Last Post lollers
        by lollers
         
        Started by Salahinho99, 05-05-2024, 04:13 AM
        7 responses
        62 views
        0 likes
        Last Post Salahinho99  
        Started by knighty6508, 05-10-2024, 01:20 AM
        4 responses
        30 views
        0 likes
        Last Post knighty6508  
        Started by OllieFeraher, 05-09-2024, 11:14 AM
        6 responses
        19 views
        0 likes
        Last Post OllieFeraher  
        Working...
        X