Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw lines under bars

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

    Draw lines under bars

    Is there a way to draw lines under bars?
    Attached Files

    #2
    Hello Marten,
    Thanks for writing in and I am happy to assist you.

    To assist you further can you tell me:
    1. Are you drawing a horizontal line?
    2. What is the refernce bar which you are taking to draw the line?


    I look forward to assisting you further.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      I want to draw horizontal lines every 50 points between 1000 and 2000 points and vertical lines every 10th bar.

      I know, that I can change background color for making vertical line, but it makes line too thick.

      Comment


        #4
        Hello Martin,

        To draw Horizontal line at an increment of 50 points please use this code. Also please note I have placed it in the OnStartUp event instead of OnBarUpdate
        Code:
        protected override void OnStartUp()
        {
               for (int i = 1000; i <= 2000; i+= 50)
        	{	
        		this.DrawHorizontalLine("h" + i.ToString(), i, Color.Green);
        	}
        }

        To draw the Vertical line please use the below code
        Code:
        protected override void OnBarUpdate()
        {
        	if (CurrentBar % 10 == 0) this.DrawVerticalLine("v"+ CurrentBar, 0, Color.Blue, DashStyle.Solid, 1);
        }
        Please let me know if I can assist you any further.
        JoydeepNinjaTrader Customer Service

        Comment


          #5
          Thanks Joydeep for your response, but this is not answer for my first question.

          I don't want to draw lines over bars. Look at the attached picture.

          Comment


            #6
            Hello Marten,
            Can you be more specific on how exactly your Y axis value will be.

            From the screenshot I can see the line is cutting through the bars. Which bar you are referencing too.

            I look forward to assisting you further.
            JoydeepNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Joydeep View Post
              Hello Marten,
              Can you be more specific on how exactly your Y axis value will be.

              From the screenshot I can see the line is cutting through the bars. Which bar you are referencing too.

              I look forward to assisting you further.
              NT JD- he's talking about z order

              Comment


                #8
                Hello Sledge,
                Thanks.

                @ Marten,
                You can change the ZOrder by Pressing Shift + Mouse scroll. Please refer to the section "How to change the zorder (paint order) of a chart object" from here to know more about it



                Please let me know if I can assist you any further.
                JoydeepNinjaTrader Customer Service

                Comment


                  #9
                  Yes, ZOrder is what I want!

                  So my problem is solved by:

                  Code:
                  protected override void Initialize()
                  {
                      ZOrder = -1;
                  }
                  Thanks guys!

                  Comment


                    #10
                    which thread

                    Which thread would i go to with issues involving scaling in combining Stochastic/Macd in same sun graph please?

                    Comment


                      #11
                      Hello laredo78676,
                      Please see this video which demonstrates how to overlay 2 indicators on the same panel.
                      World's leading screen capture + recorder from Snagit + Screencast by Techsmith. Capture, edit and share professional-quality content seamlessly.


                      Please let me know if I can assist you any further.
                      JoydeepNinjaTrader Customer Service

                      Comment


                        #12
                        thank.

                        Im not finding a left side margin width setting anywhere?

                        Comment


                          #13
                          Hello laredo78676,
                          Unfortunately you cannot set the Y axis margin width. If you dont want the left axis then simply set the scale justification to Overlay.

                          Please let me know if I can assist you any further.
                          JoydeepNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                          0 responses
                          566 views
                          0 likes
                          Last Post Geovanny Suaza  
                          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                          0 responses
                          330 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by Mindset, 02-09-2026, 11:44 AM
                          0 responses
                          101 views
                          0 likes
                          Last Post Mindset
                          by Mindset
                           
                          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                          0 responses
                          547 views
                          1 like
                          Last Post Geovanny Suaza  
                          Started by RFrosty, 01-28-2026, 06:49 PM
                          0 responses
                          548 views
                          1 like
                          Last Post RFrosty
                          by RFrosty
                           
                          Working...
                          X