Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8.0.0.7 File Import Issue when DashStyleHelper type used in Input

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

    NT8.0.0.7 File Import Issue when DashStyleHelper type used in Input

    Hi

    I'm using a DashStyleHelper type variable as part of inputs in a custom indicator. This input allows one to change line style. For this following is performed:

    a. in OnStateChange(), within if (State == State.SetDefaults):
    ils_ExtendLineStyle = DashStyleHelper.Solid;

    b. in #region Properties:
    [NinjaScriptProperty]
    [Display(Name="Line Style", Description="Style of extended horizontal line", Order=3, GroupName="Extended Line Properties")]
    public DashStyleHelper ils_ExtendLineStyle
    { get; set; }

    c. Lastly I include DashStyleHelper ils_ExtendLineStyle as part of parameters in functions inside #region NinjaScript generated code, like:
    NT8_Indi NT8Indi(bool onAlert, DashStyleHelper ils_ExtendLineStyle, int ii_PriceTextSize)
    etc.

    The code executes and operates without errors.

    However, when I export the NinjaScript file as compiled assembly, it can't be imported back to the system. Import displays following message:
    "Import Failed. The Ninjascript Archive file may contain duplicate method names that already exist on your PC or there is a required file missing on either your PC or in the input archive."

    Through certain hit and trials, I observed that removing DashStyleHelper type input or changing the variable's datatype allows successful importing of .zip file.

    May someone point out how this issue be resolved while using DashStyleHelper type input.

    Thanks
    Vivek

    #2
    Hello engrvivs,

    Thank you for your post.

    Can you attach or send us (at platformsupport[at]ninjatrader[dot]com) the .zip file you attempt to import?

    Comment


      #3
      Thanks Patrick for response!

      PFA the .zip (and the .cs) file(s) which is exhibiting error on being imported.

      Thanks
      Vivek
      Attached Files

      Comment


        #4
        Originally posted by engrvivs View Post
        Hi

        I'm using a DashStyleHelper type variable as part of inputs in a custom indicator. This input allows one to change line style. For this following is performed:

        a. in OnStateChange(), within if (State == State.SetDefaults):
        ils_ExtendLineStyle = DashStyleHelper.Solid;

        b. in #region Properties:
        [NinjaScriptProperty]
        [Display(Name="Line Style", Description="Style of extended horizontal line", Order=3, GroupName="Extended Line Properties")]
        public DashStyleHelper ils_ExtendLineStyle
        { get; set; }

        c. Lastly I include DashStyleHelper ils_ExtendLineStyle as part of parameters in functions inside #region NinjaScript generated code, like:
        NT8_Indi NT8Indi(bool onAlert, DashStyleHelper ils_ExtendLineStyle, int ii_PriceTextSize)
        etc.

        The code executes and operates without errors.

        However, when I export the NinjaScript file as compiled assembly, it can't be imported back to the system. Import displays following message:
        "Import Failed. The Ninjascript Archive file may contain duplicate method names that already exist on your PC or there is a required file missing on either your PC or in the input archive."

        Through certain hit and trials, I observed that removing DashStyleHelper type input or changing the variable's datatype allows successful importing of .zip file.

        May someone point out how this issue be resolved while using DashStyleHelper type input.

        Thanks
        Vivek
        It is exactly as it says. You are trying to import a file while the source already exists in the file tree. Ergo, duplicate methods. You cannot import an exported file into the source tree.

        Comment


          #5
          Originally posted by koganam View Post
          It is exactly as it says. You are trying to import a file while the source already exists in the file tree. Ergo, duplicate methods. You cannot import an exported file into the source tree.
          Thanks koganam for the response!

          Yes, I agree that while the code is in the compilation tree, the .zip file can't be imported. Thus, what I generally do is to "Exclude from Compilation" the file in NinjaScript Editor. Thereafter, I import that file thru .zip.

          As I mentioned earlier, such method of importing works for all cases, except when I'm having a DashStyleHelper type among input parameters.

          Thanks
          Vivek
          Last edited by engrvivs; 12-25-2015, 12:33 AM.

          Comment


            #6
            Hello Vivek,

            koganam is correct. As you have exported the files they still exist in the installation and importing the exported files creates duplicates and thus conflicts and errors.

            Comment


              #7
              Originally posted by NinjaTrader_PatrickH View Post
              Hello Vivek,

              koganam is correct. As you have exported the files they still exist in the installation and importing the exported files creates duplicates and thus conflicts and errors.
              Hi Patrick

              So, does this means you were able to successfully import the NT8p0p0p7_ImportIssue_Indi.zip file at your end?

              Kind Regards
              Vivek

              Comment


                #8
                Hello engrvivs,

                Can you send the source files that are exported? My import fails, but when I manually import and add the reference I see that the DashStyleHelper could not be found - askign if I am missing an assembly or reference.

                Comment


                  #9
                  Originally posted by NinjaTrader_PatrickH View Post
                  Hello engrvivs,

                  Can you send the source files that are exported? My import fails, but when I manually import and add the reference I see that the DashStyleHelper could not be found - askign if I am missing an assembly or reference.
                  Thanks Patrick for checking the import failure at your end.

                  The source code was also attached earlier as NT8p0p0p7_ImportIssue_Indi.cs file.
                  Please find it attached with current message too.

                  Specifically look for the input variable ils_ExtendLineStyle within the code, which is causing the issue. The importing issue occurs with that .zip, which is exported "as compiled assembly".

                  Thanks for your valuable time.
                  Kind Regards
                  Vivek
                  Attached Files

                  Comment


                    #10
                    Hello engrvivs,

                    I am seeing the exact same issue with any indicator I export into an assembly that calls an enum from NinjaTrader.Gui. I am checking with development on this item.

                    Comment


                      #11
                      Originally posted by NinjaTrader_PatrickH View Post
                      Hello engrvivs,

                      I am seeing the exact same issue with any indicator I export into an assembly that calls an enum from NinjaTrader.Gui. I am checking with development on this item.
                      Thanks Patrick for recognizing and generalizing the issue!

                      Kind Regards
                      Vivek

                      Comment


                        #12
                        Hello Vivek,

                        Thank you for your patience.

                        At the moment the only way around this is via a direct call. For example:
                        Code:
                        public [B]NinjaTrader.Gui.DashStyleHelper[/B] dash
                        { get; set;}

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by rajendrasubedi2023, Today, 09:50 AM
                        0 responses
                        4 views
                        0 likes
                        Last Post rajendrasubedi2023  
                        Started by ender_wiggum, Today, 09:50 AM
                        0 responses
                        1 view
                        0 likes
                        Last Post ender_wiggum  
                        Started by bmartz, Today, 09:30 AM
                        1 response
                        7 views
                        0 likes
                        Last Post NinjaTrader_Erick  
                        Started by geddyisodin, Today, 05:20 AM
                        3 responses
                        23 views
                        0 likes
                        Last Post NinjaTrader_Gaby  
                        Started by lorem, Today, 09:18 AM
                        1 response
                        5 views
                        0 likes
                        Last Post lorem
                        by lorem
                         
                        Working...
                        X