Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Overlay drawing unwanted lines

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

    Overlay drawing unwanted lines

    Ok I have written an indicator which identifies a specific candle pattern, and changes bar colours.

    But when I add my indicator to a chart a line is drawn between every bar high.

    I am going to assume I have added something to Protected override void Initialize or am missing something from Protected override void Initialize that is causing this to occur?

    Thoughts please.

    #2
    Hello EastLondonKiwi,

    Thanks for your post.

    It is difficult to guess based on the limited information.

    Does you indicator have AddPlot()? Does the plot get set to the High of the bar? Is the line the color of the plot (if used)?

    Can you provide a screenshot of your chart and your source code?

    Comment


      #3
      Hi Paul..

      No Addplot is not used in my code.

      Attached is a screenshot and the code I am using

      My code should only drawn the yellow background on a specific bar which it does, and colour one bar red and one bar green (in this case) which it does. the gold line transversing between all the bars is not intended, and is the issue causing me some confusion.

      Kind regards

      Duncan
      Attached Files

      Comment


        #4
        Hello Duncan,

        Thanks for your reply.

        You have a public data series (Signal) and are assigning the Close[0] value to it (Line 69). By default, Ninjatrader will assume you want a plot and it uses its default color and line type.

        If you do not want a plot, then you will need to declare a private DataSeries signal, in initialize: signal = new DataSeries (this); and in the public Signal change to: get { return signal;}
        Those changes will remove the unintended plot.

        Comment


          #5
          Thanks Paul

          I am not sure why that line of code is in there (possibly copied from the help guide examples when I was researching how to set a time restricted period to look for bar patterns within) was in there.

          I commented it out, and as you suggested the plot disappears, and my indicator still works, so all good I think

          Comment

          Latest Posts

          Collapse

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