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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      94 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      140 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      74 views
      0 likes
      Last Post PaulMohn  
      Working...
      X