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 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