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

error CS0117

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

    error CS0117

    I am trying to export some indicators to share here in the community and I am getting that error. The log says:
    "error CS0117: 'NinjaTrader.Indicator.VolumePriceConfirmation' does not contain a definition for 'VolumenPriceConfirmationContradiction'"

    Any ideas what that is?

    Thanks!

    #2
    In your VolumePriceConfirmation indicator you have an error regarding your use of a variable named VolumenPriceConfirmationContradiction. You will need to go through that indicator, find the line in question and address it. Likely you have not declared the variable.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh, thanks for your reply. Yes, that is another indicator I created before this one. In other words it calculates a value I need and use it in my VolumePriceConfirmation. Does that mean I have to do it all in one place? I cannot just call another indicator there to export it?

      Comment


        #4
        lgarcia3,

        I do not know how you have programmed it, but anything you want to access from another indicator you need to first expose. Please see this reference sample. Note that there are two files you will want to look at in it: http://www.ninjatrader-support2.com/...ead.php?t=4991
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Hi Josh,

          I have a similar problem to this. I have modified the Bollinger indicator and saved a copy as MyBolli (also done the same for Keltner channel). I have then modified another indicator which used to reference Bollinger and KeltnerChannel and all I have done is replaced the words 'Bollinger' and 'KeltnerChannel' with 'MyBolli' and 'MyKeltner'.
          The indicator works fine but exporting fails with:
          error CS0117: 'NinjaTrader.Indicator.Indicator' does not contain a definition for 'MyBolli'
          and
          error CS0117: 'NinjaTrader.Indicator.Indicator' does not contain a definition for 'MyKeltner'

          How would I go about getting NT to recognise my two modified indicators?

          Thanks.

          Comment


            #6
            Hello,

            I'm not sure what is causing this exactly. Look in your custom indicators and see if the names are all the same as you posted below. Look at these lines in your indicators:

            [Description("IndyName")]
            [Gui.Design.DisplayName(
            "IndyName")]
            publicclass IndyName : Indicator
            {

            All of the above "IndyName" text should be the same.
            DenNinjaTrader Customer Service

            Comment


              #7
              Hi Ben

              I didn't have the GUI line so I added it just in case, this made no difference. The description line obviously gives a description of the indicator and so does not match the indicator name, but I can't see this making a difference. All other indicator names appear to be correct.

              It's not essential I export the indicator but it would be nice to understand why it won't.

              I've noticed when exporting other indicators that NT states that is is also exporting, for example, EMA.cs (or something like this) so I assume that this is so the custom indicator can reference an 'external' indicator. I don't get this message when trying to export my particular custom indicator.

              Comment


                #8
                Ok, I think I found what was causing my problem. The new indicator has access to the other indicators. Sometimes (yes, lazy me) I do a "this" to see the list of other indicators. If I leave that reference there, the compiler thinks that it is a method/function existing in the class I am working on... which is not. It cannot find it and fires the error. Two ways to overcome it, simply get rid of the "this" reference, or just create one in the properties section and that should solve the problem. It is funky though that the compiler cannot see that the current class is just inheriting those other indicators. Looks like a .NET problem.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by r68cervera, Today, 05:29 AM
                0 responses
                2 views
                0 likes
                Last Post r68cervera  
                Started by geddyisodin, Today, 05:20 AM
                0 responses
                3 views
                0 likes
                Last Post geddyisodin  
                Started by JonesJoker, 04-22-2024, 12:23 PM
                6 responses
                33 views
                0 likes
                Last Post JonesJoker  
                Started by GussJ, 03-04-2020, 03:11 PM
                12 responses
                3,239 views
                0 likes
                Last Post Leafcutter  
                Started by AveryFlynn, Today, 04:57 AM
                0 responses
                6 views
                0 likes
                Last Post AveryFlynn  
                Working...
                X