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

How to draw a line into the future without it drawing past the current bar?

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

    How to draw a line into the future without it drawing past the current bar?

    I want to draw a one hour line and I have the start datetime and end datetime,
    that works fine. It doesn't draw until the bar is at the correct time, and ends correctly,
    BUT. I don't want the line to draw past the current bar. I want it to stop at the current bar and keep updating with each bar
    to stay out of the margin area where I have important levels.

    Here's the original code:
    Code:
    Draw.Line(this, "Open" + dt.Month + dt.Day + dt.Year, false, dtStartTime, OpenPrice, dtEndTime, OpenPrice, Brushes.DodgerBlue, OpenDashStyleHelper, OpenLineWidth);

    Thank you to anyone and everyone who replies!

    #2
    Hello davydhnz,

    Use the Time[0] of the current bar on as the endTime parameter and call the draw method on each new bar update.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Hong Nguyen, Yesterday, 08:17 PM
    1 response
    22 views
    0 likes
    Last Post NinjaTrader_Ray  
    Started by trader3000a, Today, 08:01 AM
    0 responses
    3 views
    0 likes
    Last Post trader3000a  
    Started by TheTradingMantis, 09-13-2021, 08:34 AM
    2 responses
    40 views
    0 likes
    Last Post DTSSTS
    by DTSSTS
     
    Started by Lucius. valerius, 03-23-2023, 01:39 AM
    6 responses
    151 views
    0 likes
    Last Post dj22522
    by dj22522
     
    Started by QuantKey_Bruce, Today, 06:44 AM
    0 responses
    9 views
    0 likes
    Last Post QuantKey_Bruce  
    Working...
    X