Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Indicator Plotting Problem
Collapse
X
-
Indicator Plotting Problem
I coded an oscillator that changes colors when different values are reached. There is a "digital" option to not plot the actual value, just colored bars corresponding with the value of the oscillator. This option only works on the second one if I have two of the indicator on the same chart. If I only have one indicator on the chart it only plots the color for the highest value. Any Ideas?Last edited by xav1029; 07-20-2009, 03:54 PM.Tags: None
-
protected override void Initialize()
{
CalculateOnBarClose = true;
Overlay = false;
PriceTypeSupported = false;
Add(new Plot(new Pen(Color.Green,1), PlotStyle.Bar, "StrongBuyP"));
Add(new Plot(new Pen(Color.PaleGreen,1), PlotStyle.Bar, "WeakBuyP"));
Add(new Plot(new Pen(Color.Red,1), PlotStyle.Bar, "StrongSellP"));
Add(new Plot(new Pen(Color.LightCoral,1), PlotStyle.Bar, "WeakSellP"));
Add(new Plot(new Pen(Color.LightGray,1), PlotStyle.Bar, "Flat"));
}
.....
if(digital == true)
{
if (plotval > strongBuy)
{
StrongBuyP.Set(1);
}
else if(plotval > weakBuy && plotval <= strongBuy)
{
WeakBuyP.Set(1);
}
else if(plotval > weakSell && plotval <= weakBuy)
{
Flat.Set(1);
}
else if(plotval > strongSell && plotval <= weakSell)
{
WeakSellP.Set(1);
}
else
{
StrongSellP.Set(1);
}
}
Comment
-
In first image: Indicator with digital = false. It works perfect.
Second Image: Indicator with digital = true. The only plot is strong buy, however everything else shows up in data panel.
Third Image: Same indicator loaded twice on the same chart both with digital = true. The first one only plots strong buy, the second plots everything.
Comment
-
[Description("")]
[Category("Parameters")]
public double WeakBuy
{
get { return weakBuy; }
set { weakBuy = Math.Max(0, value); }
}
[Description("")]
[Category("Parameters")]
public double StrongSell
{
get { return strongSell; }
set { strongSell = Math.Max(-10, value); }
}
[Description("")]
[Category("Parameters")]
public double WeakSell
{
get { return weakSell; }
set { weakSell = Math.Max(-10, value); }
}
[Description("")]
[Category("Parameters")]
public double StrongBuy
{
get { return strongBuy; }
set { strongBuy = Math.Max(0, value); }
}
[Description("Fast Periods")]
[Category("Parameters")]
public int Fast
{
get { return fast; }
set { fast = Math.Max(0, value); }
}
[Description("Slow Periods")]
[Category("Parameters")]
public int Slow
{
get { return slow; }
set { slow = Math.Max(0, value); }
}
[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 StrongBuyP
{
get { return Values[0]; }
}
[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 WeakBuyP
{
get { return Values[1]; }
}
[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 StrongSellP
{
get { return Values[2]; }
}
[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 WeakSellP
{
get { return Values[3]; }
}
[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 Flat
{
get { return Values[4]; }
}
[Description("Digital if true")]
[Category("Parameters")]
public bool Digital
{
get { return digital; }
set { digital = value; }
}
[Description("Moving Average Type")]
[Category("Parameters")]
public NinjaTrader.Indicator.MAV.MAType SlowMAType
{
get { return mA1Type; }
set { mA1Type = value; }
}
[Description("Moving Average Type")]
[Category("Parameters")]
public NinjaTrader.Indicator.MAV.MAType FastMAType
{
get { return mA2Type; }
set { mA2Type = value; }
}
Comment
-
There are no errors in the log. It is very annoying. The data is there, it just doesn't visually show up in the chart unless I have two loaded on the same chart. Then it only appears on the second one. It worked fine on another computer though. Maybe need to reinstall?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment