Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to draw continuous lines

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

    How to draw continuous lines


    Hi, I'm new to programming, I wanted to see how I can convert this draw.line into continuous points as well as the swing

    Translation:
    hello i am new to programming i wanted to ask how can i convert this draw.line to continuous points as well as the swing.
    private void PlotZone(int BarEnd) /// Trazar tq
    {
    Draw.Line(this, "EntryDot"+ CurrentBar, true, base.CurrentBar- this.TQstarted, this.TQEntry, BarEnd, this.TQEntry,Brushes.Cyan, DashStyleHelper.Dot, 3 );
    Draw.Line(this, "StopDot"+ CurrentBar, true, base.CurrentBar - this.TQstarted, this.TQStop, BarEnd, this.TQStop, Brushes.Red, DashStyleHelper.Dot, 3 );
    Last edited by ElonkTrader; 06-07-2021, 09:18 AM.

    #2
    Hello ElonkTrader,

    Thanks for your post. We have moved it to a new thread as the question does not involve creating a an indicator that draws candle sticks.

    Draw.Line will draw a line between 2 bars on the chart. If you want to have a continuous line, I suggest to create a plot, and then to assign new plot values with each new bar. You can assign plot values to Values[X][0], where X is the plot number, starting at 0.

    Our help guide documentation below can help to see how plots can be added and values assigned to plots.

    AddPlot - https://ninjatrader.com/support/help...8/?addplot.htm

    Otherwise, you could consider using unique drawing tags when calling Draw.Line so new lines are created with each new call of Draw.Line. You could then use class level variables that hold where the ending bar of the last line is, so that bar can be used as the starting point for the next line.

    Additional tips for using NinjaTrader drawing tools with NinjaScript can be found below.

    Drawing - https://ninjatrader.com/support/help...8/?drawing.htm

    We look forward to assisting.

    Comment

    Latest Posts

    Collapse

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