Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnMouseDown compile error - No suitable methods found to override.

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

    OnMouseDown compile error - No suitable methods found to override.

    I created a fresh indicator, and I am trying to add the overloaded OnMouseDown() method. My objective is to capture the event when the mouse button is pressed.

    I am using the below link from the NinjaTrader Language Reference.




    When I add the overloaded OnMouseDown method,

    Code:
    public override void OnMouseDown(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
    {
        // Do something
    }​
    I get the following error ...

    CS0115 - No suitable methods found to override.


    Can someone help me find what is wrong here ?

    #2
    Hello firstlanetech,

    Thanks for your post.

    It looks like the link you provided is to the drawing tools list. There is an override for a drawing object for mouse down in a DrawingTool script. If you take a look at the left side of the help guide that will help to determine which type something is for. In this case it is under the drawing tool section.

    This method cannot be used in an indicator script or strategy script since an indicator or strategy does not natively have an OnMouseDown event.

    You could get the mouse events from the ChartControl however that requires some error handling, you can see a sample of that here: https://ninjatrader.com/support/foru...687#post742687
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    77 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    53 views
    0 likes
    Last Post CarlTrading  
    Working...
    X