PDA

View Full Version : DrawDot()


NinjaTrader_Josh
07-19-2007, 11:48 PM
Hmm I have code that will paint the background color and draw a dot according to certain conditions. A problem I am encountering is that it will paint all the backgrounds correctly except sometimes it just doesn't want to draw the dot.

Anyone else experiencing this?

if(Low[1]==Support[1] && Close[1]>Low[1])
{
longcount++;
DrawDot(longcount.ToString(),0,Support[1],Color.Purple);
BackColorAll = Color.PaleGreen;
}
if(High[1]==Resistance[1] && Close[1]<High[1])
{
shortcount++;
DrawDot(shortcount.ToString(),0,Resistance[1],Color.Crimson);
BackColorAll = Color.Pink;
}

You can see what I mean at 10:55 in the picture.

NinjaTrader_Josh
07-19-2007, 11:53 PM
Doh! I figured it out. Silly me. I was using two counters that started from 0 and were both incrementing by one. I so happened to just name my dots based on those counter values only so some dots where being redrawn else where hence them "missing" on some bars.

Much better now. :cool:
if(Low[1]==Support[1] && Close[1]>Low[1])
{
longcount++;
DrawDot(longcount.ToString(),0,Support[1],Color.Purple);
BackColorAll = Color.PaleGreen;
}
if(High[1]==Resistance[1] && Close[1]<High[1])
{
shortcount--;
DrawDot(shortcount.ToString(),0,Resistance[1],Color.Crimson);
BackColorAll = Color.Pink;
}

NinjaTrader_Josh
08-09-2007, 12:36 PM
Is there a way to choose which plot the DrawDot() will draw in? At the moment when I have an indicator in plot2 all of my DrawDot()s show up in plot1.

NinjaTrader_Dierk
08-09-2007, 12:51 PM
Sorry, what do you mean by plot1/2? Panel 1/2?

NinjaTrader_Josh
08-09-2007, 01:21 PM
Yeah. Panel. My bad on the terminology. DrawDot() seems to only want to go into Panel 1 (the price panel) even if my indicator is in Panel 2.

NinjaTrader_Dierk
08-09-2007, 01:24 PM
Please check out the DrawOnPricePanel property: http://www.ninjatrader-support.com/HelpGuideV6/DrawPriceOnPanel.html

NinjaTrader_Josh
08-09-2007, 01:31 PM
oo. Great. Thank you Dierk.

sacredblue
03-26-2008, 07:38 AM
Hi just though I'd quickly jump in,
I'm setting
DrawOnPricePanel = false;
in the in the initialize but there's a compilation error saying DrawOnPricePanel does not exist in context.
Am I missing an include or some sort of declaration for this?

Cheers
Tim

NinjaTrader_Dierk
03-26-2008, 07:47 AM
Only supported for indicators but not strategies.

sacredblue
03-26-2008, 07:51 AM
Ah right, thanks for that. :)