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

1 comment:

  1. Market always follows a specific trend at different times. Traders must trade along the market trend to trade safely in market. Referring financial advisory services helps in earning good returns from market.

    ReplyDelete