View Full Version : Questions on drawing from a strategy
Folls
05-08-2007, 02:09 PM
I have a few questions on drawing from a strategy.
1) Can I adjust the size of a dot or an arrow drawn using a statement such as:
DrawArrowUp("DivUp", 1, Lows[0][1] - TickSize, Color.Green);
2) I can't find the method for coloring a bar. What is it?
3) Is there a way to keep previous arrows (etc.) on the chart if I keep using the same draw statement? If not, is there another way?
Thanks,
Folls
NinjaTrader_Ray
05-08-2007, 02:20 PM
Hi,
1) Unfortunately chart marker sizes are non-adjustable
2) See this link - http://www.ninjatrader-support.com/HelpGuideV6/BarColor.html
3) No, if you remove a strategy from a chart, any draw objects will be removed
Folls
05-09-2007, 09:04 AM
To be able to keep a reasonable number of markers on the chart, I used the following code:
drawCounter += 1; //update draw counter
if (drawCounter > 1000) drawCounter = 0; // keep the counter small
string counter = drawCounter.ToString("n0"); //convert to string
// draw an indication
DrawArrowUp(counter, 1, Lows[0][1] - TickSize, Color.Green);
I got the attached error when I installed the strategy on the chart. Prior to using the drawCounter, I was reusing a DrawArrowUp statement and thus only keeping the last marker on the chart. That did not get an error.
Any advice or input?
Thanks!
Folls
NinjaTrader_Ray
05-09-2007, 09:35 AM
This is a rare bug that does not seem to have negative implications. We are having a hard time reproducing it. We did add some code that hopefully works around this for the next update.
Does this happen each time you run this strategy or did it only happen once?
It is not related to your code changes.
Folls
05-10-2007, 08:27 AM
It seems repeatable. Every time I have installed the strategy, it has happened. Like you said, it doesn't seem to cause a problem.
Folls
NinjaTrader_Ray
05-10-2007, 09:05 AM
For clarification. Could you cycle through several times, appying the strategy, removing, applying removing and let us know if the error message happens each time? If yes, I would request from you some files for us to reproduce here.
Thanks
Folls
05-10-2007, 01:02 PM
It does it every time I put the strategy in the chart.
NinjaTrader_Ray
05-10-2007, 01:12 PM
I sent you a PM.