• 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

Using the public override string ChartLabel(DateTime dateTime) to view date

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

    Using the public override string ChartLabel(DateTime dateTime) to view date

    I am creating my custom bar type and would like to display the date along the time on the x-axis when the crosshairs are activated.

    I am overwriting the following method but it is not do anything.

    Code:
    public override string ChartLabel(DateTime dateTime)
    
            {
    
                return dateTime.ToString("MM/dd HH:mm:ss"); 
    
            }
    Please advice.

    #2
    Hi GARZONJ, thanks for your post.

    Our colleague Chelsea has made an example of translating a mouse click to price and time of a bar here:

    https://ninjatrader.com/support/foru...-owner-problem

    Instead of mousedown you need to use PreviewMouseDown instead for the indicator to act as the crosshair does. I attached an example script of how to set that up below.

    Please let me know if I can assist any further.
    Attached Files
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by dtl-saw, Yesterday, 08:44 PM
    0 responses
    13 views
    0 likes
    Last Post dtl-saw
    by dtl-saw
     
    Started by ballboy11, Yesterday, 04:29 PM
    0 responses
    13 views
    0 likes
    Last Post ballboy11  
    Started by zacharydw00, Yesterday, 02:29 PM
    2 responses
    30 views
    0 likes
    Last Post zacharydw00  
    Started by timcjpfx, Yesterday, 06:22 AM
    4 responses
    27 views
    0 likes
    Last Post timcjpfx  
    Started by welson, Yesterday, 08:26 AM
    2 responses
    18 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X