Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get Object y-value

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

    Get Object y-value

    how do you get the y value or chart anchor position of a drawn object.

    ok I found it.

    PHP Code:
    ChartAnchor Properties
    
    
    
    <ChartAnchor>.BarsAgo
     
    An int representing the "barsAgo" value that was passed to the DrawingTool method
     
    
    <ChartAnchor>.DisplayName
     
    A string representing name of the DrawingTool's chart anchor that is displaying on the UI
     
    
    <ChartAnchor>.DrawingTool
     
    The IDrawingTool object which created the DrawingTool's chart anchor object
     
    
    <ChartAnchor>.DrawnOnBar
     
    An int representing the CurrentBar value that the DrawingTool's chart anchor was drawn
     
    
    <ChartAnchor>.IsNinjaScriptDrawn
     
    A bool indicating the object was drawn programmatically
     
    
    <ChartAnchor>.Price
     
    A double representing the price the  DrawingTool's chart anchor was drawn
     
    
    <ChartAnchor>.SlotIndex
     
    A double representing the DrawingTool's chart anchor index value the anchor was drawn
     
    
    <ChartAnchor>.Time
     
    A DateTime representing the time value the DrawingTool's chart anchor was drawn
     
    
    
    Examples
     
    Text myText;
    protected override void OnBarUpdate()
    {   
       if(CurrentBar == 50)
         myText = Draw.Text(this, "tag", "test", 0, High[0]);     
       
       if(myText != null)
       {           
         Print(myText.Anchor.DrawnOnBar); // drawn on bar 50
       }
       
    } 
    
    Last edited by cutzpr; 09-19-2016, 12:21 PM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by CaptainJack, 05-29-2026, 05:09 AM
0 responses
45 views
0 likes
Last Post CaptainJack  
Started by CaptainJack, 05-29-2026, 12:02 AM
0 responses
30 views
0 likes
Last Post CaptainJack  
Started by charlesugo_1, 05-26-2026, 05:03 PM
0 responses
99 views
0 likes
Last Post charlesugo_1  
Started by DannyP96, 05-18-2026, 02:38 PM
1 response
177 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by CarlTrading, 05-11-2026, 05:56 AM
0 responses
170 views
0 likes
Last Post CarlTrading  
Working...
X