Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to start a custom drawing tool from a button?

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

    #31
    Originally posted by FatCanary View Post

    So how can I start a "custom" Drawing Tool that I have created, from a button?
    FatCanary,

    you can go about it using HotKeys. It's a bit messy for now. Go here https://inputsimulator.codeplex.com/
    Use virtual hotkeys programmatically. Within your Click event you just use the simulator code to do so.
    Asign your new drawing tool to a HotKey. Create a button and click away.

    Comment


      #32
      Hi Sim22

      Many thanks for taking the time to let me know about this solution.

      I shall be giving it a go.

      Comment


        #33
        Hi Sim22

        Not sure if you are in position to help, but that stuff is way over my head.

        Which part of the code do I use?

        Comment


          #34
          I'm assuming I need to reference the InputSimulator dll.

          The dll is in:
          C:\Users\myName\Documents\NinjaTrader 8\bin\Custom.

          I've added this reference via the NinjaScript editor, but I'm getting an assembly reference missing error.
          Last edited by FatCanary; 06-11-2016, 11:09 AM.

          Comment


            #35
            Originally posted by FatCanary View Post
            Hi Sim22

            Not sure if you are in position to help, but that stuff is way over my head.
            LOL. Yep, been in that position.

            You actually have to use "using WindowsInput;" although the DLL is actually called InputSimulator. It isn't my design, so it's initially a bit awkward.

            If you can be patient for a day I will upload a basic (beta) drawing tool toolbar with full examples for you to peruse. It's pretty involved so I'd suggest you wait.

            Comment


              #36
              Of course, yeah, 'using WindowsInput'
              I wouldn't have got that in a million years!

              Happy to wait, your help is much appreciated.

              Comment


                #37
                Originally posted by Sim22 View Post

                you can go about it using HotKeys. It's a bit messy for now. Go here https://inputsimulator.codeplex.com/
                Use virtual hotkeys programmatically. Within your Click event you just use the simulator code to do so.
                Asign your new drawing tool to a HotKey. Create a button and click away.
                Now that I am referencing InputSimulator dll with 'using WindowsInput', your solution works a treat.
                Many, many thanks.

                Still looking forward to the drawing toolbar example though.

                Comment


                  #38
                  I like the warning that the icons are missing because the Sim22ToolBarIcons folder needs to be copied to bin\custom.

                  Great for those of us that do not read instructions

                  If you don't want all the drawing tools in the toolbar you can easily modify strArrayDrawingTools in the NinjaScript editor.
                  Nice
                  Last edited by FatCanary; 06-13-2016, 05:03 AM.

                  Comment


                    #39
                    I decided to add user selection functionality so you can select which icons to show.

                    You must extract it first. Read the instructions (FatCanary!).



                    If you would rather find it in the downloads section and read the write-up then go here
                    Last edited by Sim22; 06-14-2016, 02:18 AM.

                    Comment


                      #40
                      Originally posted by FatCanary View Post
                      I like the warning that the icons are missing because the Sim22ToolBarIcons folder needs to be copied to bin\custom.

                      Great for those of us that do not read instructions
                      LOL. Yep, got to think of everything. Enjoy.

                      Comment


                        #41
                        An additional request would be to add an indicator from another indicator.

                        So, this would include the ability to see if indicator is already on a chart, if not, to be able to add it. Then, be able to change the "visible" parameter from the other indicator if it is there.

                        I know, that seems like asking a lot!

                        EDIT: Is it currently possible to see if an indicator is on a chart (indicator collection?) and if so, change parameters on that indicator? (or simply the "visible" param)
                        Last edited by neoikon; 06-23-2016, 05:11 PM.

                        Comment


                          #42
                          Originally posted by neoikon View Post
                          An additional request would be to add an indicator from another indicator.

                          So, this would include the ability to see if indicator is already on a chart, if not, to be able to add it. Then, be able to change the "visible" parameter from the other indicator if it is there.

                          I know, that seems like asking a lot!

                          EDIT: Is it currently possible to see if an indicator is on a chart (indicator collection?) and if so, change parameters on that indicator? (or simply the "visible" param)
                          I can't remember which thread I downloaded this from but this Addon shows the current indicators within the collection of indicators and enables you to adjust the period. I also modified it a while back (excuse any beginner's mistakes) to click something visible/not visible. After importing you will see the entries under your 'New' header on your NT8 menu. Hope this gives you some ideas.
                          Attached Files

                          Comment


                            #43
                            Hello neoikon

                            Thank you for your additional comments and suggestions.

                            And thank you to Sim22 for providing an example of pulling the indicators.

                            Comment


                              #44
                              Originally posted by Sim22 View Post
                              Hope this gives you some ideas.
                              Thanks for the script! I will take a deeper look into this. I was originally going down the path of making an Indicator, but perhaps I should look at it being an AddOn.

                              However, there are no parameters to modify with an AddOn correct?

                              EDIT: I'm not sure why, but importing that broke other AddOns I currently have (and removing them made them work again).

                              It breaks these calls and I don't know why... (saying can't convert them)

                              PHP Code:
                              Chart chart = window as Chart;
                              Chart chart = Window.GetWindow(window) as Chart; 
                              
                              EDIT 2: I think it's because one of these new AddOns include this:
                              PHP Code:
                              public class Chart { ... } 
                              
                              Renaming this to "myChart" (or something else) seemed to make the compiler happy.
                              Last edited by neoikon; 06-24-2016, 09:46 AM.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              656 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              371 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              579 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X