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.
    Gaby V.NinjaTrader Customer Service

    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.
        Gaby V.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Chuso, 01-14-2025, 03:41 AM
        4 responses
        22 views
        0 likes
        Last Post Chuso
        by Chuso
         
        Started by steinberg123, 01-09-2025, 05:48 AM
        3 responses
        40 views
        0 likes
        Last Post steinberg123  
        Started by Mindset, 01-14-2025, 05:33 AM
        2 responses
        12 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by steinberg123, Today, 02:43 AM
        0 responses
        6 views
        0 likes
        Last Post steinberg123  
        Started by r68cervera, Today, 02:22 AM
        0 responses
        7 views
        0 likes
        Last Post r68cervera  
        Working...
        X