You are using it wrong. Read the manual http://www.amibroker.com/f?plotshapes
There are correct usage examples in the manual
PlotShapes is ARRAY function and its first argument is ARRAY. If you pass scalar as you do you tell it “plot shape EVERY BAR”.
PlotShapes plots shapes FOR ALL BARS in single call.
Correct usage is without the loop:
PlotShapes(Buy * shapeSquare,colorWhite, 0, L, Offset=40);
PlotShapes(Buy * shapeSquare,colorWhite, 0,L, Offset=50);
PlotShapes(Buy * shapeSquare,colorWhite, 0,L, Offset=60);
PlotShapes(Buy * shapeDownArrow,colorGreen, 0,L, Offset=-50);
As instructed in the manual.
Did you notice PLURAL form Plot SHAPES. It plots SHAPES, not single shape.
Almost every AFL function works on ARRAY AT ONCE with single call processing EVERY BAR so you do NOT NEED LOOPS. Read this http://www.amibroker.com/guide/h_understandaflhtml