Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limiting indicator calculation and display

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

    Limiting indicator calculation and display

    Thanks to the assistance of posters in this forum I was finally able to create an indicator that doesn't cause the chart to autoscale to the indicator. This was accomplished by using the DrawLine Method and essentially draw a new line from every bar to the next one. Unfortunately this causes the chart to take an inordinate amount of time to load these indicators when the chart is opened or initiated. So I would like to add a parameter to the indicator that would limit how far back the indicator is calculated. Is there a way to do this?

    Thanks in advance.

    #2
    Hello ECI-Ed,

    There are a number of ways of doing this such as, limited the number of days to load on your chart, use a time filter, or check the number of CurrentBars, etc...
    JCNinjaTrader Customer Service

    Comment


      #3
      Hello JC,

      Thanks for your reply. I was thinking of something along the lines of CurrentBars. Maybe I'm dense, but I don't quite see how CurrentBars alone can accomplish this. If the bars were numbered backwards from the current bar it would be easy, but could you possibly provide a sample of how to do this with the CurrentBar method? Thanks.

      Comment


        #4
        You can use Count to determine exactly how many bars are on the chart, and then create a filter to only calculate on X number of currentbars from the last bar on the chart.

        Code:
        				int startBar = Count - 10;
        					
        				if(CurrentBar >= startBar)
        				{
        					Print(CurrentBar);
        				}
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        324 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        250 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        351 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        180 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X