Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Syntax Translation

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

    #16
    Hello Chelsea,

    when a condition is true then we want to draw a ray. This works of course. Name of Ray is eg "RayX" + CurrentBar.
    We can not give names Ray1, Ray2... because they are also plotted historically and we dont know if 5 rays, 15 rays, 50 rays
    so when condition is true then plot the ray and add the value to a list.
    When price comes back to the ray (maybe this day, in 3 days, in 5 days or whenever) then remove the ray (and remove value in list)
    Thats it.

    Thank you!
    Tony

    Comment


      #17
      Hello Tony,

      Triggering the action when the price touches the ray and working with multiple rays is going to take some fancy logic.

      You would need to project the price on future bars for each ray based on the slope of the anchors. In that logic, if the drawing objects are in a list you would be checking the slope of each item in that list. This means in that logic that is checking to see if each ray was touched you would have the index of that ray. If the ray is touched call RemoveDrawObject with that objects tag.

      Attached is the simple example from earlier modified to add the object to a list and remove it using the list elements index for the Ray to call the .Tag on this and remove the object.
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hello Chelsea,

        thank you for your reply and the example. I dont understand from this example how to check in the custom logic the price of the ray.

        if(High[0]>????) Remove the Ray.

        Thank you!
        Tony

        Comment


          #19
          Hello Tony,

          This you will have to come up with yourself.

          Below is a link to post I think is similar.
          Chelsea B.NinjaTrader Customer Service

          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