• 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

Add NInjaScriptProperty where user can choose an Indicator

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

    Add NInjaScriptProperty where user can choose an Indicator

    Is it possible to have a property in a custom indicator that will show up in the properties UI and allow the user to open a dialog and choose an indicator? Much like the user can do when choosing the Input Data Series?

    I have tried something like the following.

    Code:
    [Display(Name = "Indicator 1", GroupName = "Parameters", Prompt = "Edit indicator 1...", Order = 0)]
    [PropertyEditor("NinjaTrader.Gui.Tools.InputEditor")]
    [XmlIgnore]
    public ISeries<double> InputIndicator1 { get; set; }
    I can select an indicator in the UI, but I must be missing some steps somewhere because when I debug, the series count is still zero.

    How should I initialize InputIndicator1 in this case?

    FYI: What I'm wanting to do is create a Correlation indicator that can be general purpose in nature by allowing the user to choose any two indicators through the UI. Then my correlation indicator can plot their correlation value.

    Thanks.
    Last edited by Steve L; 04-18-2019, 09:48 PM.
    Steve L
    NinjaTrader Ecosystem Vendor - Ninja Mastery

    #2
    Hello Steve L,

    Thank you for your post.

    It looks like you're probably trying to use the instance of that instance the selector gives you, but that's not going to be the same as calling an indicator. You should be able to use the name of the indicator you get from the selector in a switch statement and then call an indicator like normal.

    I've attached an example of how you could set this up.

    Please let us know if we may be of further assistance to you.
    Attached Files
    Kate W.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by ntbone, Yesterday, 08:10 PM
    0 responses
    7 views
    0 likes
    Last Post ntbone
    by ntbone
     
    Started by chrislou, 08-28-2015, 03:27 AM
    14 responses
    2,881 views
    0 likes
    Last Post nkhoi
    by nkhoi
     
    Started by outofstock, Yesterday, 06:40 PM
    2 responses
    8 views
    0 likes
    Last Post outofstock  
    Started by saeed, Yesterday, 12:32 PM
    3 responses
    40 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by motog4, Yesterday, 11:42 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Working...
    X