{"id":1678,"date":"2008-03-15T17:01:24","date_gmt":"2008-03-15T17:01:24","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2008\/03\/15\/afl-shapes-cheat-sheet\/"},"modified":"2008-04-12T00:43:18","modified_gmt":"2008-04-12T00:43:18","slug":"afl-shapes-cheat-sheet","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2008\/03\/15\/afl-shapes-cheat-sheet\/","title":{"rendered":"AFL Shapes Cheat Sheet"},"content":{"rendered":"

The plotshapes()<\/a> 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<\/a><\/p>\n

\"afl-shapes.png\"<\/a><\/p>\n

Figure 1<\/p>\n

Figure 2 shows the small AFL program that was used to explore all the built-in shapes and their numerical values.<\/p>\n

<\/span>for ( <\/span>i <\/span>= <\/span>0<\/span>; <\/span>i <\/span>&<\/span>lt<\/span>; <\/span>BarCount<\/span>; <\/span>i<\/span>++ )\r{\r    <\/span>O<\/span>[<\/span>i<\/span>] = <\/span>C<\/span>[<\/span>i<\/span>] = <\/span>i<\/span>;\r    <\/span>H<\/span>[<\/span>i<\/span>] = <\/span>i <\/span>+ <\/span>5<\/span>;\r    <\/span>L<\/span>[<\/span>i<\/span>] = <\/span>i <\/span>- <\/span>5<\/span>;\r\r    if ( <\/span>i <\/span>% <\/span>2 <\/span>== <\/span>0 <\/span>)  {<\/span>PlotText<\/span>( <\/span>NumToStr<\/span>( <\/span>i<\/span>, <\/span>1.0<\/span>, <\/span>False <\/span>), <\/span>i<\/span>, <\/span>L<\/span>[<\/span>i<\/span>]-<\/span>2<\/span>, <\/span>colorDarkGrey <\/span>);}\r    else  {<\/span>PlotText<\/span>( <\/span>NumToStr<\/span>( <\/span>i<\/span>, <\/span>1.0<\/span>, <\/span>False <\/span>), <\/span>i<\/span>, <\/span>H<\/span>[<\/span>i<\/span>]+<\/span>.5<\/span>, <\/span>colorDarkGrey <\/span>);}\r}\r<\/span>PlotShapes<\/span>( <\/span>C<\/span>, <\/span>colorRed<\/span>, <\/span>0<\/span>, <\/span>C<\/span>, -<\/span>10 <\/span>);\r<\/span>Plot<\/span>( <\/span>C<\/span>, <\/span>""<\/span>, <\/span>colorLightGrey<\/span>, <\/span>styleBar <\/span>);\r\r<\/span>Title <\/span>= <\/span>"Hollow = " <\/span>+ <\/span>NumToStr<\/span>( <\/span>shapeHollowCircle <\/span>- <\/span>shapeCircle<\/span>, <\/span>0<\/span>, <\/span>0 <\/span>) + <\/span>"\\n" <\/span>+ \r    <\/span>"Small = " <\/span>+ <\/span>NumToStr<\/span>( <\/span>shapeSmallCircle <\/span>- <\/span>shapeCircle<\/span>, <\/span>0<\/span>, <\/span>0 <\/span>);<\/span><\/pre>\n

aflshapesf2.png<\/a><\/p>\n

Figure 2<\/p>\n

With additions by Herman<\/p>\n","protected":false},"excerpt":{"rendered":"

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 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[111],"tags":[],"_links":{"self":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1678"}],"collection":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/comments?post=1678"}],"version-history":[{"count":0,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/1678\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/media?parent=1678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/categories?post=1678"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/tags?post=1678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}