Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Drawing Lines

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

    Drawing Lines

    Hi,
    I'm plotting a horizontal line on a Renko chart. Most of the time it works fine. The problem occurs when there are bars with the same time stamp; for example, 18:00:00:023 (bar index 447), 18:00:00:023 (bar index 448), 18:00:00:023 (bar index 449), 18:00:00:050 (bar index 450) .The line stops drawing on the first of those bars

    I understand why this is happening. The overloads for DrawLine allow you to start/end plotting at either startBarsAgo/endBarsAgo OR startTime/endTime. In my situation I need to use a DateTime to begin plotting and therefore I am stuck with using a DateTime to terminate the plot. Unfortunately Time[0] only gives a time stamp accurate to seconds and therefore the plot terminates early.

    I think the plot might work if it were possible to have an overload that would allow the use of DateTime and barsAgo interchangeably. But I am not sure of that. Can you suggest how I can extend my plot to bars with the same Time[0] value time stamp but which differ in the millisecond portion of the time stamp as seen in the Data Box? Thank you.

    #2
    Hello Zeos6,

    Thanks for your inquiry.

    After looking into this further, it appears that the DateTime value of the Time object is used to find a slot to place the ChartAnchor of the Drawing Tool.

    I will submit a feature request on your behalf asking for DrawingTool overloads that accept millisecond granularity. I will update this post with the ticket ID after it has become available.

    EDIT: This feature request is being tracked with the ticket ID SFT-2696. This feature's implementation can be found in the Release Notes of the version of NinjaTrader that includes the feature. You can find the Release Notes here: https://ninjatrader.com/support/help...ease_notes.htm

    Feature requests are fulfilled based on our development team's schedule and priorities and we cannot provide a time frame for it to become available.

    In the meantime, you could devise a workaround by using custom rendering to draw a line to actual pixel coordinates that are translated from how many milliseconds the time you want to plot is offset from the slot's time.

    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jim; 09-20-2017, 02:43 PM.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    163 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X