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

DrawingTool with Mouse events.

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

    DrawingTool with Mouse events.

    Hello,
    I'm developing a DrawingTool for NT8 and I need to check when mouse is hovering specific area.
    I tried to subscribe to the ChartPanel.ChartControl mouse events OnStateChange function (Historical, SetDefaults, Configure) but every time ChartPanel was null.

    How to correctly subscribe to ChartPanel.ChartControl events in DrawingTool?

    #2
    Hello yyesyyesyyes,

    In a DrawingTool script, the OnMouseMove() would provide the ChartPanel (which you could assign to a variable for use in other methods).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello yyesyyesyyes,

      Thank you for your post.

      As noted in the help guide, ChartControl should only be accessed once the state has reached State.Historical:Which event(s) are you subscribing to in your script? I suggest subscribing in State.Historical as well as adding a null reference check similar to this snippet:
      Code:
      else if (State == State.Historical)
      {
           if (ChartControl != null)
                ChartControl.MouseLeftButtonDown += MouseClicked;​
      }
      If you are still experiencing unexpected behavior, please provide a snippet of what you have within OnStateChange so I may better understand and assist you.

      Please let me know if I may be of further assistance.
      Emily C.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by burtoninlondon, Today, 12:38 AM
      0 responses
      10 views
      0 likes
      Last Post burtoninlondon  
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      14 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      11 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      14 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,983 views
      3 likes
      Last Post jhudas88  
      Working...
      X