Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 lcgamarra_pinnacle, Today, 09:33 AM
        0 responses
        6 views
        0 likes
        Last Post lcgamarra_pinnacle  
        Started by MokhtarVerdi, Today, 07:21 AM
        1 response
        8 views
        0 likes
        Last Post MokhtarVerdi  
        Started by chartchart, 05-19-2021, 04:14 PM
        6 responses
        659 views
        1 like
        Last Post mmenigma  
        Started by gabberdim, Yesterday, 09:14 AM
        4 responses
        31 views
        0 likes
        Last Post sidlercom80  
        Started by cmtjoancolmenero, Today, 07:22 AM
        0 responses
        7 views
        0 likes
        Last Post cmtjoancolmenero  
        Working...
        X