I have an indicator I created, I just took the DM indicator that comes with Ninja and added
DrawRegion to it to shade between the +DI and -DI. I used the call DM(IDataSeries input, int period) to call the function/indicator when I made the indicator. Also I used DrawOnPricePanel = false so the shading
would show up in the indicator panel. I also have a version that I am trying to overlay right on
the price action itself so I have change DrawOnPricePanel = true and Overlay = true but the shading
does not show up when I place this indicator on top of price.
Any ideas what I am doing wrong?
Here is the code for the for the one that lays on top of price.
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Green), PlotStyle.Line, "DMplusplot"));
Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "DMminusplot"));
Add(new Plot(new Pen(Color.Purple, 3), "ADXplot"));
Add(new Line(Color.FromKnownColor(KnownColor.YellowGreen), 75, "Upperline"));
Add(new Line(Color.FromKnownColor(KnownColor.DarkViolet), 25, "Lowerline"));
Overlay = true;
CalculateOnBarClose = false;
DrawOnPricePanel = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
DMplusplot.Set(DM(Period).DiPlus[0]);
DMminusplot.Set(DM(Period).DiMinus[0]);
ADXplot.Set(DM(Period)[0]);
/*DrawRegion("Rontag", CurrentBar, 0, DMplusplot, DMminusplot, Color.Empty, Color.Green, 2);*/
if (DM(Period).DiPlus[0] > DM(Period).DiMinus[0])
{
DrawRegion("Rontag" + CurrentBar, 1, 0, DMplusplot, DMminusplot, Color.Empty, Color.Green, 2);
}
else if (DM(Period).DiPlus[0] < DM(Period).DiMinus[0])
{
DrawRegion("Rontag" + CurrentBar, 1, 0, DMplusplot, DMminusplot, Color.Empty, Color.Red, 2);

Comment