Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get X value for candles

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

    Get X value for candles

    Guys,

    I've got really tedious issue with getting x value of each bar. I want to draw rectangles or boxes to be spreaded at each side of the candles on the chart.

    I used ChartControl.GetXByBarIndex property to identify x value for the rectangles to drawn on each bar. on the current running bars the ninja draws rectangles well, however it shifts all of them to the next opening bar which is the thing that I don't want. I want rectangles on each candle when it starts to tick.

    I tried to store x index value for each bar in sortedList type but ninja behave unexpectedly and rectangles disappear immediately. I've attached two pictures describing what I am saying here.




    Regards
    Attached Files

    #2
    Hi there, unfortunately some of the methods your are using are unsupported. Maybe some of the other community members can help you out.

    Couldn't you just use an array to hold the x-values of interest? Now I'm not particularly familiar with SortedLists, but it seems like that would be overkill for just storing a simple x integer value.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Austin View Post
      Hi there, unfortunately some of the methods your are using are unsupported. Maybe some of the other community members can help you out.

      Couldn't you just use an array to hold the x-values of interest? Now I'm not particularly familiar with SortedLists, but it seems like that would be overkill for just storing a simple x integer value.

      Yes I tried using arrays, arraylists, and dataseries, however the issue gets more complicated as the rectangles shrink to very tiny barely seen behind the text in the top left corner of chart.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      578 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