Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ray anchors - What am I missing

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

    Ray anchors - What am I missing

    Hi,

    I want to detect touches/breaks of a ray line. I thought I could do that with some clever math, but fell at the first hurdle. I can't seem to figure out how to get the Ray anchors. This seems possible from the docs https://ninjatrader.com/support/help...rawingtool.htm

    But, if I try this

    Ray myRay = Draw.Ray(this,"ray1",0,l,i,Low[i],Brushes.White);

    myRay.Anchor does not exist.

    I'm sure I'm doing something silly, but such a simple example and can't figure out what!

    Any clues?

    Thanks.

    #2
    Hello pjsmith,

    Thank you for the post.

    In this case, because the tool has more than one anchor, you would need to specify which anchor you want or loop over the collection of anchors. Here is an example:

    Code:
    if (CurrentBar < 20) return;
    
    Ray myRay = Draw.Ray(this, "ray1", 20, Low[20], 0, Low[0], Brushes.White);
    
    Print(myRay.StartAnchor.Price);
    Print(myRay.EndAnchor.Price);
    // or
    foreach (var chartAnchor in myRay.Anchors)
    {
    	Print(chartAnchor.Price);
    }
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by FrazMann, Today, 11:21 AM
    0 responses
    1 view
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    51 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    10 responses
    36 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by DayTradingDEMON, Today, 09:28 AM
    4 responses
    24 views
    0 likes
    Last Post DayTradingDEMON  
    Started by George21, Today, 10:07 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X