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

Draw Tools shortcut

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

    Draw Tools shortcut

    HI,

    I would like to have some tool bar buttons that are a shortcut to draw line segments with each button having a pre-defined style eg. a blue solid line, etc. I have the toolbar items coded already can I tap into the existing method (F2) or do I need to create my draw method from scratch.

    Thanks in advance

    #2
    Hello,

    Are you asking if you can re assign the F2 key to your custom code or are you asking if you can use the existing method F2 calls?

    You could take a look at the code used in the toolbar shortcut indicator here: http://www.ninjatrader.com/support/f...d=6&linkid=530

    This is all unsupported of course but that will give you a direction on how it has been accomplished using a toolbar button.

    As far as setting up styles for the line when called, I am not sure if that would be possible using the above code or if possible at all, it would certainly not be a supported item if you are able to accomplish that.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks I have seen that indicator but it just creates a toolbar for all the drawing tools. I was hoping to just be able to grab the same method call as F2 but be able to predefine the style and color and avoid having to grab the mouse clicks and translate the coordinates to time and price etc. myself.

      So far I am capturing the clicks and creating drawing but the are not persistent if I delete the indicator. Is there a way to make them persist?

      Thanks again

      Comment


        #4
        Hello,

        Thank you for the questions.

        I do not know of a supported way to do what you are trying to do as that is all internal code. The toolbar buttons in the prior link only work because they call a click to the regular button which triggers the internal code.

        If you are creating your own custom drawing that is probably why it will not persist, you would need to draw the actual drawing objects using the same method the toolbar does to have them persist because the objects have scripting attached to them for serialization.

        I don't know of a way that you would be able to accomplish what you are trying but this post will certainly be open to the public in case any forum members have a un supported answer.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks. Yes I was hoping to tap into the internal code rather than having to "reinvent the wheel". How about this, Is there a method I can call to save my lines into the workspace xml and preserve my lines? The internal code seems to do this automatically.

          Thanks in advance

          Comment


            #6
            Hello,

            There is no method for this, serialization is part of NinjaScript and the platform in general and is mainly controlled internally.

            Chart items, Charts, Workspaces these are all internal, the only serialization you would really see in a NinjaScript file would be for your public properties or exposed properties. This is because you need to serialize certain items while some items do not need serialized for templates.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WHICKED, Today, 12:45 PM
            2 responses
            18 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,276 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            4 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X