PDA

View Full Version : CCT Bollinger help


upsndowns
12-14-2009, 03:18 PM
hi,
struggling with ninjascript generally, but at present, i'm trying to add color above 100 & below 0 of the cct bollinger indicator(period changed to 14) i dowloaded from the forum. see my attempt under "onbarupdate...drawregion" & please advise me of my errors. thanks.

Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "Output"));
Add(new Line(Color.FromKnownColor(KnownColor.Red), 100, "Upper"));
Add(new Line(Color.FromKnownColor(KnownColor.LightGreen), 0, "Lower"));
CalculateOnBarClose = false;
Overlay = false;
PriceTypeSupported = true;

protectedoverridevoid OnBarUpdate()
{
Output.Set((Close[0]+2*StdDev(Period)[0]-SMA(Period)[0])/(4*(StdDev(Period)[0]))*100);


DrawRegion("tag1", CurrentBar, 0, CCTBollinger(14).Upper, 1000000, Color.Empty, Color.LightSalmon, 2);

DrawRegion("tag1", CurrentBar, 0, CCTBollinger(14).Lower, 0, Color.Empty, Color.PaleTurquoise, 2);
}

NinjaTrader_Josh
12-14-2009, 03:49 PM
upsndowns,

You cannot use a value like 100000 for the barsAgo starting point. Instead you want to use CurrentBar variable in there. That will get it to the very beginning of the chart.

upsndowns
12-14-2009, 05:03 PM
hi josh,
i am trying to fill the regions from 100 to chart edge & from 0 to chart edge, & the "drawregion" help in nt suggests putting a high value to do this for the upper region.
when compiling, the problem seems to be with the "cctbollinger(14)upper" in :
DrawRegion("tag1", CurrentBar, 0, CCTBollinger(14).Upper, 1000000, Color.Empty, Color.LightSalmon, 2);
it doesn't recognise it..i think?
thanks.

NinjaTrader_Josh
12-15-2009, 07:41 AM
upsndowns,

Please provide the exact error message. If you feel the plot does not exist I suggest you check that indicator again. Perhaps you mistyped the name or plot name of it.

upsndowns
12-15-2009, 02:30 PM
hi josh,
i ended up painting my cct bollinger indicator background similar to 1 of the examples in "custom indicator development" in help.
it turned out better & more informative than my original idea :)
taken me 3 days adjusting my indicators to get the look i wanted more through luck than fully understanding...i'm still very fuzzy on the language.
finally (for now), are there any ninja online events that cover indicator development? thanks again.

NinjaTrader_Josh
12-15-2009, 02:58 PM
upsndowns,

Unfortunately we currently do not have any events for indicators. We have one for Strategy Development through the Strategy Wizard though.