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 Hwop38, 05-04-2026, 07:02 PM
      0 responses
      164 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      318 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      246 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      350 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      179 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X