Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

DrawingTools - OnRender - how many bars are in the chart?

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

    DrawingTools - OnRender - how many bars are in the chart?

    Hi,

    Within a DrawingTool, how can I know how many Bars are in a Chart?

    Not the visible Bars in the window, but the total amount of Bars loaded in the Chart.

    This is because I'm drawing a line, but I need to know the price of the last bar.
    I may draw the line now, somewhere in the future in the actual chart -> in this way, with screen coordinates, I know the right point of my line is a bar "in the future" but as time goes, my line will be in the middle of the bars, and my right point of the line will not be "in the future" anymore, and thus, I cannnot know the price of the last bar.

    I hope I could explain myself

    I need something like the value of "CurrentBar" but in DrawingTool.

    Thanks

    #2
    Hello artson,

    GetAttachedToChartBars().Bars.Count().
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    148 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    5 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Started by tkaboris, Today, 05:13 PM
    0 responses
    5 views
    0 likes
    Last Post tkaboris  
    Started by GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,282 views
    0 likes
    Last Post Leafcutter  
    Working...
    X