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

Indicator and steategy (dll) together ?

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

    Indicator and steategy (dll) together ?

    Hi !

    I complile and install an indicator (as dll protected), then i compile and install (as dll protected too) an strategy that include (call in the code) the indicator but NT launch an error: "Import Failed: The Ninjascript achive file contains duplicate methods name....."

    I understand the error, and if i unistall the indicator the strategy can be installed.... but i need that both are installed. How could i do it?

    I thought I could not include the indicator in the strategy export process, but is not allowed. The platform include the indicator.

    Thank you very much!
    Last edited by marynja; 07-15-2014, 04:50 PM.

    #2
    Originally posted by marynja View Post
    Hi !

    I complile and install an indicator (as dll protected), then i compile and install (as dll protected too) an strategy that include (call in the code) the indicator but NT launch an error: "Import Failed: The Ninjascript achive file contains duplicate methods name....."

    I understand the error, and if i unistall the indicator the strategy can be installed.... but i need that both are installed. How could i do it?

    I thought I could not include the indicator in the strategy export process, but is not allowed. The platform include the indicator.

    Thank you very much!
    The error probably has little to do with what you surmise here. Do your files contain the same enum declarations, for example? Or a method with the same name and parameters in different files, said method declared to be public?

    Comment


      #3
      Thank you Koganam,

      Yes, i have a public enum declaration out of the namespace in the indicator.
      The strategy include (and call in code) the indicator, then if i install both, NT launch this error and cant permit install the strategy if the indicator was installed.

      This is my indicator code line where i declare the enum object:

      ...
      using System.Windows.Forms;
      using System.Net.NetworkInformation;
      #endregion
      public enum myenum {one, two}
      namespace NinjaTrader.Indicator{
      ....

      And i create a private var:

      private
      myenum var_myenum = myenum .one;



      After i collect in a public parameters var:


      [Description("")]
      [GridCategory("")]
      public
      myenum myEnum{
      get { return var_
      myenum ; }
      set { var_
      myenum = value; }
      }
      Last edited by marynja; 07-09-2014, 02:33 PM.

      Comment


        #4
        Originally posted by marynja View Post
        Thank you Koganam,

        Yes, i have a public enum declaration out of the namespace in the indicator.
        The strategy include (and call in code) the indicator, then if i install both, NT launch this error and cant permit install the strategy if the indicator was installed.

        This is my indicator code line where i declare the enum object:

        ...
        using System.Windows.Forms;
        using System.Net.NetworkInformation;
        #endregion
        public enum myenum {one, two}
        namespace NinjaTrader.Indicator{
        ....

        And i create a private var:

        private
        myenum var_myenum = myenum .one;



        After i collect in a public parameters var:


        [Description("")]
        [GridCategory("")]
        public
        myenum myEnum{
        get { return var_
        myenum ; }
        set { var_
        myenum = value; }
        }
        Have you declared the same enum in the strategy?

        Comment


          #5
          No.
          I only Add the indicator in the strategy for use it:

          Add(myIndicator(myenum.one);

          Comment


            #6
            Other problem i have is how asign a selectable enum value for the indicator in the strategy:

            private myEnum aSelectableValue = myEnum.two;

            Add(myIndicator(aSelectableValue);

            The strategy launch a compile error if i create a new enum for the strategy and pass there.

            THank you

            Comment


              #7
              Originally posted by marynja View Post
              Other problem i have is how asign a selectable enum value for the indicator in the strategy:

              private myEnum aSelectableValue = myEnum.two;

              Add(myIndicator(aSelectableValue);

              The strategy launch a compile error if i create a new enum for the strategy and pass there.

              THank you
              Let's deal with things one at a time. So let me understand this.

              You have an indicator, in which you have declared and used an public enum.
              You have a strategy that uses that indicator.
              The same enum is NOT declared in the strategy.
              You export the strategy.
              You export the indicator.
              You can import one back but not the other.

              Is that correct? Which can you import and which can you not? To where are you trying to import? From the same machine from which you exported these?

              Comment


                #8
                Hi Koganam,

                Yes, its correct.
                I have installed the indicator and i cant install the strategy ( the strategy calls the indicator into its code. The strategy dll include the indicator because in the export process NT needs it. I cant skip this step )

                If i unsinstall the indicator, then the strategy can be install... but i need install both.

                Thanks !
                Last edited by marynja; 07-10-2014, 04:54 AM.

                Comment


                  #9
                  Originally posted by marynja View Post
                  Hi Koganam,

                  Yes, its correct.
                  I have installed the indicator and i cant install the strategy ( the strategy calls the indicator into its code. The strategy dll include the indicator because in the export process NT needs it. I cant skip this step )

                  If i unsinstall the indicator, then the strategy can be install... but i need install both.

                  Thanks !
                  As I asked: "To where are you trying to import? From the same machine from which you exported these?"

                  Comment


                    #10
                    Originally posted by marynja View Post
                    Hi Koganam,

                    Yes, its correct.
                    I have installed the indicator and i cant install the strategy ( the strategy calls the indicator into its code. The strategy dll include the indicator because in the export process NT needs it. I cant skip this step )

                    If i unsinstall the indicator, then the strategy can be install... but i need install both.

                    Thanks !
                    Hello marynja,

                    Are there other indicators in the Indicator DLL that are not in the Strategy DLL.

                    I ask, because if it is just the Indicator and the same one is in the Strategy DLL you would only need to import the Strategy. The Indicator would become available as well as the strategy.
                    Cal H.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by koganam View Post
                      As I asked: "To where are you trying to import? From the same machine from which you exported these?"
                      No, the machine is different.


                      Originally posted by NinjaTrader_Cal View Post
                      Hello marynja,

                      Are there other indicators in the Indicator DLL that are not in the Strategy DLL.

                      I ask, because if it is just the Indicator and the same one is in the Strategy DLL you would only need to import the Strategy. The Indicator would become available as well as the strategy.
                      Ok, its all right.

                      Please, could you help me to send a enum strategy object to the indicator in the Add() function? If i create a enum object into the strategy and try to send to the indicator NT complier launch an error.

                      For example:

                      private myEnum aSelectableValue =
                      myEnum.two;

                      Add(myIndicator(aSelectableValue);


                      Thank you !

                      Comment


                        #12
                        Originally posted by marynja View Post
                        No, the machine is different.




                        Ok, its all right.

                        Please, could you help me to send a enum strategy object to the indicator in the Add() function? If i create a enum object into the strategy and try to send to the indicator NT complier launch an error.

                        For example:

                        private myEnum aSelectableValue =
                        myEnum.two;

                        Add(myIndicator(aSelectableValue);


                        Thank you !
                        myIndicator must have all of its inputs specified: there is only an instance constructor.

                        Comment


                          #13
                          Originally posted by koganam View Post
                          myIndicator must have all of its inputs specified: there is only an instance constructor.
                          Yes Koganam, i know, its only an example !
                          The error launched is CS1503, the original indicator object seems different to the strategy send object

                          Some idea?
                          Last edited by marynja; 07-12-2014, 04:13 AM.

                          Comment


                            #14
                            Originally posted by marynja View Post
                            Yes Koganam, i know, its only an example !
                            The error launched is CS1503, the original indicator object seems different to the strategy send object

                            Some idea?
                            That particular error means exactly what I already said. You must pass the correct parameters when you instantiate the class, and they must be in the correct order and of the correct type.

                            Comment


                              #15
                              I think no, because if i pass the value of the indicators enum object all work correclty, for example:

                              Add(myIndicator(myEnum.One);

                              but if i pass the strategy enum object the error is launched :

                              Add(myIndicator(aSelectableValue);

                              And i dont understand because aSelectableValue is a enum object too...

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by nandhumca, Yesterday, 03:41 PM
                              1 response
                              12 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by The_Sec, Yesterday, 03:37 PM
                              1 response
                              11 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by vecnopus, Today, 06:15 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post vecnopus  
                              Started by Aviram Y, Today, 05:29 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Aviram Y  
                              Started by quantismo, 04-17-2024, 05:13 PM
                              3 responses
                              27 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X