Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detecting when user changes bar width

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

    Detecting when user changes bar width

    In an indicator I'm writing, I would like to use the width that the user can change by pressing Alt-up and Alt-down. I see this in two places: ChartControl.BarWidth and Bars.BarsData.ChartStyle.BarWidth.

    Is there a preference about which I should use? Either one seems to work but I don't know if there are disadvantages to one over the other.

    I'm overriding Plot() to draw my indicator because I don't know of a better way to plot a bar chart using my own calculated values for open, high, low, close. If there is a better/cleaner way, please tell me.

    -A

    #2
    Hello,

    Thanks for the forum post.

    Unfortunately since there is no documentation on this you are operating out in unsupported territory here.

    I would suspect that both methods should do the trick for you however since its unsupported theirs not much more information I can provide other then that.

    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      FYI - I like to have my candles a constant width - it helps me with pattern recognition. So the bars.barsdata method works better than ChartControl.BarWidth - I don't know why.
      However be aware that if you zoom in and zoom out the autoscaling is effectively overriden so this wouldn't be to everyone's taste.

      Comment


        #4
        am not a programmer, but from your post here, am wondering if you found a way to adjust bar width by adding an indicator to a chart. would like to compress (reduce) bar width and spacing on some of my tick charts in order to view more historical data and recent history within a normal window. the normal horizontal spacing tools do not provide enough for my needs. can you point me to any solutions on this subject...? thxs much Will

        Comment


          #5
          Hello valhallafutures,

          To change the bar spacing or width:
          ChartControl.BarWidth = 10;
          ChartControl.BarSpace = 10;
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          579 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X