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 s.kinra, Today, 12:52 AM
    0 responses
    2 views
    0 likes
    Last Post s.kinra
    by s.kinra
     
    Started by vivek.n, Yesterday, 03:19 AM
    2 responses
    33 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by Angus7, Yesterday, 02:03 PM
    1 response
    13 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by powerlobster, Yesterday, 01:39 PM
    0 responses
    17 views
    0 likes
    Last Post powerlobster  
    Started by butt_toast, Yesterday, 01:16 PM
    0 responses
    12 views
    0 likes
    Last Post butt_toast  
    Working...
    X