How would I expose the br variable/brush/color in the following indicator so that I can grab it from my strategy?
protected override void OnBarUpdate()
{
SolidColorBrush br;
ParabolicSAR sar = ParabolicSAR(0.02, 0.2, 0.02);
bool sarUp = sar.Value[0] < Low[0] ? true : false;
MACD1[0] = SMAF[0]-SMAS[0];
if(MACD1[0] - SMA(MACD1,16)[0] > 0)
LMACD[0] = MACD1[0] - SMA(MACD1,16)[0] ;
if(MACD1[0] - SMA(MACD1,16)[0] <= 0)
LMACD[0] = -1 * (MACD1[0] - SMA(MACD1,16)[0]);
Value[0] = LMACD[0];
br = MACD1[0] - SMA(MACD1,16)[0] > 0 ? Brushes.Green : Brushes.Firebrick;
if (sarUp && !psarUp && br == Brushes.Green)
br = Brushes.Lime;
if (!sarUp && psarUp && br == Brushes.Firebrick)
br = Brushes.Red;
psarUp = sarUp;
PlotBrushes[0][0] = br;
}
It looks like the indicator might be exposed already... but I'm not sure.. and I definitely am looking for the br color value so I can check the bar colors not just the numbers that it prints
this is at the bottom of the indicator file attached:
namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.LindaMACD LindaMACD()
{
return indicator.LindaMACD(Input);
}
public Indicators.LindaMACD LindaMACD(ISeries<double> input )
{
return indicator.LindaMACD(input);
}
}
}

Comment