Announcement

Collapse
No announcement yet.

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 Lloyd143, Today, 05:24 PM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by Hagar, Today, 04:38 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by [email protected], Today, 04:49 PM
            0 responses
            10 views
            0 likes
            Last Post bpatel20@gmail.com  
            Started by forrestang, Today, 02:05 PM
            3 responses
            22 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by harryodell55, Today, 01:30 PM
            3 responses
            26 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X