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

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 bmartz, 03-12-2024, 06:12 AM
        4 responses
        31 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by Aviram Y, Today, 05:29 AM
        4 responses
        12 views
        0 likes
        Last Post Aviram Y  
        Started by algospoke, 04-17-2024, 06:40 PM
        3 responses
        28 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by gentlebenthebear, Today, 01:30 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by cls71, Today, 04:45 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X