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

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 Graci117, Today, 09:02 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by ETFVoyageur, Today, 07:55 PM
          0 responses
          7 views
          0 likes
          Last Post ETFVoyageur  
          Started by janio973, Today, 07:24 PM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by aligator, 01-06-2022, 12:14 PM
          4 responses
          246 views
          0 likes
          Last Post john_44573  
          Started by reynoldsn, Today, 05:56 PM
          0 responses
          14 views
          0 likes
          Last Post reynoldsn  
          Working...
          X