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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        35 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        20 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        12 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        18 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        20 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X