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

NinjaScript export: how automatically include to zip all required files?

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

    NinjaScript export: how automatically include to zip all required files?

    Hello.

    In NT7, if we exporting NinjaScripts, all required filed included automatically please, look at screenshot).
    How to do it in NT8?

    I am ascing, because, I have indicator, that use about 15 another indicators with different names + my own .cs libraries. While coding, I need to export it, may be 20 times, may be more.
    Attached Files
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thanks for opening the thread.

    Exporting a NinjaScript will automatically add any dependent indicators that are used in the NinjaScript you are exporting. This is the expected behavior for NinjaTrader 7 and NinjaTrader 8. If you are seeing something contrary, please let us know.

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

    Comment


      #3
      Hello, Jim, thank You for Your answer.
      I tried some times and see behaviour, contrary to expected:

      Error compiling export assembly: c:\Users\av240\Documents\NinjaTrader 8\bin\Custom\Indicators\XXXX.cs(1805,900) : error CS0246: The type or namespace name 'Skin_enum' could not be found (are you missing a using directive or an assembly reference?)

      I tried both: export source code and compiled assembly - with same result.
      Attached Files
      Last edited by fx.practic; 08-04-2017, 02:38 PM.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        Thanks for the reply.

        Without the code, I can only speculate on the issue. Generally it is advised to use the fully qualified namespace for using custom types rather than using "using" statements at the top of the NinjaScript file for exporting.

        If Skin_enum belongs to another namespace than the indicator, I would suggest to include that full namespace for instances in your code.

        My colleague Jesse has shared a demo script that may prove useful: http://ninjatrader.com/support/forum...25&postcount=2

        If this doesn't resolve your inquiry, could you write in to platformsupport [at] ninjatrader [dot] com with the text "Attention Jim," the thread URL, and the source code you are trying to export so we can take a look together?

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

        Comment


          #5
          Thank You for answer.
          I will try.

          And I want to mention, that In NT7 there no need to use full names.
          I have now about 100 lines of code on screen width exactly.
          If i will add long names - it become a nightmare mess....

          May I announce suggestion to make possible correct exporting with short names for classes, included by using statement?
          Last edited by fx.practic; 08-05-2017, 04:50 AM.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment


            #6
            Hello fx.practic,

            Yes, it may be tedious and inconvenient to make all of the naming convention changes to work around this issue.

            You should be able to resolve these issues by including the source file that contains the namespace with the export. For example, the attached script will reference the namespace from MyCustomNamespaceExample. It can only be exported when that source file is included.

            You also mentioned that you are including your own libraries. If you include the library as a DLL and include a reference in your code, do you still see the errors while exporting?

            Please let me know if I can be of further help.
            Attached Files
            JimNinjaTrader Customer Service

            Comment


              #7
              As I understand, I have only 2 options:
              - to add all needed files manually while exporting;
              - to use "long names".

              Correct?

              I never used dll at the moment; under "libraries" I mean .cs files in AddOns folder, that contains my own classes and enums.

              By the way, after importing Your example, in NinjaScript Explorer MyNamespace folder was't created, but MyNamespace folder appears in Indicator dialogue (please, look at screenshot).

              Is this expected behaviour?
              Attached Files
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                Hello fx.practic,

                You should still be able to use using statements as long as the reference exists. My initial reply was more of a general workaround, and was speculative. When you include this AddOn that includes the namespace for Skin_enum, do you get errors?

                Thanks for the question on the folder system. When you create a folder in the NinjaScript editor it represents an actual folder in the appropriate bin/Custom/ folder. When you create a sub namespace, the NinjaScripts inside that namespace will be organized in a "folder" when you add them in an indicator dialog window or the Strategy Analyzer. This isn't a real folder, but just a container for the NinjaScripts in the namespace.

                A folder was not made in the NinjaScript Editor when importing the attached script because a subfolder was not created to hold that .cs file.

                I look forward to being of further help.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  If I add add-on, that hold Skin_enum, in export list manually - export performs normally.

                  But, month ago, I made indicator + strategy for my client, that use about 15 different indicators with different names (real zoo). In NT8 it would be become just hell.

                  Thank You for clarification about folders. I am understand each description, but can't predict how they will work in new situation.

                  Can I suppose, that normal workflow to create folders in editor manually each time after importing scripts with namespaces? (I allude on possible convenience of automatic folder creation in NS Explorer)
                  Last edited by fx.practic; 08-07-2017, 11:27 AM.
                  fx.practic
                  NinjaTrader Ecosystem Vendor - fx.practic

                  Comment


                    #10
                    Thanks for the reply.

                    If you would like to place your NinjaScripts in certain folder in the NinjaScript Editor, you will have to create a subfolder in the editor or in Windows Explorer. NinjaTrader will not create a subfolder when it sees a sub namespace, these are handled differently.

                    I will submit a feature on your behalf asking that NinjaScripts with their own sub namespaces get automatically placed in their own subfolders. I'll update this post/thread with the ticket ID when I receive it.

                    EDIT: The ticket ID for the feature request is SFT-326.

                    This feature's implementation can be found in the Release Notes of the version of NinjaTrader 8 that includes the feature. You can find the Release Notes here: https://ninjatrader.com/support/help...ease_notes.htm

                    Feature requests are fulfilled based on our development team's schedule and priorities and we cannot provide a time frame for it to become available.
                    Last edited by NinjaTrader_Jim; 08-10-2017, 08:13 AM.
                    JimNinjaTrader Customer Service

                    Comment


                      #11
                      Thank You.
                      fx.practic
                      NinjaTrader Ecosystem Vendor - fx.practic

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by sightcareclickhere, Today, 01:55 PM
                      0 responses
                      1 view
                      0 likes
                      Last Post sightcareclickhere  
                      Started by Mindset, 05-06-2023, 09:03 PM
                      9 responses
                      258 views
                      0 likes
                      Last Post ender_wiggum  
                      Started by Mizzouman1, Today, 07:35 AM
                      4 responses
                      18 views
                      0 likes
                      Last Post Mizzouman1  
                      Started by philmg, Today, 01:17 PM
                      1 response
                      8 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Started by cre8able, Today, 01:01 PM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Working...
                      X