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

Add mouse-over and click functionality? Handling windows events in indicator?

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

    Add mouse-over and click functionality? Handling windows events in indicator?

    I doubt this is supported but I'm hoping that someone out there will know how you do this:

    I coded an S/R indicator but sometimes my S/R areas get really close together and sometimes even merge, so the labels I draw for them become overwritten and illegible.

    I'd like to put the labels for the S/R lines into a tool-tip style box that appears only when required by the user, e.g. hovering the mouse over the area, or single-clicking it.

    Can I code an event handler somehow that is triggered by some user input, like a mouse-over or a click on a small part of the S/R area I plotted?

    If someone could point me at a good example, that'd really help.

    Thanks
    Last edited by adamus; 03-06-2013, 07:36 AM.

    #2
    Hello adamus,

    Yes, that is something that we do not support. Please note that a user can use the Zoom In (Ctrl + Z) and the Minidata Box (Hold down the middle mouse button) to see the chart and plots better on a Charting Window that would require no additional programming.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Yes, the minidata box is something that I would like to emulate but in this case I would only want it to work when the S/R level is clicked, and I would only want it to show the particular information relevant to that S/R level.

      I could code the graphics methods, no major problem there. I just need to tie the code to an event somehow. My guess is that it's simple enough if you know which function to override.

      Comment


        #4
        Hello adamus,

        You may try to look into the C# method to check for if a Key is pressed like in the following link.


        Please note that you do not want to check for a key that is already being used for something. You can check most of the Hot Key combinations under Tools -> Hot Key Manager.
        JCNinjaTrader Customer Service

        Comment


          #5
          Originally posted by adamus View Post
          Yes, the minidata box is something that I would like to emulate but in this case I would only want it to work when the S/R level is clicked, and I would only want it to show the particular information relevant to that S/R level.

          I could code the graphics methods, no major problem there. I just need to tie the code to an event somehow. My guess is that it's simple enough if you know which function to override.
          Web searches are a great resource.

          ref: http://msdn.microsoft.com/en-us/libr...ousehover.aspx
          ref: http://msdn.microsoft.com/en-us/libr...eventargs.aspx
          ref: http://www.c-sharpcorner.com/UploadF...se_events.aspx
          ref: https://www.google.com/#hl=en&output...w=1195&bih=622
          Last edited by koganam; 03-06-2013, 09:14 AM.

          Comment


            #6
            Originally posted by NinjaTrader_Matthew View Post
            There will be several code breaking changes to the next major release, but it's too early for us to say what exactly will be changing.

            We're expecting to have further documentation/support for these areas in that version.

            This would be the recommended approach.
            This is a quote from another thread.

            The stuff that koganam gives links to would let me code a bunch of stuff that is unsupported - but is it in an area that's likely to change from NT7 to NT8?

            If you don't know now, when will you know?

            When is there likely to be a beta version of NT8 available?

            Thanks

            Comment


              #7
              Hello adamus,

              We do not have a release date on NT8 beta, documentation of "Code Changes", or the NT8 Full version currently. We will announce the information and the dates once we know them.
              JCNinjaTrader Customer Service

              Comment


                #8
                Has anyone had any success attaching a MouseHover-type event to DrawObject (Triangle, Square, etc)? Perhaps I need to put a container around the DrawObject and attach to the container? (haven't tried yet)

                Also, regarding NT8 and "code breaking changes", will NT7 be able to be installed on the same machine as NT8 while indicator developers (like myself) adjust their tools to work with NT8? I'd hate for a customer to install NT8 and my indicators stop working for them and for them to be SOL!

                Thanks!
                Daniel

                Comment


                  #9
                  Hello Daniel,

                  In regards to NT8 being able to be installed with NT7 still being installed, that is something that I would not be able to say for sure yet or until closer to the release date.

                  With that said, in previous versions you would be able to have them both installed like NT6.5 and NT7 were both able to be installed and did not interfere with each other but it is too early to tell for NT8.

                  Happy to be of further assistance.
                  JCNinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_JC View Post
                    Hello Daniel,
                    With that said, in previous versions you would be able to have them both installed like NT6.5 and NT7 were both able to be installed and did not interfere with each other but it is too early to tell for NT8.
                    That's what I thought about NT 6.5 and NT 7. I hope NT 8 will be that way! :]

                    Thanks again,
                    Daniel

                    Comment


                      #11
                      Hi Daniel,
                      did you get anywhere attaching the MouseHover event? I'm just looking into it again (i.e. this time I really can't avoid it because without hiding it, I'm putting too much info on my charts.)

                      Comment


                        #12
                        Originally posted by adamus View Post
                        Hi Daniel,
                        did you get anywhere attaching the MouseHover event? I'm just looking into it again (i.e. this time I really can't avoid it because without hiding it, I'm putting too much info on my charts.)
                        Have you thought of creating a tooltip?

                        ref: https://www.google.com/search?q=%2BC%23+%2Btooltip

                        Comment


                          #13
                          Originally posted by adamus View Post
                          Hi Daniel,
                          did you get anywhere attaching the MouseHover event? I'm just looking into it again (i.e. this time I really can't avoid it because without hiding it, I'm putting too much info on my charts.)
                          I ran straight into a roadblock trying to do this.

                          I cannot figure out how I can use Graphics.DrawImage() in my Plot() because it doesn't give me any way of obtaining a handle on what it draws.

                          I've used ChartControl.controls.Find() before but that also requires a name, which I haven't got either.

                          Obviously I need a handle on the image I'm putting on the chart, so that I can attach the MouseHover event to generate a tooltip with the info for it.

                          I'm creating lots of these so space is at a premium, I can't just write the text on the chart.

                          Comment


                            #14
                            Originally posted by koganam View Post
                            Have you thought of creating a tooltip?

                            ref: https://www.google.com/search?q=%2BC%23+%2Btooltip
                            Hi Koganam,
                            didn't see you post since I took so long writing mine. A tooltip is exactly what I want, but I have many horizontal lines, each one needing a label and the lines are often only 1 px thick and close together vertically, so instead of forcing the user to try to MouseHover over a thin line, I want to place a little image or icon at the start of the line and attach the MouseHover & tooltip creation to that.

                            But how? Graphics.DrawImage doesn't give me a handle or an image name back.

                            Comment


                              #15
                              Originally posted by adamus View Post
                              I ran straight into a roadblock trying to do this.

                              I cannot figure out how I can use Graphics.DrawImage() in my Plot() because it doesn't give me any way of obtaining a handle on what it draws.

                              I've used ChartControl.controls.Find() before but that also requires a name, which I haven't got either.

                              Obviously I need a handle on the image I'm putting on the chart, so that I can attach the MouseHover event to generate a tooltip with the info for it.

                              I'm creating lots of these so space is at a premium, I can't just write the text on the chart.
                              Wait a minute. If you are using the c# draw methods to draw your object, then you have the graphics object.

                              How are you drawing the object? code?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by rajendrasubedi2023, Today, 09:50 AM
                              0 responses
                              9 views
                              0 likes
                              Last Post rajendrasubedi2023  
                              Started by ender_wiggum, Today, 09:50 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post ender_wiggum  
                              Started by bmartz, Today, 09:30 AM
                              1 response
                              8 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Started by geddyisodin, Today, 05:20 AM
                              3 responses
                              24 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by lorem, Today, 09:18 AM
                              1 response
                              5 views
                              0 likes
                              Last Post lorem
                              by lorem
                               
                              Working...
                              X