Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unexpected result using .GetYByValue and GetXByTime

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

    Unexpected result using .GetYByValue and GetXByTime

    Hi,

    I've been working recently with

    ChartControl.GetYByValue(this, High[0])
    and
    ChartControl.GetXByTime(Time[0])

    The results of those two calls return the point shown on the attached screen capture. Rather than pointing to the currently forming bar (the data is live), I get the x and y coordinates for the high of the most recently completed bar.

    My goal is to get the information for the currently forming bar. Does anyone know how to do that (and why High[0] and Time[0], which work as I would expect in other calculations, do not produce the expected results when used with GetYByValue and GetXByTime)?
    Thanks,

    Gordon
    Attached Files
    Last edited by grose; 10-12-2016, 05:32 PM. Reason: Wording

    #2
    Is that a custom bar? Have you tried -1?
    What does high [0] return? Current bar or the one marked on the chart?

    Comment


      #3
      Hi Sledge,

      Thanks for your response. The bar type is a standard range bar bet there is an order flow indicator that seems to override the appearance of the bar. High[0] returns the bar marked on the chart.

      Do you know when to use -1 as an index into a price array and when to use 0 for the current bar?

      Regards,

      Gordon

      Comment


        #4
        Originally posted by grose View Post
        Do you know when to use -1 as an index into a price array and when to use 0 for the current bar?
        No.

        I was hoping it was some custom stuff offset by 1.

        Does the issue happen on plain Range Bar chart with only your code?

        Comment


          #5
          Hello,

          I wanted to check, what is the CalculateOnBarClose setting being used?

          The [0] values would report the most recent Closed bar with COBC = true, or the Building bar with =false.

          Could this potentially be the cause of the prior bar being referenced?

          I look forward to being of further assistance.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          589 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          342 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          555 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X