Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Extending a Line forward

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

    Extending a Line forward

    I am trying to get NT to extend a line on the high of a current bar to go 3 bars to the right at the same price. My code is

    DrawLine("MyLine"+CurrentBar, 1, High[0], 0, High[0], Color.Blue, DashStyle.Dot, 4);

    This will only draw a line on the current bar and not the future 3 bars at the same price.

    Any thoughts on how to do this?

    thanks

    Steve

    #2
    Future bar drawing is currently not available in the sense that you cannot draw a line to fill the place of where the future bars will be plotted into.

    What you can do is plot the line for the next 3 bars as the bars become populated though. To achieve this you will need to determine the condition in which you want to draw the line then set a switch that will be active for 3 bars and inside that switch you will draw the line, each time modifying the startBars parameter to match the latest bar.

    Here is some untested code
    Code:
    if (Close[0] > Open[0])
         drawLineSet = 1;
    while (drawLineSet <= 3)
    {
         DrawLine("MyLine", drawLineSet, High[drawLineSet - 1], drawLineSet - 1, High[drawLineSet - 1], Color.Blue, DashStyle.Dot, 4);
         drawLineSet++;
    }
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the suggestion

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      648 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      369 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      108 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      572 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      574 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X