Thursday, 5 December 2013

Amibroker AFL for Identifying Candlestick chart patterns


Candlestick pattern Identification
Candlestick patterns invented by the early Japanese rice traders are becoming more and more popular among technical analysts. The art of identifying a chart pattern is something every share trader must learn. Candlestick chart reading can be like Greek for beginners because of the peculiar terms involved in interpreting the patterns. But with little involvement, the interpretation of candlestick charts can be very interesting. 

I am posting another AFL today. This AFL will identify the candlestick patterns in a chart and print it on the screen. This afl covers all major candlestick patterns. Each pattern has been allocated a number for easy identification. I have listed the allocated number to each pattern below. Wherever the mouse is clicked and a pattern is selected the name of the pattern is displayed at the top left corner of the chart window.

NearDoji  -1, BlackCandle – 2LongBlackCandle -3SmallBlackCandle  -4/ WhiteCandle  -5, LongWhiteCandle - 6 SmallWhiteCandle - 7 BlackMaubozu – 8 WhiteMaubozu – 9, BlackClosingMarubozu - 10, WhiteClosingMarubozu - 11, BlackOpeningMarubozu - 12, WhiteOpeningMarubozu  - 13, HangingMan - 14, Hammer - 15, InvertedHammer - 16, ShootingStar – 17, BlackSpinningTop -18, WhiteSpinningTop - 19, BearishAbandonedBaby - 20, DarkCloudCover - 21, BearishEngulfing - 22, ThreeOutsideDownPattern – 23, BullishAbandonedBaby - 24,BullishMorningDojiStar - 25BullishEngulfing - 26, ThreeOutsideUpPattern - 27BullishHarami – 28ThreeInsideUpPattern - 29/PiercingLine - 30, BearishHarami - 31, ThreeInsideDownPattern - 32,ThreeWhiteSoldiers -33, DarkCloudCover - 34,  ThreeBlackCrows  -35, doji - 36, GapUp - 37, GapDown - 38, BigGapUp - 39, BigGapDown - 40, HugeGapUp - 41HugeGapDown - 42, DoubleGapUp - 43, DoubleGapDown - 44 

I hope this afl will be of some help to beginners who would like to learn the technical aspects of a candlestick pattern chart.

Tuesday, 3 December 2013

Amibroker AFL for MACD and ADX based trading

MACD  and ADX based trading system

I have posted a colorful AFL. This AFL is a combined system both MACD and ADX indicators. In any market finding the trend is the most important priority. To a greater extend the ADX can help in detecting the trend of stock. One thing to note about ADX is that it does not take the sideways movement of the stock. The MACD on the other hand is based upon moving averages and works differently

This AFLdisplays the MACD with histogram and the ADX is plotted in a ribbon style without interfering one an other. 

Sunday, 1 December 2013

Trend finder afl for Amibroker



Today I am posting an afl which will help to identify the current trend in a market. This afl uses 35 long period SMA, 8 short period SMA and 5 period for signal. This setup gives us the strength of current market movement. I have also attached chart with price with bollinger band. One can note that the trend reversal actually matches with the price band chart. This can help the traders to find the right time to enter the market and also find the exit levels, Although the chart is for the EOD, I have observed that this indicator works well in weekly charts.

Finding the trend in any market is a challenging task. Once a trader finds the correct trend, very profitable trades can be achieved. I would suggest that this indicator be applied to the weekly charts in order to get the correct picture of the market.

The code is very simple as it involves just three parameters. But it carries some value for the traders.
////////// the code of the afl begins here////////

_SECTION_BEGIN("PPO ");

m=Param("long period",35,1,500,1);

n=Param("short period",8,1,100,1);

s=Param("signal",5,1,100,1);

mac3=( (WMA(C,(n) )) -WMA(C ,(m)) ) /WMA(C ,(m))*100 ;

signa=WMA(MAC3,s);

diff=(MAC3-signa)*2 ;


Plot(mac3, "PPO line", colorBlack, styleDots);
Plot(signa, "PPO signal", colorBlue, styleDots);


Color=IIf(diff>=0 , colorGreen,colorRed);

Plot(diff, "", color, styleNoTitle| styleHistogram | styleNoLabel |styleThick, maskHistogram);
Plot(diff, "", color, styleNoTitle| styleLine | styleNoLabel, maskHistogram);

Plot(0, "", colorDarkGrey, styleLine);

Title="Strenght Index " + WriteIf(diff>0 AND MAC3>0 , "   UP Trend    ", WriteIf(diff<0 AND MAC3>0 , " Down trend ", WriteIf(diff<0 AND MAC3<0 , "DOWN Trend", "Up trend"))+WriteIf( (diff>Ref(diff,-1) AND diff>0 ) OR (diff<Ref(diff,-1) AND diff<0 ) , " formation", " weakening"));
_SECTION_END();

///////////////////////// end of code///////////////
Best of luck