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 elirion, Today, 01:36 AM
      0 responses
      2 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      2 views
      0 likes
      Last Post gentlebenthebear  
      Started by samish18, Yesterday, 08:31 AM
      2 responses
      9 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by Mestor, 03-10-2023, 01:50 AM
      16 responses
      389 views
      0 likes
      Last Post z.franck  
      Started by rtwave, 04-12-2024, 09:30 AM
      4 responses
      31 views
      0 likes
      Last Post rtwave
      by rtwave
       
      Working...
      X