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

Issue with Exporting Indicator & Custom Assembly

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

    Issue with Exporting Indicator & Custom Assembly

    Hello!

    I have an indicator that references logic within a custom assembly. The assembly is located at Documents > NT8 > bin > Custom (which is where the Editor reference is pointing.)

    The logic uses custom namespacing as well.

    When I compile and run locally everything works fine.

    However, when I try to export the indicator as an assembly, it can't compile (and subsequently can't export.) For some reason, it can't find the namespace in the custom assembly.

    What am I doing wrong? If the indicator compiles and runs normally, shouldn't it also export properly?

    #2
    Hello,

    Thank you for the post.

    Generally, for exportable items, you would need to avoid using the using statements at the top of the file and instead use fully qualified names in your syntax.

    An example would be if you have an Enum in a custom namespace like the following:

    Code:
    MyCustomNamespace.MyEnum
    At the top of the file you would likely use:

    Code:
    using MyCustomNamespace;
    Instead, in your code you would use the full name like the following and remove the using statement completely:

    Code:
    public MyCustomNamespace.MyEnum SomeEnumProperty {get;set;}
    Could you try removing the using statement for the assembly being used and instead define in the code the full names like the example above and then retest?

    If you are already doing this and cannot export still, are you able to provide a test that I could review? If this is using a free to use assembly that would be helpful for testing.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Unfortunately, that didn't solve the issue.

      I'll create a simple solution that reproduces the issue and will post that shortly when complete.

      Comment


        #4
        I've attached a simple solution that will demonstrate the issue.
        It's a simple indicator that displays candle type/direction.

        The zip file contains a text file with steps to reproduce the issue.

        Also, I'm running NinjaTrader 8 Version 8.0.6.1 64-bit (Multi-Broker).

        Let me know if you need anything else.

        Thanks again for your help!
        Attached Files

        Comment


          #5
          Hello,

          I tried the example and can see that I can export this.

          I wanted to verify, when you choose export are you selecting both the indicator and the dll reference in the list? The export won't automatically resolve the external references, you would need to pick what it needs and also check those boxes.

          In my test, I picked both the indicator and the dll and see that it exports after doing so.

          I look forward to being of further assistance.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Okay... Now I feel like a real dolt.

            I was unaware that one has to include the "References" too. Once I did that, it worked like a charm.

            Thanks Jesse!

            Also, just as an FYI, I was able to successfully use the "using [mynamespace]" declaration again in favor of the explicit inline namespace resolution.

            Comment


              #7
              Hello,

              Thanks for letting me know that worked and don't feel too bad I only asked because I also did that when I tried to export your example as well, only then I remembered that was a new step in the export process.

              Regarding the explicit namespace, I would still suggest using this, a compiled assembly would likely have problems not during export but during an import when you omit the full namespace name.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Hi Jesse.

                Just wanted to give an update and confirmation that you were correct.

                We didn't notice any issues until after we had several dependencies in place using a shared assembly. We could export fine, but importing would cause various errors due to missing enums, etc.

                Once we removed the "using MyNamespace" declarations and switched to the inline "MyNamespace.MyResource" syntax, things worked like a charm.

                Thanks again!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by techgetgame, Today, 11:42 PM
                0 responses
                6 views
                0 likes
                Last Post techgetgame  
                Started by sephichapdson, Today, 11:36 PM
                0 responses
                1 view
                0 likes
                Last Post sephichapdson  
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,612 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Working...
                X