Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Determine user selected indicator plot series name

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

    Determine user selected indicator plot series name

    Hi there,

    I successfully implemented custom indicator logic to allow a user to select a price series which then causes associated information to be displayed within the NinjaScript Output window. The code I used is based on the following pseudo code modeled after code I obtained from your support portal:

    [NinjaScriptProperty]
    [PropertyEditor("NinjaTrader.Gui.Tools.InputEditor" )]
    [Display(Name = "Price Series", Description = "Price Series", Prompt = "Edit...", Order = 00, GroupName = TestGroupName)]
    [XmlIgnore]
    public ISeries<double> PriceSeries
    { ... }

    [Browsable(false)]
    public string PriceSeriesSerialize
    {
    get
    {
    return (PriceSeries != null && PriceSeries.GetType() == typeof(PriceSeries)) ? (PriceSeries as PriceSeries).PriceType.ToString() : null;
    }
    set
    {
    PriceSeries = new ISeries<double>[7] { Close, High, Low, Median, Open, Typical, Weighted }.Where(se => (se as PriceSeries).PriceType.ToString() == value).First();
    }
    }

    Within State.DataLoaded:

    // If a price series is not selected, set to null to prevent use
    if (PriceSeries != null && PriceSeries.GetType() != typeof(PriceSeries))
    PriceSeries = null;

    if (PriceSeries != null)
    Print("Price Series Name: " + PriceSeriesSerialize);


    I'm now trying to implement the same pattern of code however for a user selected plot series (e.g. for the RSI indicator's Avg plot series). I'd like to output the name of the user selected plot series name (e.g. Avg) however I'm not sure about the casting check to use (e.g. PlotSeries.GetType() != typeof(Series<double>)) nor sure of what logic to implement within a PlotSeriesSerialize serializer method. Phrased a different way, I'm trying to obtain the series name that is displayed at the end of the InputEditor UI component (e.g. "RSI(SPY (1 Minute), 14, 3).Avg"), specifically its trailing "Avg" text).

    Can you help? Below is some code that doesn't work that I'm hopeful you can help with.

    [NinjaScriptProperty]
    [PropertyEditor("NinjaTrader.Gui.Tools.InputEditor" )]
    [Display(Name = "Plot Series", Description = "Plot Series", Prompt = "Edit...", Order = 01, GroupName = TestGroupName)]
    [XmlIgnore]
    public ISeries<double> PlotSeries
    { ... }

    [Browsable(false)]
    public string PlotSeriesSerialize
    { ? }

    Within State.DataLoaded:

    // If a plot series is not selected, set to null to prevent use
    if (PlotSeries != null && PlotSeries.GetType() != typeof(Series<double>))
    PlotSeries = null;

    if (PlotSeries != null)
    Print("Plot Series Name: " + PlotSeriesSerialize);


    Thanks!

    #2
    Hello caryc123,

    This falls into undocumented territory. Unfortunately, I do not have a recommended approach for this.

    A suggestion may be into instead use an Enum and have some preset series or indicators to select from.


    This thread will remain open for any community members that may know of an undocumented approach for this.
    Last edited by NinjaTrader_ChelseaB; 05-02-2022, 11:43 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your quick reply. Is there any documentation on the property editor NinjaTrader.Gui.Tools.InputEditor I can review?

      Comment


        #4
        Hello caryc123,

        The NinjaTrader.Gui.Tools.InputEditor property editor is not documented.
        This was something the support team stumbled upon that we have been happy to share.

        Below is a link to the help guide with the official supported attribute tags.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks for sharing a link to supported attribute tags. I implemented reflection code to get public properties associated with PropertyEditorAttribute and InputEditor objects however couldn't find a property that contained the user-selected indicator plot name (e.g. Avg from MADC indicator). Can you please submit a feature request to expose the plot name that is displayed within the editor? Better yet, if you could ask one of your internal software developers for their thoughts, perhaps they can share some reflection (or similar) code snippets to help me dig deeper. Thanks again for your help.

          Comment


            #6
            Hello caryc123,

            This request for the indicator plot name to be available in NS is being tracked with ID# SFT-5576.

            Please note, we receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing, so we cannot offer an ETA or promise of fulfillment.

            When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number may be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

            Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X