Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Line on Chart in Background

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

    Line on Chart in Background

    Hello,

    I created a simple plot line on a chart. I used the code:

    Line00.Set(Line0);

    Line0 is initialized to x. This draws a line on the chart and allows the placement of the line to be changed. After a few tries I got it to work and the line was drawn as expected. It is used in the price panel. On my first attempt the line appears to behind the price bars (in background). I want the line behind the price but cannot duplice what I did. I also managed to delete the original file and am unalbe to find it! At one point in the original attempt I was using the Line method to replace the Plot method. Could this have been the difference?

    Thanks

    #2
    ramckay,

    I guess I am not sure what you want. The line to be behind the bars? Plot method lines are always in front of the bars and Lines are behind.

    In Initialize() do this:
    Code:
    Add(new Line(Color.Red, 10, "Line at 10"));
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks Josh.

      Guess I wasn't too clear. Your answer helps. I want lines that I can change the values of. They are to be used as references on a NYSE Tick chart. Can I use the input variables from the Indicator wizard in the "Add(new Line ...)" statement to change the line placement?

      Also, how did you include the small rectangle in your post with the code in it?

      Comment


        #4
        I guess I do not follow. You can already change the values for these lines. When you add the indicator to a chart you can change the line to take on any value you want.

        In your code if you wanted to change the line value I believe you can try:
        Code:
        Lines[0].Value = 100;
        To get the gray box you can tag your things with {code}something{/code}. Replace the brackets with square brackets [] and it will do it for you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          Didn't understand that you could just add a line to the code. Thought you had to do it through the Wizard.

          Thanks

          Code:
           Got it

          Comment

          Latest Posts

          Collapse

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