Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The type or namespace name 'x' could not be found

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

    The type or namespace name 'x' could not be found

    I am fairly new to programming and am consistently running into the same errors. I am trying to add a divergence entry into PAS, following all of the previously entered indicators but when trying to compile I get the same errors.

    I was able to previously successfully add the RSI and CCI without these errors, but I assume that is because they are standard NT indicators and already included as references.

    The type or namespace name 'x' could not be found (are you missing a using directive or an assembly reference?) (There is no .dll, only a .cs)

    No overload for method 'x' takes 1 arguments (I have provided the DivParam info)

    I consistently run into these same errors (regardless of which non-standard NinjaTrader indicator) and after hours of internet searches and attempts to reconcile this, I either delete or comment out my attempts.

    I've been able to create the .dll from the .cs and added as a reference in editor but still get the same error.

    I would really appreciate it someone can enlighten me as I've run into this error many times, trying to code other indicators.​

    #2
    My goodness, programming seems brutally illogical. I am consistently running into the same errors. I am trying to add a divergence entry into PAS, following all of the previously entered indicators but when trying to compile I get the same errors.

    The type or namespace name 'EhlersCyberCycle' could not be found (are you missing a using directive or an assembly reference?) (There is no .dll, only a .cs)

    No overload for method 'EhlersCyberCycle' takes 1 arguments (I have provided the DivParam info)

    I consistently run into these same errors (regardless of which non-standard NinjaTrader indicator) and after hours of internet searches and attempts to reconcile this, I either delete or comment out my attempts.

    Trying to convert/compile a .dll from the .cs brings me here because apparently all .cs are recompiled into NinjaTrader.Custom.dll but Editor refuses to let me add it in references.

    Can someone please show me how easy it is to do this and let me start feeling really stupid that I didn't see it in the first place?

    Comment


      #3
      Is 'EhlersCyberCycle' a publicly available indicator?

      Can you attach the source code?

      Comment


        #4
        Hi bltdavid, thank you for your reply.

        It absolutely is, and I will attach it here.
        Attached Files

        Comment


          #5
          Ok well I created a .dll from it in VS, added it as a reference and still get the same error when compiling.
          I'll try a new thread and see if someone can help.
          Thank you.

          Comment


            #6
            Hello notenufftime,

            May I confirm you have imported this open source script through the normal import process, Tools > Import > NinjaScript Add-on?

            Are you able to add the indicator to a chart?

            The fully qualified namespace path of this script is:

            NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers .EhlersCyberCycle.

            May I confirm that from your custom script you are calling this indicator with the fully qualified namespace path?

            Are you supplying the Alpha, CycleD, and CycleU parameters to the indicator call?


            If you would like assistance with a compile error, please provide a screenshot of the error message and the line of code with the error noted in the by the line number in the error.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello notenufftime,

              This could indicate the indicator is in a different namespace path.

              What is the namespace path defined in this custom indicator?

              What public properties are defined in the script?
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Hi ChelseaB

                Thank you for your reply in both places regarding this same issue, I appreciate it.

                As I've mentioned and without reservation, I am essentially a novice programmer with great aspirations. I will thank you for your patience at the onset.
                I am not even certain that I have compiled the .dll correctly but there were no errors and VS seems pretty fussy so I think its fine,

                This is directly from the indicator:

                namespace NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers

                The public properties are:


                region Properties
                [NinjaScriptProperty]
                [Range(0.01, double.MaxValue)]
                [Display(Name="Alpha", Description="Alpha", Order=1, GroupName="Parameters")]
                public double Alpha
                { get; set; }

                [NinjaScriptProperty]
                [XmlIgnore]
                [Display(Name="CycleD", Description="Cycle Dwn", Order=2, GroupName="Parameters")]
                public Brush CycleD
                { get; set; }

                [Browsable(false)]
                public string CycleDSerializable
                {
                get { return Serialize.BrushToString(CycleD); }
                set { CycleD = Serialize.StringToBrush(value); }
                }

                [NinjaScriptProperty]
                [XmlIgnore]
                [Display(Name="CycleU", Description="Cycle Up", Order=3, GroupName="Parameters")]
                public Brush CycleU
                { get; set; }

                [Browsable(false)]
                public string CycleUSerializable
                {
                get { return Serialize.BrushToString(CycleU); }
                set { CycleU = Serialize.StringToBrush(value); }
                }

                [Browsable(false)]
                [XmlIgnore]
                public Series<double> Cycle
                {
                get { return Values[0]; }
                }

                [Browsable(false)]
                [XmlIgnore]
                public Series<double> Trigger
                {
                get { return Values[1]; }
                }
                #endregion​

                It is clear to me that I am missing something essential but starting from scratch it is overwhelming. I have been through the authors (PAS) post dealing explicitly with adding custom divergence indicators but most likely he assumes a reasonable level of experience, which I do not yet meet.

                I am hopeful that your assistance can shed light on where I am going wrong and help me defeat this recurring error.

                Comment


                  #9
                  Hi ChelseaB

                  I would gladly combine the two posts into one for ease but it is beyond my authority.

                  Yes there were no issues importing the indicator through the standard process provided by NT.

                  Yes, the indicator adds to the chart and is fully configurable.

                  Most likely I am not calling this indicator with the fully qualified namespace path. I am not sure that I even know how to do that.

                  In PAS, I only supplied the Alpha as it seemed to me to be the only one that was variable. I assigned it only DivParam1.

                  I hope in time that I will feel exasperation at how new I was.

                  From this point forward, I will also send the error information.

                  Comment


                    #10
                    Hello notenufftime,

                    As the indicator is not directly in the Indicators namespace, are you calling the indicator with the full namespace path?

                    NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers .MyIndicatorName

                    Are you supplying Alpha, CycleD, and CycleU parameters?
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello notenufftime,

                      Below is a link to a support article with helpful resources on getting started with NinjaScript and C#.


                      The fully qualified namespace the developer coded in the script is:
                      NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers .EhlersCyberCycle

                      Use this when calling the indicator or declaring a variable to hold the indicator. Supply all parameters required by the indicator.
                      Code:
                      private NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers.EhlersCyberCycle myIndicator;
                      
                      myIndicator = NinjaTrader.NinjaScript.Indicators.AUN_Indi.Ehlers EhlersCyberCycle(0.07, Brushes.Red, Brushes.LimeGreen);
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi ChelseaB

                        Thank you for the reply and solution. It's still a mystery to me where to put those lines.
                        I would be happy to use the resource that you reference in your post, as I am sure it will help me understand where and why the code goes there, unfortunately I can find no link.
                        Would you please repost it?

                        Happy Memorial Day

                        Comment


                          #13
                          Hello notenufftime,

                          Apologies, I didn't get that link in there.

                          I'm including this below.


                          The indicator that holds the variable would be declared in the scope of the class.

                          While the instantiation (the first call to the indicator and assignment to the variable) would be done in OnStateChange() when State is State.DataLoaded.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Thank you ChelseaB

                            I'll go through the reference you have provided and try to make more sense of all of this. Much appreciation for your assistance.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            558 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            324 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            101 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            545 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            547 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X