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

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 Kaledus, Today, 01:29 PM
          0 responses
          3 views
          0 likes
          Last Post Kaledus
          by Kaledus
           
          Started by PaulMohn, Today, 12:36 PM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by yertle, Yesterday, 08:38 AM
          8 responses
          36 views
          0 likes
          Last Post ryjoga
          by ryjoga
           
          Started by rdtdale, Today, 01:02 PM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by alifarahani, Today, 09:40 AM
          3 responses
          18 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X