• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 SAILIKITY, 05-22-2019, 05:41 PM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_PaulH  
      Started by rmillar, 01-09-2019, 06:02 PM
      6 responses
      64 views
      1 like
      Last Post eDanny
      by eDanny
       
      Started by mlarocco, Today, 11:39 AM
      4 responses
      20 views
      0 likes
      Last Post mlarocco  
      Started by roblogic, Today, 11:19 AM
      4 responses
      21 views
      0 likes
      Last Post roblogic  
      Started by saeed, Today, 10:17 AM
      8 responses
      53 views
      0 likes
      Last Post NinjaTrader_Kate  
      Working...
      X