Also, how do for loops work with Ninjascript? I've been playing around with them and can't get them to work how I want them to. I've trying a certain look back say 20 bars from CurrentBar and look for say an up bar..if an up bar is found at a certain index to draw text above bar. It's drawing bars all over the chart. I just wanted to use the last 20 bars from the right edge.
Also, could someone explain what this piece of code does and why it does it?
"(CurrentBar - startBar)"
Draw.Rectangle (this, "test", (CurrentBar - startBar), rect_high, 0, rect_low, Brushes.Cornsilk, true);
Thanks for all of the help.

Comment