namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public class RJCCustomMAColumn : MarketAnalyzerColumn
{
#region Variables
private Indicators.RJCSampleIndicator myIndicator;
#endregion
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"MA Column to work with Custom Indicator";
Name = "RJCCustomMAColumn";
Calculate = Calculate.OnBarClose;
}
else if (State == State.Configure)
{
myIndicator = new Indicators.RJCSampleIndicator();
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
CurrentText = "Bull";
if (myIndicator.SampleSignal[0] == 1)
{
CurrentText = "Bull";
// set background color of column to green
}
else if (myIndicator.SampleSignal[0] == -1)
{
CurrentText = "Bear";
// set background color of column to red
}
else
{
CurrentText = "Neut";
// set background color of column to gray
}
}
}
}
Also, any thoughts on how to programmatically change the background color of the custom market analyzer column? Reason being that the background color is more than likely going to be based on different information than the text message. For instance, I may want to identify when a signal fires by the text, and use color to identify if in a trend, for example.
Thank you!
-- Rick
Comment