• 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

user defined input parameters in an AddOn

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

    user defined input parameters in an AddOn

    Hi,

    Is it possible to have user defined input paremeters within an AddOn?

    Using the sample AddOn code I have tried to add a parameter to:

    Code:
    protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                  Description = "Example AddOn demonstrating some of the framework's capabilities";
    	      Name        = "AddOn Framework";
    	      Round					= false;
                }
            }
    and to properties:

    Code:
    #region Properties
            [NinjaScriptProperty]
            [Display(Name = "Round", Description = "Round", Order = 1, GroupName = "Parameters")]
            public bool Round
            { get; set; }
    #endregion
    However I am not able to get the properties/property grid to appear from context menu when right clicking tab/window.

    #2
    Hello michaeldim,

    It is possible to add public properties to an Addon, however, an addon window will have the contents you design. There is not a premade property grid window (such as the Indicators window or Strategies or Properties windows on charts) for addons.

    It is possible to add one to your script.

    Attached is an example of a property grid from a custom class.

    As values are changed these actively change the values of the class.
    If you wanted an OK and Cancel button, you'd need to make a copy class and change the values in the copy, and then when clicking ok, set the original values to copy values.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      This example addon requires a reference to:
      Code:
      *ProgramFiles*\NinjaTrader 8\bin64\System.Windows.Controls.WpfPropertyGrid.dll
      I've re-exported with added reference to this in the AdditionalReferences.txt file to allow the reference to be added automatically when importing.
      Attached Files
      Last edited by NinjaTrader_ChelseaB; 11-22-2016, 09:27 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by U0000999, Today, 03:09 AM
      0 responses
      1 view
      0 likes
      Last Post U0000999  
      Started by U0000999, Today, 02:54 AM
      0 responses
      1 view
      0 likes
      Last Post U0000999  
      Started by U0000999, Today, 02:36 AM
      0 responses
      1 view
      0 likes
      Last Post U0000999  
      Started by AresBowman, Today, 12:02 AM
      0 responses
      2 views
      0 likes
      Last Post AresBowman  
      Started by patpat, Yesterday, 10:14 PM
      1 response
      3 views
      0 likes
      Last Post NinjaTrader_ChrisSch  
      Working...
      X