Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SHARE: Cursor Tracker (panel highlighter)

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

    SHARE: Cursor Tracker (panel highlighter)

    I've written a script to help me keep track of where my cursor is, it is available for download here:



    Updates:

    07/25/2018
    - minor bug fix: object instance error when mouse is over chart while NT8 or workspace is still loading.
    - minor bug fix: System.MissingMethodException logged at load of NT, special thanks to AntiqueBrass for not only pointing this out, but for also supplying a fix!


    05/04/2018
    - Added option to make the inner tracker filled/hollow.
    - Added ability to select/change inner tracker opacity.

    If you update to this version, please delete the existing CursorTracker.xml file.

    03/23/2018
    - fixed missing reference issue.

    03/19/2018 - fixed the issue of a tracker being stuck on a chartpanel when disabling both trackers while menu items hover over a chartpanel.



    As someone who leaves multiple chart windows open across multiple monitors,
    I tend to lose track of where the cursor is, sometimes due to global cross hair looking the same everywhere, sometimes due to any number of reasons that would cause the cursor to "jump" to a different position.
    This add-on script was written to help me keep track of where the cursor is and not confuse which chart I'm actually pointing at/with.


    There are 2 types of trackers:
    The "Outer" tracker creates a border around the chartpanel that the mouse is over.
    The "Inner" tracker follows the mouse position within the chartpanel that the mouse is over.

    In the "Tools" menu of the Control Center, I've added a "TG" menu. In it, you will find
    the "Track Your Cursor" submenu. "Outer" and "Inner" trackers can be toggled on/off by clicking on their respective menu items.
    A third menu item "Other Options" opens a window that allows editing of:
    - The thickness of each tracker
    - The fade/blur/glow radius of the "Outer" tracker
    - The color used on the trackers

    Additionally, the "Inner" tracker can dynamically change size
    depending on how much the chart is zoomed in. This was done to help
    reduce the tracker from impeding on getting a clear view of the chart.

    The settings/configurations of this AddOn script are saved to a file so that it does not reset back to default every time you restart NT.


    Known Issues:
    None at the moment.


    I not only welcome, I encourage any code fixes that would make this script work more efficiently.
    Please share on the NT support forum, and thank you in advance for any help you may be able to offer.
    Attached Files
    Last edited by gubbar924; 07-25-2018, 08:08 PM.

    #2
    Hello gubbar924,

    This thread will remain open for any community members that would like to debug your code on your behalf.

    That said, I have the start of an indicator I decided not to further development that I've not experienced the behavior you have described you may find helpful.

    I stopped developing the script because it triggers the rendering with OnRender. This also triggers any other scripts that need to render when moving the mouse and the more scripts that render that are added the higher the CPU usage will be.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thank you for the script, this cursor tracker script is independent of the regular chart RenderTargets, it uses shapes/canvases to draw over the chart windows.

      As for the cpu usage, I've been noticing the same thing with my scripts that use MouseMove and Rendering. I'm not sure how viable of a solution this really is, but in my cursor tracker script, I've set a counter that increments on mouse move and resets on MouseEnter, it will only process the code within MouseMove if the counter is divisible by 5, otherwise it will only increment the counter and move on. Visually, the difference is barely noticeable, but I was hoping that having to process the full code only 1 out of every 5 increments would reduce the cpu usage.

      Comment


        #4
        known issue resolved, updated script has been uploaded to the download link in the first post.

        Comment


          #5
          How do I get this AddOn to Work?

          Grubbar, thank you so much for this fine piece of work. I have been waiting for over a year for such a feature to appear. Without this I find that NT8 is effectively unusable, so I have persisted with NT7 in the interim.

          Sadly, I am somewhat of a novice user and I'm having great difficulty getting the code loaded and working. So far I have managed to download all the files, but have no idea what to do next. I tried putting the .cs file into the AddOns folder, but that just resulted in a large bunch of compile errors on existing code.

          Could you (or someone else) please walk me through the steps required to get this code installed and operating correctly (simple instructions please).

          Many thanks,

          G.

          Comment


            #6
            @Griesha_uk

            I would recommend deleting the .cs file that you manually copied into your addons folder and use NT8's built-in method of importing scripts. To do that, you can follow these steps:

            After you've downloaded the .zip file, go to NT8's Control Center window
            (the main window). In this window's "Tools" menu, go to "Import" -> "NinjaScript Add-On..."

            A window should pop up which allows you to select the file you'd like to import, select the downloaded zip file and click on "Open". That should do it, you may need to restart NT8 one time.

            Comment


              #7
              gubbar,

              Thank you so much for your quick reply. I have followed your recommendation and the process seems to work, but only to a point. Sadly, the import generates an error message that gives me no clue as to what to do next.

              The error is:

              "X Import failed. The NinjaScriptArchive File may contain duplicate method names that already exist on your PC, modify a method signature that other scripts were dependent on, or be missing a required file on either your PC or in the import archive."

              Do you have any insight as to what this means, and/or how to resolve.

              Many thanks,

              G.

              Comment


                #8
                Did you make sure to delete the .cs file that you manually copied into the AddOns folder?
                If you have already deleted it, try restarting NT.

                Comment


                  #9
                  Some more information that might be helpful to diagnose this problem....

                  I had carefully removed the CursorTracker.cs file. I even did a full file search to ensure that the only copy I had was in the .zip file (in my Downloads folder).

                  I tried reloading NT8, and even did a full reboot. No joy.

                  So, what I tried next was to put the .cs file back into AddOns and take a copy of the compile error information that I think might shed some light onto the problem. The compiler error information is:

                  NinjaScript File Error Code Line Column
                  CursorTracker.cs The type or namespace name 'WpfPropertyGrid' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference?) CS0234 1001 28
                  CursorTracker.cs The type or namespace name 'WpfPropertyGrid' does not exist in the namespace 'System.Windows.Controls' (are you missing an assembly reference?) CS0234 1002 44

                  I hope this helps.

                  G

                  PS. I removed CursorTracker.cs from AddOns again.

                  Comment


                    #10
                    @Griesha_uk

                    My apologies, try using this new .zip file that I've attached to this post, make sure to import it via NT8's import method only.

                    Please let me know if it works for you, so that I can update the .zip file in the main download link as well.


                    Thanks!




                    edit: removed attached file, replaced with an updated file
                    Last edited by gubbar924; 03-23-2018, 12:22 PM.

                    Comment


                      #11
                      gubbar,

                      No joy I'm afraid. I still get the same error when trying to import.

                      I was careful to remove the "old" version before trying the import. I noticed that the .zip file includes a .dll this time, so I am sure the files used and import procedure were correct.

                      I should also mention that I am on the latest version of NT8 (8.0.12.0)

                      I do hope you are able to resolve as having this new feature means a lot to me.

                      Thanks,

                      G.

                      Comment


                        #12
                        I've made a tiny change that should do the trick, would you mind testing it one more time?
                        In the meantime, I've reached out to the NT support team and will get back to you after I hear from them if this version does not work for you either. But please do let me know if it works.


                        edit: attachment removed again
                        Last edited by gubbar924; 03-23-2018, 02:16 PM.

                        Comment


                          #13
                          gubbar,

                          Sadly this one has exactly the same problem.

                          I even played around with the .zip file a little. I removed the .cs and then tried to import again, but got same error. As I currently have no AddOns, I'm wondering if ANY import will work?

                          Please keep me posted if any further developments.

                          Thanks,

                          G.

                          Comment


                            #14
                            sorry about all of the confusion Griesha_uk, I've spoken with the support team and have recreated the zip file to include references the correct way. Now, it should work for you.



                            edit: attachment removed, please refer back to the first post for the most recent version
                            Last edited by gubbar924; 03-23-2018, 05:08 PM.

                            Comment


                              #15
                              gubbar,

                              I can't thank you enough. Finally I can use NT8 on my 6 monitor rig. So, yes, the recent changes you made worked like a charm.

                              Hopefully, many others will get to enjoy as well.

                              Many thanks indeed!

                              G

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by cre8able, Today, 03:20 PM
                              0 responses
                              2 views
                              0 likes
                              Last Post cre8able  
                              Started by Fran888, 02-16-2024, 10:48 AM
                              3 responses
                              46 views
                              0 likes
                              Last Post Sam2515
                              by Sam2515
                               
                              Started by martin70, 03-24-2023, 04:58 AM
                              15 responses
                              114 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by The_Sec, Today, 02:29 PM
                              1 response
                              7 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              2 responses
                              31 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Working...
                              X