Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help: Bar height depends on bar width?

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

    Help: Bar height depends on bar width?

    I have an indicator that draws a short line a few cents above every five-bar pattern. I noticed that when I changed the bar width, either in the data series dialog or by dragging the x-axis, the bars would get closer to, or further from, the indicator lines. Using the mini data box I was able to see that the indicator lines were drawn at the correct price and the high of the bar was reading the correct price in the data box, but the height of the bar was drawn incorrectly on the screen.

    Please advise. Thx

    #2
    Hello,

    Thanks for your forum post.

    Are you sure this just isnt the auto scale working? If you put the chart into fixed mode by left clicking and dragging in the y acis until you see an F in the top right hand corner of the chart and the scroll back and forth in the x axis does this occur?

    I look forward to assisting you further.

    Comment


      #3
      Thanks Brett. Yes, I am sure. You don't even need the indicator, that's just how I happened to find the bug. If you set your data series to OHLC or HiLo, then set your bar width wide and/or zoom way in, you will see that the cursor values do not match the top of the data series as drawn. An easy way to see this is if you draw a horizontal line on a chart just above the bar and then drag the x-axis to zoom in and out. You will see that the bar can start quite a ways below the line but then end up touching it or going over it as you zoom in. Clearly this is very wrong as they are both supposed to set to a static absolute price level.

      Comment


        #4
        Notice how the legend shows the bar high to be 30.00. The cursor, which is below the high of the bar is also at 30.00.
        Attached Files

        Comment


          #5
          Hello,

          Thanks for bringing this to my attention. I have sent into development and await there response.

          Comment


            #6
            Hello,

            This is how OHLC bars and HiLo works in NinjaTrader. The are drawn with Windows Hash objects and they must grow in all directions. Not just the x direction. Therefor the middle of the bar will always be the true value of the bar and the data is correct.
            Attached Files

            Comment


              #7
              Brett, I'm sorry, but you don't seem to understand. Saying in effect that 'that's what happens in NinjaTrader' does not address the concern. I know that's how NinjaTrader is programmed, I can see that for myself by observing the behavior. The problem is that it is wrong! You have described to me why it is happening which is the first step, but bars cannot be allowed to do that and it needs to be fixed in your software. This is fundamental charting. Do you understand what an OHLC or HiLo bar is supposed to show? The top of the bar, by definition, is the high of that bar. You are saying that in NinjaTrader the top of the bar is just drawn "somewhere near" the bar's high value depending on the zoom level. HOLY COW - Do you understand how incredibly wrong that is? The result is that using your charting software, no one can just look at a chart and know for sure if the high price of a bar has hit or exceeded an indicator or know if it crossed some given value/gridline, assuming the actual high of the bar is close to the indicator, value or gridline. In order to see the actual high, or low for that matter, you would have to put your cursor over every single bar you were interested in and read the values out of the data box. That defeats the purpose of making a chart in the first place. You might as well just look at a table of all the values instead.
              PLEASE - escalate this issue to the next level.

              Comment


                #8
                motownlucas,

                There is no workable alternative to this behavior.

                Consider the hash marks for the open and close prices. If the open/close prices reside on the high and low of the bar it is very easy to say where you would want them to reside. If the price was on the high, the highest drawn pixel should be on the exact high price. If the price was on the low, the lowest drawn pixel should be on the exact low price. However this is simply not possible. What happens if the open/close hash falls somewhere inbetween the bar? Do we draw the highest pixel at the exact price or do we draw the lowest pixel at the exact price? As such to be consistent the whole style is drawn "centered". Meaning if you want to use really fat widths, it is going to grow from all sides proportionally leaving the actual price in the dead center of where it is drawing. This concept is exactly the same as if you were using candlestick bars and the y-axis. If you made the bar really fat and it crosses irrelevant timestamps the bar itself is not saying that it crossed that timestamp. The bar's time is still just whatever is in the dead center of that bar.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Hmm, I can see the dilema. Please forgive my earlier passion. I guess this is why some other charts like Think or Swim use lines for OHLC and don't allow the user to change the line width. Also zooming TOS charts does not change the line width. I wonder how others such as TradeStation handle it? I suppose my options are to use a width of 1, switch to candlesticks, or invent my own OHLC bar via a custom indicator.

                  Thanks Brett and Josh. Good customer service.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X