Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Attach order placed by Add-On to any indicator on chart programmatically

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

    Attach order placed by Add-On to any indicator on chart programmatically

    Hello,

    I have following steps:
    1 - placing order from add-on - works.
    2 - can find and get properties of any indicator on any chart from add-on - works.
    3 - I would like to attach target limit order to specific 3rd party indicator that is on the chart, while that order was placed from custom add-on. I am able to attach that order to this custom indicator manually, however, would like to do if programmatically (after certain delay once this order is placed - change it to attach to indicator).

    Is it possible even if unsupported?

    Thanks

    #2
    Hello music_p13,

    Thanks for your post.

    You would need to be able to actively read the indicator's plot value after you found the chart and indicator plot that you want to follow.

    You could try accessing the Values collection of found indicators.

    See the help guide documentation for more information:
    Indicators Collection: https://ninjatrader.com/support/help...indicators.htm
    Values: https://ninjatrader.com/support/help...nt8/values.htm

    Also, see the code sample below which may help get you started. The code below demonstrates looping through the indicator collection.

    Code:
    else if (State == State.DataLoaded)
    {
        foreach (var window in NinjaTrader.Core.Globals.AllWindows)
        {
            // check if the found window is a Chart window, if not continue looking
            if (!(window is NinjaTrader.Gui.Chart.Chart)) continue;
    
            window.Dispatcher.InvokeAsync(new Action(() =>
            {
                // try to cast as a Chart, if it fails it will be null
                var foundChart = window as NinjaTrader.Gui.Chart.Chart;
    
                // make sure we found a chart
                if (foundChart == null) return;
    
                // make sure the found chart is the owner window
                if (foundChart != this.Owner as NinjaTrader.Gui.Chart.Chart) return;
    
                // Instantiate indicator collection
                ChartObjectCollection<NinjaTrader.Gui.NinjaScript. IndicatorRenderBase>  indicatorCollection = foundChart.ActiveChartControl.Indicators;
    
                 // Loop through indicators in collection
                 foreach (Indicator indi in indicatorCollection)
                      Print(indi.Name);
    
             }));
    
         }
    }
    Let us know if we may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    333 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X