Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible read the 'Default' template asscosiated to a drawing object?

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

    Is it possible read the 'Default' template asscosiated to a drawing object?

    Hi support or anybody that can help,

    I'd like to read the Default attributes/properties of a user drawn object with Ninjascript but so far i have not been successful.

    Any idea how i can proceed to find a solution?

    Thanks

    #2
    Hello trendisyourfriend,

    The drawing objects will be in the DrawObjects collection and will need to be casted to the object type.


    The properties will be listed for the casted object type in the help guide. For example, below is a link to the properties of Line objects.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks,

      I found this solution for a line object as an example.

      Within the OnBarUpdate i create a dummy line once with the Default template and record its Stroke and then immediatly delete the object. So from then onward, i can set any other line to the default settings for the line object.

      Class wide variable:
      NinjaTrader.Gui.Stroke defaultLineStroke;

      Code:
      if (CurrentBar == BarsRequiredToTrade) {
      NinjaTrader.NinjaScript.DrawingTools.Line myLine = Draw.Line(this, "tag1", false, 2, Close[0], 1, Close[0], "Default");
      defaultLineStroke = myLine.Stroke;
      if ( DrawObjects["tag1"] as DrawingTools.Line != null )
      RemoveDrawObject("tag1");
      }

      Comment

      Latest Posts

      Collapse

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