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

afl-shapes.png

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 );

aflshapesf2.png

Figure 2

With additions by Herman

1 Star2 Stars3 Stars4 Stars5 Stars (5 votes, average: 4.8 out of 5)
Loading ... Loading ...

5 Responses to “AFL Shapes Cheat Sheet”

  1. brian_z
    March 15th, 2008 | 10:28 pm

    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.

  2. brian_z
    March 16th, 2008 | 10:47 am

    I see you have fixed it,
    Nice work.

  3. March 17th, 2008 | 11:49 am

    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):

    >.
    .
    .
    .
    .

  4. March 17th, 2008 | 11:51 am

    Well, my prior message did not post correctly, and I can’t edit it or delete it.

    Sigh …

  5. Dennis
    April 12th, 2008 | 12:31 am

    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.

Leave a reply