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

IHorizontalLine.Y coordinate for Right Axis

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

    IHorizontalLine.Y coordinate for Right Axis

    Hello,

    I'm using the VolumeUpDown indicator on a time based chart.

    I have the time bars hidden and the standard VolumeUpDown showing on the primary panel and the Volume "Scale Justified" to the Right axis.

    When I access the Y coordinate of a horizontal line I am not getting the value on the right axis, which is Volume and not Price.

    Is there a way to make this work?

    Thanks

    #2
    Hello Turtle Trader,

    Thank you for your post.

    Set the VolumeUpDown to AutoScale = True, then right click in the chart > select Data Series > set the Auto Scale option to False > OK.

    Comment


      #3
      reply

      Thank you.

      I tried that but it still does not give me the Y coordinate for VolumeUpDown

      Perhaps there are other settings I need to tweak?

      Comment


        #4
        Hello Turtle Trader,

        Thank you for your response.

        Can you provide a screenshot of what you are seeing and what you are trying to obtain here?

        Comment


          #5
          screen shot attached

          in this case I would like the IHorizontalLine.Y coordinate to return 1200

          I am able to set AutoScale on the instrument once somehow, but when I go back and check it, it is greyed out and I cannot change it.

          I am printing the Y coordinate given to the Output window and it is not what is on the Y axis on the chart...usually it is a small decimal number.
          Attached Files

          Comment


            #6
            Are you just looking for an axis marker to show where your horizontal line is? You will need a plot to do that. Assign a plot to that number and make it some small dot or hash and on each new bar just reset the previous bar plot and plot the current bar plot.
            Here a plot, there a plot, everywhere a plot plot!

            Dan
            eDanny
            NinjaTrader Ecosystem Vendor - Integrity Traders

            Comment


              #7
              line is manually drawn

              The line is not a plot...it is drawn manually. I add, move, or delete these manually drawn lines, just like on a price chart.

              The indicator needs to know the line, which it can do in Ninja 7, and access its attributes.

              Y is one of the attributes of IHorizontalLine and it is not returning the correct number of the Y axis on the right side.

              Comment


                #8
                I see, my mistake.

                Dan
                eDanny
                NinjaTrader Ecosystem Vendor - Integrity Traders

                Comment


                  #9
                  ...........

                  no mistake, just a different viewpoint
                  :-)

                  Comment


                    #10
                    Hello Turtle,

                    Thank you for your response.

                    I am not sure why the Y value should be 1200 if you manually drew the line. Can you provide a code snippet to illustrate your point?

                    Comment


                      #11
                      code

                      foreach (IDrawObject draw in DrawObjects)
                      {
                      if (draw.UserDrawn && draw.DrawType == DrawType.HorizontalLine)
                      {
                      ILine ThisLine = (ILine) draw;
                      IHorizontalLine HLine = (IHorizontalLine) ThisLine;

                      Print (HLine.Y.ToString());

                      }
                      }

                      ================================================== ===========

                      Do you see where the black hand drawn horizontal line intersects the right Y axis...more or less 1200? It is that value I am looking for.

                      Comment


                        #12
                        Hello Turtle Trader,

                        Thank you for your response.

                        I have created a video on this item, please let me know if you have any questions: http://screencast.com/t/j1Ksii76kfB

                        Comment


                          #13
                          Thanks

                          Hi Patrick,

                          Yes what you do is working.

                          I was loading the indicators with a chart template and evidently something was haywire in the template, though it was working good without this new indicator.

                          Also, I was not able to set the Data Series.Auto Scale to false. It was locked to true.

                          But if I add the indicator, then go back I can change the AutoScale on the DataSeries. Could not do that before for some reason.

                          this is now working with one instrument on the panel. My goal is to get it working with 4 instruments on one panel...so it should scale up there.

                          Thank you!

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,606 views
                          0 likes
                          Last Post aligator  
                          Started by jaybedreamin, Today, 05:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jaybedreamin  
                          Started by DJ888, 04-16-2024, 06:09 PM
                          6 responses
                          18 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Jon17, Today, 04:33 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Jon17
                          by Jon17
                           
                          Started by Javierw.ok, Today, 04:12 PM
                          0 responses
                          13 views
                          0 likes
                          Last Post Javierw.ok  
                          Working...
                          X