code is:
using System;
using System.Linq;
using System.Windows.Forms;
using NinjaTrader.Core;
using NinjaTrader.Gui.Chart;
namespace MyClocks
{
public class Maclock : Indicator
{
private DateTime chicagoTime;
private DateTime madridTime;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = "My Indicator";
Name = "Maclock";
}
else if (State == State.DataLoaded)
{
chicagoTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTim e.Now, TimeZoneInfo.Local.Id, "Central Standard Time");
madridTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTim e.Now, TimeZoneInfo.Local.Id, "Central European Standard Time");
}
}
protected override void OnPaint(ChartPaintEventArgs e)
{
base.OnPaint(e);
chicagoTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTim e.Now, TimeZoneInfo.Local.Id, "Central Standard Time");
madridTime = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTim e.Now, TimeZoneInfo.Local.Id, "Central European Standard Time");
var timeChicago = chicagoTime.ToString("HH:mm");
var timeMadrid = madridTime.ToString("HH:mm");
var text = "Chicago: " + timeChicago + " Madrid: " + timeMadrid;
e.Graphics.DrawString(text, new System.Drawing.Font("Arial", 12), new System.Drawing.SolidBrush(System.Drawing.Color.Bla ck), new System.Drawing.PointF(ChartControl.CanvasRight - e.Graphics.MeasureString(text, new System.Drawing.Font("Arial", 12)).Width - 10, ChartControl.CanvasTop + 10));
}
}
}
get foolwing errors
The type or namespace name 'ChartPaintEventArgs' could not be found (are you missing a using directive or an assembly reference?) |
The type or namespace name 'Core' does not exist in the namespace 'NinjaTrader' (are you missing an assembly reference?) |
The type or namespace name 'Indicator' could not be found (are you missing a using directive or an assembly reference?) |
any idea how solve it? thnak you for your support
Comment