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

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, 09: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 Mizzouman1, Today, 07:35 AM
                        4 responses
                        18 views
                        0 likes
                        Last Post Mizzouman1  
                        Started by philmg, Today, 01:17 PM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_ChristopherJ  
                        Started by cre8able, Today, 01:01 PM
                        1 response
                        6 views
                        0 likes
                        Last Post NinjaTrader_ChelseaB  
                        Started by manitshah915, Today, 12:59 PM
                        1 response
                        3 views
                        0 likes
                        Last Post NinjaTrader_Erick  
                        Started by ursavent, Today, 12:54 PM
                        1 response
                        4 views
                        0 likes
                        Last Post NinjaTrader_Jesse  
                        Working...
                        X