Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetYByValue(price) returns large negative value

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

    GetYByValue(price) returns large negative value

    Within OnRender() I'm looping through a dictionary populated in OnMarketData() whose key values are prices. For each price I want to determine its Y-coordinate via chartScale.GetYByValueWpf(price) or chartScale.GetYByValue(price). Unfortunately, what I get consistently are large negative numbers such as -3260601 instead of the expected positive values.

    The attached screenshot displays a chart whose bar #49 at 12:10 PM has 4 prices: 2055.75, 2056.00, 2056.25 and 2056.50. The output window shows the calculated Y values for each of those 4 prices, all of which make no sense to me.

    This was working fine in NT7 but not in NT8.0.0.11 beta.

    Inexplicably, if I connect to a live data feed, the Y values turn positive. Also, if I create a new indicator that simply displays Y values of O, H, L, C prices the problem does not occur. But, if I strip out all code from my original indicator unrelated to simply printing some sample Y values, the problem persists.
    Attached Files

    #2
    Hello tradesmart,

    Thank you for writing in.

    I am investigating this further and will return with my findings.

    Thank you for your patience.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Hello tradesmart,

      For further clarification, can you please provide a simplified sample script that is demonstrating the behavior that you are seeing? Additionally, please provide reproducible steps so I may test on my end as well.

      I look forward to assisting further.
      Zachary G.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_ZacharyG View Post
        Hello tradesmart,

        For further clarification, can you please provide a simplified sample script that is demonstrating the behavior that you are seeing? Additionally, please provide reproducible steps so I may test on my end as well.
        Script and screenshot attached.
        To see the problem
        Create a chart for ES 09-16
        Price based on Last
        Type Minute
        Value 23
        Tick Replay true
        Days to load 1
        Break at EOD true
        Chart style Candlestick
        Bar width 69
        Open an Output window
        Add the gws\YByValueTrouble indicator to the chart
        Notice the negative values of Y:chartScale.GetYByValueWpf(price)
        Attached Files

        Comment


          #5
          Hello tradesmart,

          Please change your script's ScaleJustification property to NinjaTrader.Gui.Chart.ScaleJustification.Right (as this is where your price scale is located on the chart in the screenshot provided).
          Zachary G.NinjaTrader Customer Service

          Comment


            #6
            Ah, silly me. Somehow I overlooked that. Not sure why I set it to Overlay in the first place. Thanks for an easy fix. Wish all problems would be that simple to overcome.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bortz, 11-06-2023, 08:04 AM
            47 responses
            1,603 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
            12 views
            0 likes
            Last Post Javierw.ok  
            Working...
            X