Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Type CustomEnumNamespace.UniversalMovingAverage

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

    Type CustomEnumNamespace.UniversalMovingAverage

    Hi there,

    The code for the reference sample "Creating a user-defined parameter type (enum)" use a type "CustomEnumNamespace.UniversalMovingAverage" which is not defined anywhere and produces a compile error, i.e. name space "CustomEnumNamespace" does not exit. I could not find any reference to this type in the refrence manual. I am using ver 8.0.24.3. Is this type defined somewhere?

    Thanks
    -Alaa

    #2
    Hello Alaa,

    Thanks for your post.

    Could you share the exact spot you downloaded the reference sample? It compiles fine on my end. I am curious if perhaps a localized Help Guide page has an improper link.

    The CustomEnumNamespace should be found at line 112 in the example.

    I have attached screenshots for context.

    If you downloaded from a different URL, could you share the URL you downloaded the file from?

    I look forward to your reply.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi Jim.

      I downloaded it from https://ninjatrader.com/support/helpGuides/nt8/.

      I downloaded and imported it again. It compiles and the namespace is therre. I am not sure if I did not import it properly the first time. All is good. Thanks for your help.
      Attached Files
      Last edited by aelagha; 08-05-2021, 12:32 PM.

      Comment


        #4
        Hi Juim,

        Here is what was going on:

        When I imported the the script, it was placed under the Indicator folder in Ninjascript, and has no issues. However, to keep my custom indicators separate from the built in ones, I have a subfolder under Indicators. When I move the imported script to the subfolder, for some reason, Ninjascript stripped off the CustomEnum namespace and replaced with another one. See the image attached.

        Is this expected behavior? is using subfolders okay, or am I missing something?

        thanks,
        -Alaa

        Comment


          #5
          Hello Alaa,

          It is expected behavior.

          When a script gets moved to a subfolder, the namespace is appended with the sub folders name automatically. This does carry the side effect that custom enums that are in a sub-namespace will have the sub-namespace they were created in change. The NinjaScript Editor is not smart enough to change the whole code, or differentiate which namespace lines should be modified when moving to a sub folder.

          A quick change of reverting the custom namespace at line 112 back to "namespace NinjaTrader.NinjaScript.Indicators.CustomEnumNames pace" will get things compiling again, and would be recommended for moving other scripts that have enums in custom namespaces included.

          Let us know if you have any additional questions.

          JimNinjaTrader Customer Service

          Comment


            #6
            Ok, good to be aware of that. Thanks again.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            30 responses
            803 views
            1 like
            Last Post grayfrog  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            3 responses
            11 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by Johnny Santiago, 10-11-2019, 09:21 AM
            95 responses
            6,193 views
            0 likes
            Last Post xiinteractive  
            Started by Irukandji, Today, 09:34 AM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by RubenCazorla, Today, 09:07 AM
            1 response
            6 views
            0 likes
            Last Post RubenCazorla  
            Working...
            X