March 15, 2008
AFL Shapes Cheat Sheet
The plotshapes() can be used to plot shapes on your chart to indicate signals, stops, and other events and conditions. Figure 1 below gives a quick overview of the shapes that are available and includes a few undocumented ones. A PDF version suitable for printing is here: AFL Shapes Cheat Sheet
Figure 1
Figure 2 shows the small AFL program that was used to explore all the built-in shapes and their numerical values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | for ( i = 0; i < BarCount; i++ ) { O[i] = C[i] = i; H[i] = i + 5; L[i] = i - 5; if ( i % 2 == 0 ) {PlotText( NumToStr( i, 1.0, False ), i, L[i]-2, colorDarkGrey );} else {PlotText( NumToStr( i, 1.0, False ), i, H[i]+.5, colorDarkGrey );} } PlotShapes( C, colorRed, 0, C, -10 ); Plot( C, "", colorLightGrey, styleBar ); Title = "Hollow = " + NumToStr( shapeHollowCircle - shapeCircle, 0, 0 ) + "\n" + "Small = " + NumToStr( shapeSmallCircle - shapeCircle, 0, 0 ); |
Figure 2
With additions by Herman
Filed by Dennis Brown at 5:01 pm under AFL - The Basics




(4 votes, average: 4.75 out of 5)
Welcome to the UKB.
I’m dancing and having a glass of champagne here.
Extending our knowledge, even on the simple things, can save a lot of heartache later when we want to do something for the first time.
I’m having trouble copying the code because it isn’t wrapped - it is all on one line.
Thanks.
I see you have fixed it,
Nice work.
I think left triangle and right triangle would be very helpful additions to AB’s list of available shapes.
I find a chart display that marks the entry price with a right triangle, and the exit price with a left triangle, and with a line drawn between them, to be the easiest to immediately understand (and use to verify visually a list of trades).
Something like this (for a short trade):
>.
.
.
.
.
Well, my prior message did not post correctly, and I can’t edit it or delete it.
Sigh …
Progster, It would be nice to have a larger pallet of symbols. However, you may well get what you want (more or less) by doing something else I do. I combine two or more symbols together to make a more complex symbol. For instance, you could plot an up and down triangle in such a way that it looks like a diamond, Or put a small red dot inside a blue square, etc. One I use a lot is to put an arrow coming out the top or bottom of a digit. That is how I mark the number of contracts to be bought or shorted on the next bar. It couls also be used to determine the type of signal that generated the trigger, or the number of triggers, etc.