Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Display value from Market Analyzer column to chart as text

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

    Display value from Market Analyzer column to chart as text

    Hi, I have this code for an indicator, that should display a value from a column on the Market Analyzer onto a chart.
    The code is still in development, but I got stuck on line 48 (notes2 = MarketAnalyzer.CurrentInstrument.FullName, as the compiler gives me error mesage code CS0103:

    Code:
    #region Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Forms;
    using System.Xml.Serialization;
    using System.Drawing;
    using NinjaTrader.Core;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    using NinjaTrader.NinjaScript.Strategies;
    #endregion
    
    //This namespace holds Indicators in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Indicators
    {
        public class Noteonchart : Indicator
        {
          private string notes2;
    
            protected override void OnStateChange()
            {
                if (State == State.SetDefaults)
                {
                    Description                                    = @"Displays a note from Market Analyzer onto chart";
                    Name                                        = "Note on chart";
    
                }        
            }
    
            protected override void OnBarUpdate()
            {
            // Get the value from the Market Analyzer's Notes 2 column
                 notes2 = MarketAnalyzer.CurrentInstrument.FullName;
    
    
    
    
            // Display the value on the chart
            Draw.Text(this, "Notes2", notes2, 0, Low[0] - (TickSize * 10));
            }            
    
            }
    
    }
    
    #region NinjaScript generated code. Neither change nor remove.
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
        public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
        {
            private Noteonchart[] cacheNoteonchart;
            public Noteonchart Noteonchart()
            {
                return Noteonchart(Input);
            }
    
            public Noteonchart Noteonchart(ISeries<double> input)
            {
                if (cacheNoteonchart != null)
                    for (int idx = 0; idx < cacheNoteonchart.Length; idx++)
                        if (cacheNoteonchart[idx] != null &&  cacheNoteonchart[idx].EqualsInput(input))
                            return cacheNoteonchart[idx];
                return CacheIndicator<Noteonchart>(new Noteonchart(), input, ref cacheNoteonchart);
            }
        }
    }
    
    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
    {
        public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
        {
            public Indicators.Noteonchart Noteonchart()
            {
                return indicator.Noteonchart(Input);
            }
    
            public Indicators.Noteonchart Noteonchart(ISeries<double> input )
            {
                return indicator.Noteonchart(input);
            }
        }
    }
    
    namespace NinjaTrader.NinjaScript.Strategies
    {
        public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
        {
            public Indicators.Noteonchart Noteonchart()
            {
                return indicator.Noteonchart(Input);
            }
    
            public Indicators.Noteonchart Noteonchart(ISeries<double> input )
            {
                return indicator.Noteonchart(input);
            }
        }
    }
    
    #endregion
    ​
    Hope it is possible to access data from the Market Analyzer according to the linked instrument or any of the specified instruments on the Market Analyzer at all?

    Thanks
    Peter

    #2
    Hello cyberpete76,

    What data are you trying to access? You can't access the market analyzer directly to get data but you can in general get the data it uses. You can also view each of the columns code in the NinjaScript editor if you wanted to see how it collects data.

    Comment


      #3
      I need to collect values I am typing into a column, which is a simple Note (Notes 2 from my screenshot, to be precise)
      Attached Files

      Comment


        #4
        Hello cyberpete76,

        There wouldn't be a way to pass that information to a chart, charts have no means of communicating with columns in the analyzer window. You can launch a chart from the analyzer to the instrument and that chart can have indicators on it but the only data shared between the analyzer and the chart would be the instrument and timeframe based on the linking settings. If you need notes in a chart you would need to use a notes indicator and type in notes to the chart instead of the analyzer.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X