Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to enable crosshair when double clicking on the char

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

    How to enable crosshair when double clicking on the char

    I have an indicator on the chart, now I want to add function in my indicator that auto enable crosshair when double clicking on the chart. I wonder which control I should add click event handler on, and what code I shoud put in the handler. Could you give me some hint?

    #2
    Hello,

    Thank you for the question.

    For the double click event, you could try utilizing the events on the ChartControl object, this is not a documented subject so there are no specific samples on this. There are also other double click actions already in the chart which may conflict but you could certainly try it out to see the result.

    For invoking the chart tools, you could look into the ChartCommands class. While this wouldn't necessarily be something that is documented, you could likely invoke the chart command for this using the following syntax:

    Code:
    ChartCommands.ChangeCursor.Execute(CrosshairType.Local);
    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      How to enable crosshair when double clicking on the char

      This is a reply to NinjaTrader_Jesse about my thread here, I don't know why I have no permission to reply that thead, so I post new thread here.

      Jesse, after reading your suggestion, I wrote a sample to switch the crosshair between local and off automaticlly when double clicking left mouse, but it has some problem, it can't switch from local to off although the toolbar's crosshair icon is changed to off. See my sample.
      Attached Files

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by LawrenHom, Today, 10:45 PM
      0 responses
      3 views
      0 likes
      Last Post LawrenHom  
      Started by love2code2trade, Yesterday, 01:45 PM
      4 responses
      28 views
      0 likes
      Last Post love2code2trade  
      Started by funk10101, Today, 09:43 PM
      0 responses
      7 views
      0 likes
      Last Post funk10101  
      Started by pkefal, 04-11-2024, 07:39 AM
      11 responses
      37 views
      0 likes
      Last Post jeronymite  
      Started by bill2023, Yesterday, 08:51 AM
      8 responses
      44 views
      0 likes
      Last Post bill2023  
      Working...
      X