• 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


      #3
      Hello,
      Like SampleIndicatorInput, would be possible within strategy set a property with a "CollectionEditor" that holds indicators?
      Thanks.

      Comment


        #4
        Hello Optiondreamer,

        Thank you for your reply.

        What are you trying to achieve within your strategy with the indicators? Are you wanting something that allows the user to select the indicator from a list of options? If you give more detail it will help me give you the best answer.

        Thanks in advance; I look forward to assisting you further.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hello Kate,
          Thank you for your reply. The goal is that user can select one or more indicators, like when loaded in a chart, and will be saved in a collection to use in the strategy or indicator. All the indicators would have a common/single "Series" to allow call and get its value within strategy/indicator.

          Comment


            #6
            Hello Optiondreamer,

            Thank you for your reply.

            This would be extremely complex if you're trying to select from all the indicators on your platform. Many indicators use additional data series that the hosting script would also need to load, some cannot be used within other indicators, and so on.

            I note you've previously explored being able to add indicators through an addon, and my response here would be roughly the same as Jim's was to that inquiry.

            If you just want them to be able to choose from a list of a few indicators that are then called and used for calculations, this divergence spotter indicator from our User App Share uses an enum to choose from the various indicator options to use for its calculations:

            https://ninjatraderecosystem.com/use...e-spotter-nt8/


            Please let us know if we may be of further assistance to you.

            The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.



            Kate W.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Hurrikane, Today, 09:18 PM
            0 responses
            1 view
            0 likes
            Last Post Hurrikane  
            Started by Mebjan, Today, 08:52 PM
            0 responses
            4 views
            0 likes
            Last Post Mebjan
            by Mebjan
             
            Started by Fness2020, Today, 08:29 PM
            0 responses
            11 views
            0 likes
            Last Post Fness2020  
            Started by andrewtrades, Today, 08:24 PM
            0 responses
            2 views
            0 likes
            Last Post andrewtrades  
            Started by Eric M., Today, 05:25 PM
            1 response
            17 views
            1 like
            Last Post NinjaTrader_EricB  
            Working...
            X