Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Edit Strategy; Custom Property Settings

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

    Edit Strategy; Custom Property Settings

    From the Strategies Tab, right clicking on any added strategy, give the menu option to "Edit Strategy....". This menu option provides a popup dialog box that allow the user the ability to change strategy parameter properties.

    Instead of hard coding the trade management (order details, % stop loss, instrument, etc.), I'd like to add some custom Strategy Properties to this dialog box. Are there any Ninjascript examples showing how to do this?

    Thanks, borland

    #2
    Hi borland, yes - you can add user defined inputs to your scripts as shown in this tip here - http://www.ninjatrader.com/support/f...ead.php?t=5782

    Comment


      #3
      Thanks Bertrand!

      That's a great tip. I now see it in the Tips and Tricks topic of this forum. That clarifies for the user manually entering a specific value of a parameter.

      What about for parameters that the user selects from a dropdown pick list (e.g., 0, 1, 2)?

      Or pick list for a bool (True, False)?

      Or, further, a String case, (e.g., list of three options: "by account size", "by account quantity", "by strategy") ?

      How could I modify the example for those?

      Code:
       
      [Description("Numbers of bars used for calculations")]
      [GridCategory("Parameters")]
      public int Period
      {
           get { return period; }
           set { period = Math.Max(1, value); }
      }
      Last edited by borland; 04-04-2012, 01:52 PM.

      Comment


        #4
        borland,

        I am happy to assist you on behalf of Bertrand.

        Code:
        [Description("Numbers of bars used for calculations")]
        [GridCategory("Parameters")]
        public bool Flag
        {
             get { return flag; }
             set { period = value; }
        }
        Is an example for a boolean.

        If you need to use a drop down menu, this isn't specifically supported but some people have made such indicators. It requires a bit more object oriented programming.

        I would suggest downloading such an indicator and exploring how they do it.

        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Adam,

          Thanks, that code example does provide a dropdown pick list for True/False. And just by changing from int to bool.

          Indicators? I'm not sure you understood the topic which is modifying the 'Edit Strategy' dialog parameter options listing. I did look at the sample NT7 'Strategies' files in the File Sharing section of this forum. None of those cs files provide parameter examples using pick lists.

          I will try poking some with C# Indexers, but I don't know how NT parses what's passed to switch the parameter form from entry field, to a list box.
          Last edited by borland; 04-04-2012, 06:23 PM.

          Comment


            #6
            GM borland, I think you're looking for an enum switch?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            639 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            366 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            572 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X