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 agraham, Today, 01:05 PM
            0 responses
            20 views
            0 likes
            Last Post agraham
            by agraham
             
            Started by jagswe, Today, 01:34 PM
            0 responses
            12 views
            0 likes
            Last Post jagswe
            by jagswe
             
            Started by PaulMohn, Yesterday, 05:25 AM
            9 responses
            34 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by srbdoc, Today, 12:20 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by blar58, Today, 12:19 PM
            1 response
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X