• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Export Error Due To Custom Indicator Folder

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

    Strategy Export Error Due To Custom Indicator Folder

    I am able to individually export any indicator I create. Exporting strategies works fine as well, but only as long as indicators used within the strategy are located in the main indicator section.

    When I create a custom folder for indicators I create each indicator can be exported just fine. I just cannot use them in a strategy and hope to export that strategy. It is the fact that these indicators are located in a custom folder that prevents the export.

    Must be missing some special code to let the export compiler know where these indicators are located.

    The exact error Msg reads: 12/9/2019 6:52:21 AM,Default,Error compiling export assembly: c:\Users\texas\Documents\NinjaTrader 8\bin\Custom\Strategies\D28renko.cs(3050) : error CS0234: The type or namespace name 'Dtox' does not exist in the namespace 'NinjaTrader.NinjaScript.Indicators.D18' (are you missing an assembly reference?),

    NOTE: "NinjaTrader.NinjaScript.Indicators.D18"
    D18 is the name of my custom folder to hold the custom indicators

    #2
    Hello Trexxx,

    Thank you for your note.

    Putting the strategies in a custom folder without changing the namespace in the code accordingly would result in this error.

    Up near the top of your script you should see something like

    Code:
    namespace NinjaTrader.NinjaScript.Indicators
    To be able to move the scripts in this namespace to a subfolder, you need to give them a namespace within that indicators namespace that is named the same as the subfolder.. So, if I wanted to put an indicator in a folder called NT_Kate (for me), I would change this in the NinjaScript Editor to:

    Code:
    namespace NinjaTrader.NinjaScript.Indicators.NT_Kate
    I would then compile and it should then recognize where the file is by the namespace.

    Please let us know if we may be of further assistance to you.

    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Thank you Kate.

      The top of my code for the indicator called "Dtox" shows the follow code, starting at line 25:

      Code:
      namespace NinjaTrader.NinjaScript.Indicators.D18
      {
          public class Dtox : Indicator
          {
      Seems to me that it already is calling out the folder called "D18".

      Comment


        #4
        Hello Trexxx,

        Thank you for your reply.

        When you say there's a folder, is this just a folder you see in the NinjaScript Explorer within the NinjaScript Editor, or is it also physically located in a folder with the same name in your Documents > NinjaTrader 8 > bin > Custom > Indicators folder?

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          My folder named "D18" is physically located within the parent folder named "Indicators".

          Click image for larger version

Name:	IndicatorFolders.jpg
Views:	24
Size:	39.5 KB
ID:	1080391

          Comment


            #6
            Updated Info:

            [1] I recreated my custom indicator, but this time it was saved within the main Indicators folder and not a custom folder. Next, I recreated my strategy using that same indicator and everything exported just fine.

            My goal was to verify that this is not a coding issue but a folder issue instead. So yes, this is a folder issue of some sort.


            [2] Next I built a brand new strategy. The strat used only indicators not located in custom folders, but only within the main Indicators folder. The strat exported just fine.

            Then I altered that strat by adding another indicator, one that was located in a custom folder. It would not export.

            ---------

            By process of elimination I believe it is some sort of folder issue causing the export problems. And I also have a hunch that this problem has noting to do with NinjaTrader but is somehow tied to the underlying MicroSoft dotNET platform. Seems I remember a few years back having a dotNET issue when dragging files into or out of custom folders. Just a hunch.

            Comment


              #7
              Hello Trexxx,

              Thank you for your reply.

              It sounds like you're relying on the export to add the indicator for you rather than including it in the list of files to be exported.

              Add both the strategy and the indicator that's in the D18 namespace in the export dialogue, then say yes if it prompts you to include any additional necessary indicators. Are you able to export then?

              Thanks in advance; I look forward to assisting you further.
              Kate W.NinjaTrader Customer Service

              Comment


                #8
                Hello Kate,

                Oh my, that did the trick.

                So yes, I was just relying upon the export tool to select the proper indicator files for me automatically. I simply checked the box for the strategy name and knew the export would take along with it any indicators required by the strategy. I've seen it do it many times before.

                There is no warning to tell me the export manager cannot pickup any indicators in custom folders. I guess you just have to know how to avoid that type of export error.

                I really do appreciate you help. Mystery solved.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by sidlercom80, Today, 12:29 PM
                2 responses
                20 views
                0 likes
                Last Post fx.practic  
                Started by itrader46, Today, 02:49 PM
                3 responses
                11 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by m94306, Today, 03:01 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Heath  
                Started by fx.practic, Today, 02:54 PM
                3 responses
                10 views
                0 likes
                Last Post fx.practic  
                Started by MarianApalaghiei, 07-14-2019, 04:00 AM
                5 responses
                62 views
                0 likes
                Last Post koganam
                by koganam
                 
                Working...
                X