Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

yByValue = chartScale.GetYByValue(variable);

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

    yByValue = chartScale.GetYByValue(variable);

    Hello,

    Is it possible to get the position in the chart of a variable? Lets say my variable is variable = 3341

    I tried yByValue = chartScale.GetYByValue(variable); but it return the wrong answer. Its close but not enough.

    Any idea how i can get the X and Y position of a double price in the chart without using a get bar index method?

    Thank you
    Frank

    #2
    Hello frankduc, thanks for your post.

    GetYByValue is the only way to get the X,Y coordinate from the chart. The "PriceLine" indicator is a good example of using this method to convert a price to an X Y coordinate. Please reference that script and check what your script is doing differently.

    Kind regards.

    Comment


      #3
      Chris,

      im putting this on hold




      Frank
      ty
      Last edited by frankduc; 08-07-2020, 10:22 AM.

      Comment


        #4
        Hello Frank, thank for your reply.

        I have no context as to what this code is doing. Could you let me know what the indicator is meant to do so I can provide an example?

        Comment


          #5
          Chris L,
          Is it possible to get the correct GetYByValue of MACD indicator (on a subpanel), which has both positive and negative values, noting that a negative Y value would be outside of the Chart canvas area?

          I understood that GetYByValue values are not required for the Ninjatrader build-in drawing functions but I would like to draw on the subpanel using SharpDX. Thank you.

          Comment


            #6
            Hello kkc2015,

            Thanks for your question. We can still use coordinate space outside of the chart canvas, however we should note that rendering is clipped to be within the ChartPanel owned by the indicator (price panel or subpanel.)

            We look forward to assisting.

            Comment


              #7
              Jim, thank you for your quick response, much appreciated.
              GetYByValue for an indicator inside a subpanel does return a positive chart Y-pixel coordinate, which is inside the chart subpanel canvas area.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              650 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              370 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              109 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              574 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              577 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X