Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can I load a Drawing Tool Template from source code?

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

    How can I load a Drawing Tool Template from source code?

    Morning.

    I need to load from source code a drawing tool template and apply to the element, is there any example about it?

    Thanks.

    #2
    Hello franjcy,

    Thank you for your post.

    First, ensure you have a template saved for the drawing tool. You can do this manually in NinjaTrader by configuring a drawing tool and saving its properties as a template.
    • TemplateName Property: The TemplateName property is used to specify the name of the drawing tool template you want to apply.
    • Draw Methods: Use the Draw methods to add drawing tools like Draw.Ray, Draw.Text, etc., and set the TemplateName property to apply the saved template.
    For example, if you were using Draw.Dot():

    Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime time, double y, bool isGlobal, string templateName)
    Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, int barsAgo, double y, bool isGlobal, string templateName)
    ​​
    Please let us know if you have any further questions.

    Comment


      #3
      Originally posted by NinjaTrader_Gaby View Post
      Hello franjcy,

      Thank you for your post.

      First, ensure you have a template saved for the drawing tool. You can do this manually in NinjaTrader by configuring a drawing tool and saving its properties as a template.
      • TemplateName Property: The TemplateName property is used to specify the name of the drawing tool template you want to apply.
      • Draw Methods: Use the Draw methods to add drawing tools like Draw.Ray, Draw.Text, etc., and set the TemplateName property to apply the saved template.
      For example, if you were using Draw.Dot():

      Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime time, double y, bool isGlobal, string templateName)
      Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, int barsAgo, double y, bool isGlobal, string templateName)
      ​​
      Please let us know if you have any further questions.

      Thanks for the answer. I understand your solution, but in my case I don't use Ninjascript native methods, I actually use RenderTarget.DrawLine(..) [SharpDx]. Is there any something like that on SharpDx ?

      Comment


        #4
        Hello franjcy,

        Unfortunately no, there is no equivalent for SharpDX since these are not drawing methods/tools. Only built-in NinjaScript drawing methods have the ability to load from a saved template. Drawing templates would not work on SharpDX methods since these are specific to NinjaScript.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        606 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        351 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X