PDA

View Full Version : SuperTrend Compiler Error


oldredtop
05-16-2011, 04:03 PM
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 :eek:), 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..http://www.ninjatrader.com/support/forum/images/smilies/wink.png

Thanks in advance.

NinjaTrader_RyanM
05-16-2011, 04:21 PM
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.

oldredtop
05-16-2011, 04:59 PM
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... :rolleyes:

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?

NinjaTrader_RyanM
05-17-2011, 08:18 AM
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.

oldredtop
05-17-2011, 08:24 AM
Thanks Ryan. That helps clarify where I need to research...;)

oldredtop
05-17-2011, 09:04 AM
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...:cool:

Thanks again Ryan.

ninjablanks
06-29-2011, 05:25 PM
Redtop:

Would you post your strategy?