PDA

View Full Version : Limit the number or rays drawn


pstiles
02-23-2009, 05:26 AM
So I know how to make multiple rays on charts and I know how to make a single ray.

DrawRay("MyRay"+CurrentBar, 8, MAX(High,9)[0], 0, MAX(High,9)[0], Color.Green);

It is possible to limit the number of rays drawn on a chart? For example, say I want to draw the last three, not every one.

Ralph
02-23-2009, 06:37 AM
You could try the following (not tested) code:


DrawRay("MyRay" + (CurrentBar % 3), 8, MAX(High,9)[0], 0, MAX(High,9)[0], Color.Green);


Regards
Ralph

NinjaTrader_Bertrand
02-23-2009, 07:03 AM
Thanks for sharing your idea Ralph!

pstiles
02-25-2009, 05:43 AM
That worked. Thanks.