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

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 adeelshahzad, Today, 03:54 AM
          4 responses
          22 views
          0 likes
          Last Post adeelshahzad  
          Started by merzo, 06-25-2023, 02:19 AM
          10 responses
          823 views
          1 like
          Last Post NinjaTrader_ChristopherJ  
          Started by frankthearm, Today, 09:08 AM
          5 responses
          15 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          43 views
          0 likes
          Last Post jeronymite  
          Started by yertle, Today, 08:38 AM
          5 responses
          16 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Working...
          X