Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cursor change

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

    Cursor change

    Hi, I'd like to change cursor in a chart to let's say Cursors.Hand, is it possible somehow? When changing ChartControl.Cursor and ChartControl.ChartPanel.Cursor, the hand just flashes but the original cursor is immediately restored. Thank you.

    #2
    There would be unfortunaely nothing suppored in this area via NinjaScript. Where did you try changing it, in OnStartUp() to .Order?

    Comment


      #3
      In fact it is in mouse click handler, I suppose it's also an unsupported area :-). On the other hand, this is just a standard Windows Forms framework, no rocket science. It just looks Ninjatrader forces the cursor internally to a specific type. Even confirming that it's not possible because of some internal cursor handling would help, I wouldn't have to spend time looking for a solution in that case. Unfortunately, with Ninjatrader there is almost always some solution if one looks and tries long enough, giving up too soon is not the best approach. Thank you.

      Comment


        #4
        Hi mantak007, could unfortunately not really provide much more background infos, however playing with that more generic C# in the ChartControls, this simple indicator seems to work well in my testing -

        public class ChangeCursor : Indicator
        {
        protected override void Initialize()
        {
        Overlay = true;
        }

        protected override void OnStartUp()
        {
        this.ChartControl.ChartPanel.MouseDown += new MouseEventHandler(this.OnMouseDownEvent);
        }

        protected override void OnBarUpdate()
        {

        }

        private void OnMouseDownEvent(object sender, MouseEventArgs e)
        {
        if (e.Button == MouseButtons.Middle && e.Clicks == 2)
        {
        ChartControl.ChartCursor = ChartCursor.Order;
        ChartControl.Invalidate();
        }
        }
        }

        A double middle click and you change your cursor .Order.

        Hope it helps

        Comment


          #5
          It works, thank you

          Comment


            #6
            Ninjatrader Cursor

            Where do I input this code? I have been looking for a cursor solution for some time now.

            Thank you,
            Mark

            Comment


              #7
              MSedlak,

              Attached is a sample script

              Download and import the indicator into NinjaTrader -
              To Import

              * Download the indicator to your desktop, keep them in the compressed .zip file.
              * From the Control Center window select the menu File> Utilities> Import NinjaScript
              * Select the downloaded .zip file
              * NinjaTrader will then confirm if the import has been successful.


              Critical - Specifically for some indicators, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'
              Attached Files
              Cal H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              558 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              324 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              545 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              547 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X