• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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?
    Paul H.NinjaTrader Customer Service

    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.
        Paul H.NinjaTrader Customer Service

        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 NT-Roland, Today, 04:36 PM
          0 responses
          1 view
          0 likes
          Last Post NT-Roland  
          Started by Newtrader101, Today, 03:40 PM
          2 responses
          10 views
          0 likes
          Last Post Newtrader101  
          Started by Branpo, Today, 02:58 PM
          2 responses
          5 views
          0 likes
          Last Post Branpo
          by Branpo
           
          Started by sdauteuil, Today, 02:09 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by AMATX, Today, 02:19 PM
          2 responses
          10 views
          0 likes
          Last Post AMATX
          by AMATX
           
          Working...
          X