Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Platform exceptions

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

    Platform exceptions

    Hello

    A user report these errors. Trace attached.
    As I can see something bad happened with UI events handling inside the platform.

    I use this code for attaching input events handlers to indicators

    PHP Code:
    // indicator class
            protected MouseEventHandler handlerOnMouseMove;
            protected MouseButtonEventHandler handlerOnMouseDown;
            protected MouseButtonEventHandler handlerOnMouseUp;
            protected MouseButtonEventHandler handlerOnMouseDoubleClick;
            protected KeyEventHandler handlerOnKeyDown;
            protected KeyEventHandler handlerOnKeyUp;
    
            public void AttachEventHandlers()
            {
                if (GetChartPanel() != null)
                {
                    handlerOnMouseMove = new MouseEventHandler(IndicatorMVC.OnMouseMove);
                    GetChartPanel().MouseMove += handlerOnMouseMove;
    
                    handlerOnMouseDown = new MouseButtonEventHandler(IndicatorMVC.OnMouseDown);
                    GetChartPanel().MouseDown += handlerOnMouseDown;
    
                    handlerOnMouseUp = new MouseButtonEventHandler(IndicatorMVC.OnMouseUp);
                    GetChartPanel().MouseUp += handlerOnMouseUp;
    
                    handlerOnMouseDoubleClick = new MouseButtonEventHandler(IndicatorMVC.OnMouseDoubleClick);
                    GetChartPanel().MouseDoubleClick += handlerOnMouseDoubleClick;
    
                    handlerOnKeyDown = new KeyEventHandler(IndicatorMVC.OnKeyDown);
                    GetChartPanel().KeyDown += handlerOnKeyDown;
    
                    handlerOnKeyUp = new KeyEventHandler(IndicatorMVC.OnKeyUp);
                    GetChartPanel().KeyUp += handlerOnKeyUp;
                }
            }
    
            public void DetachEventHandlers()
            {
                if (GetChartPanel() != null)
                {
                    if (handlerOnMouseMove != null) { GetChartPanel().MouseMove -= handlerOnMouseMove; handlerOnMouseMove = null; }
                    if (handlerOnMouseDown != null) { GetChartPanel().MouseDown -= handlerOnMouseDown; handlerOnMouseDown = null; }
                    if (handlerOnMouseUp != null) { GetChartPanel().MouseUp -= handlerOnMouseUp; handlerOnMouseUp = null; }
                    if (handlerOnMouseDoubleClick != null) { GetChartPanel().MouseDoubleClick -= handlerOnMouseDoubleClick; handlerOnMouseDoubleClick = null; }
                    if (handlerOnKeyDown != null) { GetChartPanel().KeyDown -= handlerOnKeyDown; handlerOnKeyDown = null; }
                    if (handlerOnKeyUp != null) { GetChartPanel().KeyUp -= handlerOnKeyUp; handlerOnKeyUp = null; }
                }
            }
    
            public ChartPanel GetChartPanel()
            {
                return (MasterIndicator == null) ? ChartPanel : MasterIndicator.ChartPanel;
            }
    
            protected override void OnStateChange()
            {
                ...
    
                else if (State == State.Historical)
                {
                    AttachEventHandlers();
                    ...
                }
                else if (State == State.Terminated)
                {
                    DetachEventHandlers(); 
                    ...
                } 
    
    Any advice?
    Last edited by NinjaTrader_ChelseaB; 08-20-2017, 07:53 AM.

    #2
    Hello ren37,

    The log and trace files contain sensitive information.

    Please do not post the log or trace or any other personal information on the forums.

    Please send an email to platformsupport [at] ninjatrader [dot] com for further assistance.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Ok, but there was no personal info.

      Comment


        #4
        Hello ren37,

        The MachineID can be used to license scripts for unauthorized machines. This is included with the log and trace files.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          My indicators use another machine id for license checking.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          633 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          364 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          567 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          568 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X