• 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

How to pass parameters to custom indicator?

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

    How to pass parameters to custom indicator?

    let's say, i am adding custom indicator in my primary indicator.


    Add(OtherCustomIndi());

    however, i need to pass arguments in it. The source of `OtherCustomIndi` is:
    Code:
            #region Properties
            [Browsable(false)]
            [XmlIgnore()]
            public DataSeries Bullish_upper_Line
            {
                get { return Values[0]; }
            }
    
            [Browsable(false)]
            [XmlIgnore()]
            public DataSeries Bullish_lower_Line
            {
                get { return Values[1]; }
            }
    
    	[Description("")]
            [GridCategory("Parameters")]
            public bool Use_Different_timeframe
            {
                get { return use_different_timeframe; }
                set { use_different_timeframe =  value; }
            }
    		
            [Description("")]
            [GridCategory("Parameters")]
            public int Different_timeframe
            {
                get { return different_timeframe; }
                set { different_timeframe = Math.Max(1, value); }
            }


    so, when I do :

    Add(OtherCustomIndi(true, 24));

    it fails.
    In what order I should pass arguments? how should i modify the source of that indi, i cant understand... Does [Gridcategory] tag means, that is only those properties can be set from outside? and what is the order? does [Browsable(false)] tag makes other properties to be ignored in sequence?
    Last edited by ttodua; 09-29-2017, 08:47 AM.

    #2
    Hello,

    Thanks for the post.

    What error are you receiving at compile time? When you type in the indicator constructor and add the parentheses, intelliprompt will show you all available constructors.

    Here is a post with samples of how to sequence your parameters:
    https://ninjatrader.com/support/foru...ead.php?t=4770

    I look forward to your reply.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      1) no, that topic doesnt mention anything about calling from external scripts.


      2) please, clarify this too:
      Does [Gridcategory] tag means, that is only those properties can be set from outside? and what is the order? does [Browsable(false)] tag makes other properties to be ignored in sequence?
      MANY THANKS!

      Comment


        #4
        Does [Gridcategory] tag means, that is only those properties can be set from outside?
        No. It means that those properties are the only ones that you can set/change from the PropertyGrid.
        does [Browsable(false)] tag makes other properties to be ignored in sequence?
        No. It means that those properties are not visible in the PropertyGrid, and so cannot be adjusted from there. You can set any public property or field from outside the class.

        Comment


          #5
          and please mention, how can i determine what sequence should i use while passing parameters?

          Comment


            #6
            Hello,

            Thanks for the reply.

            If you type in the constructor of your indicator in the script, Intelliprompt will show you the order in which the parameters should be listed.

            When the code is compiled, there is an overload function call for every possible parameter list. So you should be able to list through these function calls with IntelliPrompt.

            When you type in the opening '(' Intelliprompt will show you the overloads. Or you can do CTRL+SHIFT+SPACE to bring up Intelliprompt.

            If you require further assistance, please post your script.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Dagamos, Today, 11:48 AM
            1 response
            9 views
            0 likes
            Last Post NinjaTrader_RyanS  
            Started by kantkant2, Yesterday, 03:20 PM
            4 responses
            25 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Started by EnveousColnago, Today, 11:50 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_ShawnB  
            Started by Skyfly1715, 01-20-2020, 03:36 PM
            4 responses
            34 views
            1 like
            Last Post eDanny
            by eDanny
             
            Started by Cyanez, Yesterday, 05:05 PM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Working...
            X