Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ray vs IRay

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

    Ray vs IRay

    I am trying to convert a NT7 inidcator to NT8 and I ran into these lines of code:

    IRay downTrendRay = (IRay) DrawObjects["DownTrendRay"];
    startBarPrice = downTrendRay.Anchor1Y;
    endBarPrice = downTrendRay.Anchor2Y;;
    downTrendStartBarsAgo = downTrendRay.Anchor1BarsAgo;
    downTrendEndBarsAgo = downTrendRay.Anchor2BarsAgo;


    How do I get the anchor values from Ray in NT8?

    #2
    Hello chartish,

    Thanks for your post.

    NinjaTrader 8 Ray anchor values can be retrieved using the StartAnchor and EndAnchor properties of the Ray object.

    For example:
    Code:
    Ray myRay = Draw.Ray(this, "tag1", 10, 1000, 0, 1001, Brushes.LimeGreen);
    	Print(myRay.StartAnchor.Price);
    I'll provide documentation links for Ray's and the IDrawingTool interface which also explains how ChartAnchors can be used. Also helpful while converting NT7 indicators would be to reference the Code Breaking changes page of the Help Guide which provides a quick reference for NinjaTrader 7 items that have changed in NinjaTrader 8.

    Ray - https://ninjatrader.com/support/help.../en-us/ray.htm

    IDrawingTool - https://ninjatrader.com/support/help...rawingtool.htm

    Code Breaking changes - https://ninjatrader.com/support/help...ng_changes.htm

    If you have any additional questions, please don't hesitate to ask.

    Comment


      #3
      Thank, that did the trick.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      646 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      367 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 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