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

indicator not showing up in certain timeframes

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

    indicator not showing up in certain timeframes



    The indicator reads trend from the 15M chart. However, it only shows up on certain timeframes (all 15M or lower for testing). Also, if I change the days to load on the chart it may appear randomly - so if I switch to 90 days then to 30 then 90 it shows up...

    #2
    Hello,

    Thank you for the post.

    I wanted to check, are you getting errors when it does not show up in either the log or Tools -> OutputWindow?

    I would be unsure based on just this information what may be happening but if you are getting errors or have debugged the script already and have a general idea of the syntax in question I could look further into this.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Actually yes it appears so

      Comment


        #4
        Hello,

        Thank you for the image.

        It appears the script is checking an index that does not exist, this is very common for checking Bars ago which are not valid, for example on bar 7 you are checking a value of 10 bars ago which does not exist yet.

        If this is a script you are creating, you would need to look in the code to see what indexes are being used or BarsAgo values to determine what may be happening. Otherwise if this is something you have imported, I would suggest contacting the developer for debugging.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          The only index is the bars array
          if (x(2, 10, 30)[0] > y(55)[0]
          && Rising(TMA(BarsArray[1],20))
          && z(20, 3).Avg[0] >= 55)

          Comment


            #6
            Originally posted by brucelevy View Post
            The only index is the bars array
            Do you have a check for the validity of CurrentBars[1], which corresponds to BarsArray[1]?

            Comment


              #7
              I just added this line and it seemed to clear it up now

              HTML Code:
              if (CurrentBars[0] <= BarsRequired || CurrentBars[1] <= BarsRequired)
                      return;

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by guillembm, Yesterday, 11:25 AM
              2 responses
              9 views
              0 likes
              Last Post guillembm  
              Started by junkone, 04-21-2024, 07:17 AM
              9 responses
              68 views
              0 likes
              Last Post jeronymite  
              Started by trilliantrader, 04-18-2024, 08:16 AM
              4 responses
              18 views
              0 likes
              Last Post trilliantrader  
              Started by mgco4you, Yesterday, 09:46 PM
              1 response
              11 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by wzgy0920, Yesterday, 09:53 PM
              0 responses
              10 views
              0 likes
              Last Post wzgy0920  
              Working...
              X