Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SuperTrend Compiler Error

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

    SuperTrend Compiler Error

    I'm trying to code a very simple strategy that uses the basic SuperTrend indicator that I believe came with NT7. I keep getting a compiler error "NinjaTrader.Indicator.SuperTrend.Trend is inaccessible due to it's protection level". Any idea what this error points too?

    Based on Google research (and reading the entire 24 page SuperTrend thread ), I suspect it may be something to do with the overload syntax, but I am not enough of a programmer to be sure. Trend does exist as a bool series in the SuperTrend indicator code. Here is the the code line that generates the compiler error listed above...

    if (!SuperTrend(14, 2.66, true).Trend[0] && SuperTrend(14, 2.66, true).Trend[1])


    If any one can help me see the error of my ways, it would be greatly appreciated..

    Thanks in advance.

    #2
    Hello oldredtop,

    This indicator is not supplied by NT. We unfortunately can't offer much support for it. Hopefully a community member that has experience with it can help out here.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick reply Ryan...and for setting the record straight that NT was not the source of the indicator. It seems the older I get, the harder it is to keep track of stuff like that...

      Can you offer any insight into the "inaccessible due to it's protection level" error phrase? What is protected? Does that point to a C# error or a Ninjascript environment error?

      Comment


        #4
        That is a C# error - Trend is not available from where you're trying to access it. This error would be generated if Trend was only declared privately.
        Last edited by NinjaTrader_RyanM1; 05-17-2011, 08:25 AM.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks Ryan. That helps clarify where I need to research...

          Comment


            #6
            Research complete. Problem solved by changing the bool series variable in SuperTrend from private to public. I OBVIOUSLY need to dig into the C# syntax more...

            Thanks again Ryan.

            Comment


              #7
              I still can't get my Supertrend strategy to work

              Redtop:

              Would you post your strategy?

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by traderqz, Yesterday, 09:06 AM
              3 responses
              21 views
              0 likes
              Last Post NinjaTrader_ThomasC  
              Started by f.saeidi, Today, 10:19 AM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by kujista, Today, 06:23 AM
              5 responses
              15 views
              0 likes
              Last Post kujista
              by kujista
               
              Started by traderqz, Today, 12:06 AM
              3 responses
              6 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by RideMe, 04-07-2024, 04:54 PM
              5 responses
              28 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X