my custom indicator cross over values either dont show or show incorrectly in analyzer for the same time frame, hope you can help. Image of EURGBP shows the cross overs from indicator and column definition yet no signals in analyzer on the right. the code is simply
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Gui.Chart;
#endregion
// This namespace holds all indicators and is required. Do not change it.
namespace NinjaTrader.Indicator
{
/// <summary>
/// Ichimoku Crosses
/// </summary>
[Description("Ichimoku Crosses")]
public class aaIchimokuCross : Indicator
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Overlay = false;
DisplayInDataBox = true;
Add(new Plot(Color.FromKnownColor(KnownColor.Violet), PlotStyle.Line, "Cross"));
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (CrossAbove(IchimokuBasic(9, 26, 52).TenkanSen, IchimokuBasic(9, 26, 52).KijunSen, 1))
{
BackColorAll = Color.LightGreen;
Cross.Set(1);
// DrawTriangleUp("My triangle up" + CurrentBar, false, 0, 0, Color.Lime);
}
// Condition set 2
if (CrossBelow(IchimokuBasic(9, 26, 52).TenkanSen, IchimokuBasic(9, 26, 52).KijunSen, 1))
{
BackColorAll = Color.Violet;
// DrawArrowDown("My down arrow" + CurrentBar, false, 0, 0, Color.Red);
Cross.Set(-1);
}
}
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
public DataSeries Cross
{
get { return Values[0]; }
}
#endregion
}
}
the indicator plots correctly on the chart
Thanks in advance
Juan
Comment