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:#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
Thanks
Peter

Comment