Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

indicator parameters on instance creation

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

    indicator parameters on instance creation

    I have a question concerning indicator parameters.

    There is something strange concerning the indicator parameters when I new up an instance in an indicator.

    For example I have an indicator that has public properties but when I create a new instance of that indicator in an another indicator I don't have to write parameters.

    Ex ind = new ind():

    After if I want to put values in the properties I go this way :

    ind.x = y;
    ind.x = y;

    etc ...

    I have another indicator which has about the same number of parameters but when I create a new instance of that indicator I have to enter all parameters.

    Ex ind = new ind(x,x,x,x,x,x,x,x,x,x,x,x);

    Could you tell what I am missing here !

    Thank you

    #2
    Sorry that was a silly question.
    I have solved my problem.

    Comment


      #3
      Glad you were able to answer your question. Please let me know if you need anything else.
      MatthewNinjaTrader Product Management

      Comment


        #4
        Yes Matthew.

        I thought I have found my problem but I was wrong.

        Here is my problem :

        There is something strange concerning the indicator parameters when I refer an indicator from another indicator.

        For example I have an indicator that has public properties but when I refer to that indicator from another another indicator I don't have to write parameters.

        Example :
        in variables :
        indicator MyIndicator = null;

        in my code :
        MyIndicator = indicator():

        After if I want to put values in the properties I go this way :

        MyIndicator.x = y;
        MyIndicator.x = y;

        etc ...

        I have another indicator which has about the same number of parameters but when I refer to that indicator I have to enter all parameters.

        MyIndicator = new indicator(x,x,x,x,x,x,x,x,x,x,x,x);

        Could you tell what I am missing here !

        Thank you

        Comment


          #5
          This is really something very strange to me.

          I have two indicators that have many properties.

          They both look alike but when I refer them from another indicator here is what I get :

          From my calling indicator :

          Code:
          #Variables
          
          private Indicator1   ind1         = null;
          private Indicator2   ind2         = null;
          
          
          if ( ind1 == null )
          {
                ind1 = Indicator1();
                ind.prop1 = prop1;
                ind.prop2 = prop2;
          }     
          
          if (  ind2 == null )
          {
                ind2 = Indicator2();
                ind2.prop1 = prop1;
                ind2.prop2 = prop2;
          }
          In indicator2
          ind2 = Indicator2() doesn't work I have to enter all parameters Indicator2(x,x,x,x)

          I have an object not set to an instance of the object error..

          I am completely lost.

          Could you help
          Last edited by blar58; 05-01-2012, 07:33 AM.

          Comment


            #6
            Hello,

            Crossed communication between two running indicators is an area that not supported in NinjaTrader. We provide methods of getting values from another indicators output. The framework for doing this is already there for you and you do not need to initiate any new indicators.

            Simply call Indicator2(Param1,Param2,etc)[0] and you will get the plotted value for indicator 2 in your script.

            You can access other values as well as such Indicator2(Param1,Param2,etc).NameOfProperty[0]

            If you would like to assign these indicator parameter in another manner, we unfortunately would not be able to provide support for these methods.
            Last edited by NinjaTrader_Matthew; 05-01-2012, 08:53 AM.
            MatthewNinjaTrader Product Management

            Comment


              #7
              Matthew,

              My question is only why when I refer to an indicator I get an Object not set to an instance of that object error.

              I cannot called my indicator even if I refer to it.

              Comment


                #8
                Matthew

                I found out a problem in the indicator I was reffering to.

                Sorry...


                Thanks

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by JTizz, Today, 01:20 PM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by omermirza, Today, 12:39 PM
                2 responses
                11 views
                0 likes
                Last Post omermirza  
                Started by mballagan, Today, 01:02 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_Kate  
                Started by larkmail, Today, 12:30 PM
                1 response
                7 views
                0 likes
                Last Post NinjaTrader_Kate  
                Started by Danila, Today, 11:08 AM
                1 response
                11 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Working...
                X