Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawobjects

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

    Drawobjects

    Hi

    I am trying to control the properties of a manual drawn line and I was able to get almost all information but the start bar, end bar, and both start price and end prices i wasnt. Is there any example that can help me to know how to do it?

    Thanks

    #2
    Hello Sangui,

    Thanks for opening the thread.

    It is possible to loop through all Drawing objects to find a certain drawing object to get its Start Bar, End Bar, Start Price and End Price from the Anchors collection, but keep in mind that these are read-only properties and you will not be able to modify them.

    From the help guide section on the DrawObjects collection, there is a loop that demonstrates how you can find various information from manually drawn draw objects. You may consider the following:
    Code:
     // Loops through the DrawObjects collection
    foreach (DrawingTool draw in DrawObjects)
    {
    	// Finds line objects that are attached globally to all charts of the same instrument
    	if (draw is DrawingTools.Line)
    	{
    	    DrawingTools.Line thisLine = draw as DrawingTools.Line;
    	    Print("StartBar: " + thisLine.StartAnchor.SlotIndex + " EndBar: " + thisLine.EndAnchor.SlotIndex + " StartPrice: " + thisLine.StartAnchor.Price + " EndPrice: " + thisLine.EndAnchor.Price);
    	}
    }
    https://ninjatrader.com/support/help...s/?drawing.htm

    Please let me know if I may be of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    155 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    307 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    345 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X