Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by adeelshahzad, Today, 03:54 AM
    5 responses
    32 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by stafe, 04-15-2024, 08:34 PM
    7 responses
    32 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by merzo, 06-25-2023, 02:19 AM
    10 responses
    823 views
    1 like
    Last Post NinjaTrader_ChristopherJ  
    Started by frankthearm, Today, 09:08 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Started by jeronymite, 04-12-2024, 04:26 PM
    3 responses
    43 views
    0 likes
    Last Post jeronymite  
    Working...
    X