• 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 Tradarr, Today, 06:25 PM
    2 responses
    13 views
    0 likes
    Last Post Tradarr
    by Tradarr
     
    Started by cocopod, Today, 04:47 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_JoshG  
    Started by digibob, Today, 02:47 AM
    2 responses
    14 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by mntemel, Today, 03:31 PM
    4 responses
    23 views
    0 likes
    Last Post mntemel
    by mntemel
     
    Started by mrlucky1x, Today, 03:14 PM
    2 responses
    7 views
    0 likes
    Last Post mrlucky1x  
    Working...
    X