Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

protection level error on compile

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

    protection level error on compile

    I am trying to pickup the value of a variable in one of my custom indicators from within my custom strategy and keep getting the error message on compile " ...is inaccessible due to its protection level "

    My indicator is quite simple and does not have any protection levels of which I am aware. How are they created?

    How do I get past this?

    thanks

    #2
    Please make sure you declare your varaible as public or preferabbly, provide a property to access the internal variable.
    RayNinjaTrader Customer Service

    Comment


      #3
      perfect Ray....thanks

      Comment


        #4
        Using NT indicator within custom strategy

        Ray,

        Along the same line of issue, I am trying to access NT's RegressionChannel indicator values within my custom strategy.

        If I only access the values from within my cs Properties method, then no problem.

        However, even though my cs will compile it will not run, if I access the values with the exact same code moved from my Properties method to the OnBarUpdate method.

        So I assumed I needed to Add the indicator in Initialize; however that has made no difference.

        Curious to me...as I have done the same thing with other NT indicators, i.e. Added and accessed fine from within the OnBarUpdate method. What is the difference with RegressionChannel I wonder?

        Also, I find I can not save the RegressionChannel indicator under another name to modify it. Why is that?

        Thanks

        Comment


          #5
          Hmm. I do not know why you cannot rename it. Are you opening the indicator->right click->save as and input with a new name? It works on my end.

          Not sure why you are having difficulties accessing the indicator's plot values. Could you post up some of the code you are utilizing? Thanks.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Hi Josh

            All I do is save it to a new name, click compile and I get the attached errors
            Attached Files
            Last edited by ATI user; 03-08-2008, 08:47 AM.

            Comment


              #7
              Try it without saving it with an @. @ generally indicates it as a system indicator which it is not.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                thanks Josh

                that compiled fine

                that is the first indicator I have seen that has the @ in front of it when you open it in indicator.

                does your copy of the code have that?

                I made a mistake and did a save as to the original name...which may have added the @ in front of the name????.... then tried to rename that and got the @ in front

                since you can not save a system indicator, how do I get the @ off the name of system copy? can I download it somewhere?

                Comment


                  #9
                  On my end this is what I see when I open it:

                  /// <summary>
                  /// Linear regression is used to calculate a best fit line for the price data. In addition an upper and lower band is added by calculating the standard deviation of prices from the regression line.
                  /// </summary>
                  [Description("Linear regression is used to calculate a best fit line for the price data. In addition an upper and lower band is added by calculating the standard deviation of prices from the regression line.")]
                  public class RegressionChannel : Indicator
                  {
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #10
                    I am sure I did the first time around also....

                    Please do a Save As and instead of typing in a new name, click on Regression Channel in the indicator list above....it will save it over itself and then when you open it again it will have the @

                    Strange, since any other way you are told that you can not save system indicators...or changes thereto at least....

                    maybe this is a bug?

                    anyway, I suppose I restore the original version on RC when I do an install...in the meantime, it works fine with the @

                    Comment


                      #11
                      Can't reproduce on my end.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        Interesting

                        I am sure that is how I got the @ version in the first place

                        Anyway, I was able to save the @ version without the @ and it shows up as a custom cs and not a system/@ cs.

                        So I deleted the system one which has the @ name in the code and am using the new one.

                        Thanks. I am able to modify/compile the code now which was the initial goal

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by UltraNIX, Today, 09:13 AM
                        1 response
                        8 views
                        0 likes
                        Last Post NinjaTrader_ChrisL  
                        Started by Tuxstuff215, Today, 06:32 AM
                        1 response
                        15 views
                        0 likes
                        Last Post NinjaTrader_ChrisL  
                        Started by carlot, Today, 08:10 AM
                        1 response
                        17 views
                        0 likes
                        Last Post NinjaTrader_ChrisL  
                        Started by KirkHammett, Yesterday, 11:15 PM
                        1 response
                        15 views
                        0 likes
                        Last Post NinjaTrader_ChrisL  
                        Started by soon123, Yesterday, 11:12 PM
                        1 response
                        9 views
                        0 likes
                        Last Post NinjaTrader_ChrisL  
                        Working...
                        X