Have all errors removed finally but still getting one that I just cannot figure out
"The type or namespace name "TextFormat" could not be found.", line 93, col 13 37
Any help would be appreciated.
#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.Xml.Serialization;
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;
#endregion
//This namespace holds Indicators in this folder and is required. Do not change it.
namespace NinjaTrader.NinjaScript.Indicators
{
public class TimeFrameContinuity : Indicator
{
private Text mytexttool;
private Brush axisColor;
private Gui.Tools.SimpleFont chartFont;
private Brush TimeFrameColor;
private Text TimeframeLabel;
// private Brush Color5M;
// private Brush Color30M;
// private Brush ColorHour;
// private Brush ColorDay;
// private Brush ColorWeek;
// private Brush ColorMonth;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Shows 5/15/30/H/D/W/M Status";
Name = "TimeFrameContinuity";
Calculate = Calculate.OnPriceChange;
IsOverlay = true;
DisplayInDataBox = false;
DrawOnPricePanel = false;
DrawHorizontalGridLines = false;
DrawVerticalGridLines = false;
PaintPriceMarkers = false;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Overlay;
IsSuspendedWhileInactive = true;
BarsRequiredToPlot = 0;
// IsSuspendedWhileInactive = true;
}
else if (State == State.DataLoaded) {
if (ChartControl != null)
{
chartFont = new SimpleFont("Arial", 12) { Bold = true };
}
}
else if (State == State.Configure)
{
}
}
protected override void OnBarUpdate()
{
if(CurrentBar<1) return;
}
protected override void OnRender(ChartControl chartControl, ChartScale chartScale){
if(BarsPeriod.BarsPeriodType != BarsPeriodType.Minute) return;
//Call base.OnRender() to ensure all base behavior is performed
base.OnRender(chartControl, chartScale);
// Instatiate a factory, which is required for the next step
SharpDX.DirectWrite.Factory factory = new SharpDX.DirectWrite.Factory();
//SharpDX.DirectWrite.TextFormat textFormat = new TextFormat(factory, "Arial", 17);
// Instantiate a TextFormat, using our factory
TextFormat format = new TextFormat(factory, "Arial", 17);
// Instantiate a Direct2D1 brush, using the System.Media.Brush Brushes collection
SharpDX.Direct2D1.Brush textBrush = Brushes.Green.ToDxBrush(RenderTarget);
int startPointY=(int)(ChartPanel.H*.9);
int startPointX=15;//(int)(ChartPanel.W*.1);
// Instantiate a rectangle to hold our text
// SharpDX.Rectangle textRectangle7 = new SharpDX.Rectangle(startPointX*7, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle6 = new SharpDX.Rectangle(startPointX*6, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle5 = new SharpDX.Rectangle(startPointX*5, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle4 = new SharpDX.Rectangle(startPointX*4, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle3 = new SharpDX.Rectangle(startPointX*3, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle2 = new SharpDX.Rectangle(startPointX*2, startPointY, 50, 30);
// SharpDX.Rectangle textRectangle1 = new SharpDX.Rectangle(startPointX, startPointY, 50, 30);
// RenderTarget.DrawText("M", format, textRectangle1, textBrush);
// RenderTarget.DrawText("W", format, textRectangle2, textBrush);
// RenderTarget.DrawText("D", format, textRectangle3, textBrush);
// RenderTarget.DrawText("H", format, textRectangle4, textBrush);
// RenderTarget.DrawText("30", format, textRectangle5, textBrush);
// RenderTarget.DrawText("15", format, textRectangle6, textBrush);
// RenderTarget.DrawText("5", format, textRectangle7, textBrush);
}
#region Properties
[Browsable(false)]
[XmlIgnore]
public Series<double> Signal5M
{
get { return Values[0]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> Signal30M
{
get { return Values[1]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> Signal60M
{
get { return Values[2]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> SignalDay
{
get { return Values[3]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> SignalWeek
{
get { return Values[4]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> SignalMonth
{
get { return Values[5]; }
}
#endregion
}
}
#region NinjaScript generated code. Neither change nor remove.
namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private TimeFrameContinuity[] cacheTimeFrameContinuity;
public TimeFrameContinuity TimeFrameContinuity()
{
return TimeFrameContinuity(Input);
}
public TimeFrameContinuity TimeFrameContinuity(ISeries<double> input)
{
if (cacheTimeFrameContinuity != null)
for (int idx = 0; idx < cacheTimeFrameContinuity.Length; idx++)
if (cacheTimeFrameContinuity[idx] != null && cacheTimeFrameContinuity[idx].EqualsInput(input))
return cacheTimeFrameContinuity[idx];
return CacheIndicator<TimeFrameContinuity>(new TimeFrameContinuity(), input, ref cacheTimeFrameContinuity);
}
}
}
namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.TimeFrameContinuity TimeFrameContinuity()
{
return indicator.TimeFrameContinuity(Input);
}
public Indicators.TimeFrameContinuity TimeFrameContinuity(ISeries<double> input )
{
return indicator.TimeFrameContinuity(input);
}
}
}
namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.TimeFrameContinuity TimeFrameContinuity()
{
return indicator.TimeFrameContinuity(Input);
}
public Indicators.TimeFrameContinuity TimeFrameContinuity(ISeries<double> input )
{
return indicator.TimeFrameContinuity(input);
}
}
}
#endregion

Comment