Showing posts with label Amibroker afl. Show all posts
Showing posts with label Amibroker afl. Show all posts

Sunday, 9 March 2014

Amibroker AFL with Buy Sell Signals


















I am posting another AFL, which can be useful to plan your trades. This AFL is particularly useful for traders who do swing trading. In swing trading the trader prefers to wait for a trading signal based on confirmed change of trend. This signal can take short to long trading days. In this trading system a trader can safely find an entry point, but waiting for an exit signal can take away some of the gains generated.

Most analyst advice, whenever a trade is entered, the exit point too must be decided based on some criteria. These criteria can be anything from percentage of return to specific price target.

What this AFL attempts to do is it gives an entry point along with a target price to wait for an exit. It also cautions the trader, with a stop loss level. The back ground color can be adjusted to suit the viewing comfort. The chart window also displays a trending ribbon, which serves as a trend indicator. The time frame can be adjusted for daily, weekly or monthly. In every time frame chosen, the entry and the exit points can vary. My opinion is to look for a weekly mode setting, which can give a meaningful value. A word of caution here – deploy this AFL along with other indicators for confirmation of trends. I suggest, the Stochastic Momentum Index for confirmation. I have tweaked the codes slightly to avoid booking profits too early.

Please back test this AFL before taking a call.
The AFL can be downloaded free from here

Happy trading and best wishes.

Tuesday, 11 February 2014

Candlestick chart pattern identification AFL



candlestick chart patternToday i am posting an AFL, which could point to finding some of the important candle patterns. The patterns include Morning Doji star, Morning star, Three white soldiers, Piercing Line, Downside Tasuki Gap, engulfing Pattern, Abandoned Baby, Dragon fly Doji and Harami. When these patterns are identified, the number 1 appears in the results window, indicating the confirmation of the pattern. The volume is also included in order to select the desired volume levels. The results can be exported using the File menu in the analysis window, in the form of CSV, txt or html format. It is better to export it the the .csv format, so that it can be easily manipulated and analyzed in MS Excel program.

This afl will not show any charts in the chart window, because this is meant for analyzing the stocks. it is quite tedious to check candle pattern one by one for the reversal patterns. This AFL comes in handy to do this work in the shortest possible time. 

This AFL can be stored anywhere in the computer, but its preferred destination is the customs folder in the formulas folder. The amibroker has all the options to run this afl. One can scan the entire symbol list or selected symbols. Similarly, it can be run for any number of days or a single day.

Under Apply to , there are three options all symbols, current symbol and use filter. This mean the user can select a single stock or multiple stocks. Under the range from a single day quote to date range specified quotations could be selected for explorations. The above description is for a new user.

Finally using the candlestick chart patterns for trading purpose, need sufficient knowledge of various candlestick patterns. I suggest that the readers  to take interest in acquiring knowledge about candlestick chart patterns.

Click here to download the AFL for pattern identification

Thursday, 23 January 2014

Amibroker AFL for Butterworth Trending System


After a long gap, I am posting another AFL here. This AFL is known as Butterworth Trending system. The basic purpose of this system is to identify buy or sell signals that carries a high winning ratio. This AFL is most suitable for delivery-based trades and strictly not for intraday trader.

Before deploying this AFL, I request the trader to study the charts generated by the AFL. Because this system is good as a trend indicator rather than a buy sell generator. Therefore using this system along with another system to enter trade is advisable. Since long-term goals are looked for with this AFL, I would suggest that use of weekly or monthly mode in the chart patterns. 

It is always better to use another indicator along with this trading system. I also would like to suggest another AFL - Stochastic Momentum Index (download from here) that can be used along with this AFL. The suggested settings are look back of 35 smooth I of 3- smooth 2 of3 and the signal also at 3. Combination of these two AFLs (plotted separately on the chart window) could give out an early alert to the trader. The trader must study the system well and develop a trading plan. If cleverly used, this AFL is bound to bring in some profits.

I am not the creator of the AFL mentioned here The AFL has been coded by R.Rajandran of Marketcalls, who is doing an excellent service to the trader community. All credits goes to him.

Happy trading and good luck.


Friday, 3 January 2014

Elliot Wave Theory - Amibroker AFL


The Elliot wave theory was presented to the trading community by Ralph Nelson Elliot in the years 1968 and 1969. In this remarkable work he has emphasized that the market movement is based on a pattern of five impulsive upward waves and three corrective downward waves. the stock market is largely driven by investor sentiments and related news. The stock price reflects the investor behavior. Stock price may witness newer highs and steep corrections. All these are part of share trading. Elliot has taken into consideration almost all the actions of the trading activity before formulating his theory.  He strongly believed that by studying the wave pattern one can anticipate the next price movement.

Wednesday, 1 January 2014

Amibroker AFL for Daily, Weekly and Montly Pivot levels


Today I am posting a small but very essential Amibroker AFL. By deploying this Amibroker AFL utility, the user can get sufficient knowledge of Daily, Weekly and Monthly Pivot. The calculations are based upon standard classic pivot levels. A monthly pivot normally gives us a vision of what the trend is all about. A weekly pivot shows us the market behavior in the last week. The day pivot gives us some information of the current trend. When we anticipate a trend, it will be helpful how the stock behaved itself in the weekly and monthly mode. Price movements do follow the pivot levels in most of the trading period, which is why pivot levels are important to a trader as a tool of technical analysis.

Saturday, 16 November 2013

3/15 Crossover Trading AFL with buy sell signals

This trading system is based moving average cross over. The importance is given for the Three days moving average and the Fifteen days moving average. This method produces some good trades on a weekly time frame. Even on EOD basis this could generate good signals. But on intraday it can produce many whipsaw like patterns leaving the user in a confused state.  When a 3 day MA crosses the 15 days MA a trading signal is generated. It can be long or short. If the user identifies good stocks and applies this system some good trades can be done. The only condition is the system should be followed with discipline.

The system indicates support level and resistance levels based on the previous candles. SAR also has been provided which alerts the user reversal trends at the levels. In the properties windows the support and resistant levels can be adjusted and the desired colors too can be set. An audio alert is also incorporated alerting the trader of buy sell signals.

I have added a magnified market price to this AFL which is also customizable, for easy viewing.

//////////////////////////////////////////// the code is posted below ////////////////////////////////////////////////
_SECTION_BEGIN("ema3,15");
x = EMA(Close,3);
y = EMA(Close,15);

Plot(EMA(Close,3),"",colorYellow, styleLine, styleThick);
Plot(EMA(Close,15),"",colorGreen, styleLine, styleThick);
GraphXSpace=0.5;
Plot(C,"",colorBlack,styleCandle);
XR=(EMA(Close,3) * (2 / 6 - 1) - EMA(Close,15) * (2 / 11 - 1)) / (2 / 6 - 2 / 11);


Buy = Close > EMA( Close , 15 )
AND Ref( Close , -1 ) > Ref( EMA( Close , 15 ) , -1 )
AND Cross(x,y);

Sell = Close > EMA( Close , 3 )
AND Open > EMA( Close , 3 );

Short = Close < EMA( Close , 3 )
AND Ref( Close , -1 ) < Ref( EMA( Close , 3 ) , -1 )

AND Cross(y,x);

Cover = Close < EMA( Close , 3 )
AND Open < EMA( Close , 3 );

SellPrice=ValueWhen( Sell, C, 1);
BuyPrice=ValueWhen( Buy,C, 1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );


PlotShapes(shapeUpArrow*Buy,colorBrightGreen, 0, L, Offset=-45);
PlotShapes(shapeDownArrow*Short,colorRed, 0, H, Offset=-45);
AlertIf( Buy, "SOUND C:\\Windows\\Media\\notify.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\chord.wav", "Audio alert", 2 );
AlertIf( Cover, "SOUND C:\\Windows\\Media\\notify.wav", "Audio alert", 2 );
AlertIf( Short, "SOUND C:\\Windows\\Media\\chord.wav", "Audio alert", 2 );

_SECTION_END();

_SECTION_BEGIN("supp");
("Price");
RSIperiod = 15; // Param("RSI p",3,14,30,1);
Percent = 5; // Param("ZIG %",8,9,15,1);
EMAperiod = 5; //Param("EMA p",4,5,10,1);
HHVperiod = 8; //Param("HHV p",3,5,10,1);
NumLine = 2; //Param("Num Lines",3,1,20,1);

Base = DEMA(RSI(RSIperiod),EMAperiod);

GraphXSpace=0.5;
Plot(C,"",colorWhite,styleCandle);

for( i = 1; i <= numline; i++ )
{
ResBase = LastValue(Peak(Base,Percent,i));
SupBase = LastValue(Trough(Base,Percent,i));
Plot(ValueWhen( ResBase==Base, HHV(H,HHVperiod) ), "Resist Level", colorOrange, styleLine);
Plot(ValueWhen( supbase==Base, LLV(L,HHVperiod) ), "Support Level", colorBrightGreen, styleLine);
}

_SECTION_END();

_SECTION_BEGIN("SAR");
acc = Param("Acceleration", 0.02, 0, 1, 0.001 );
accm = Param("Max. acceleration", 0.2, 0, 1, 0.001 );
Plot( SAR( acc, accm ), _DEFAULT_NAME(), ParamColor( "Color", colorCycle ), ParamStyle("Style", styleDots | styleNoLine, maskDefault | styleDots | styleNoLine ) );

_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",28,11,100,1);
GfxSelectFont("Arial", FS, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorViolet) );
Hor=Param("Horizontal Position",766,1,1200,1);
Ver=Param("Vertical Position",1,1,1,1);
GfxTextOut(""+C,Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
DD=Prec(C-YC,2);
xx=Prec((DD/YC)*100,2);
GfxSelectFont("Arial", 12, 700, italic = False, underline = False, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor(ParamColor("Color",colorViolet) );
GfxTextOut(""+DD+" ("+xx+"%)", Hor+5, Ver+45 );
_SECTION_END();

_SECTION_BEGIN("Title");
if( Status("action") == actionIndicator )
(
Title = EncodeColor(colorBlack)+ ":EMA 3/15, " + " - " + Name() + " - " + EncodeColor(colorWhite)+ Interval(2) + EncodeColor(colorBlack) +
" - " + Date() +" - "+"\n" +EncodeColor(colorBlue) +"Op-"+O+" "+"Hi-"+H+" "+"Lo-"+L+" "+
"Cl-"+C+" "+ "Vol= "+ WriteVal(V, 1.0)+"\n"+
EncodeColor(colorBrightGreen)+
WriteIf (Buy , " GO LONG / Reverse Signal at "+C+" ","")+
WriteIf (Sell , " EXIT LONG / Reverse Signal at "+C+" ","")+"\n"+EncodeColor(colorWhite)+
WriteIf(Sell , "Total Profit/Loss for the Last Trade Rs."+(C-BuyPrice)+"","")+
WriteIf(Buy , "Total Profit/Loss for the Last trade Rs."+(SellPrice-C)+"","")+
WriteIf(Long AND NOT Buy, "Trade : Long - Entry price Rs."+(BuyPrice),"")+
WriteIf(shrt AND NOT Sell, "Trade : Short - Entry price Rs."+(SellPrice),"")+"\n"+
WriteIf(Long AND NOT Buy, "Current Profit/Loss Rs."+(C-BuyPrice)+"","")+
WriteIf(shrt AND NOT Sell, "Current Profit/Loss Rs."+(SellPrice-C)+"",""));
WriteIf(x-y, "Cross over","");
AlertIf( Buy, "SOUND C:\\Windows\\Media\\Windows XP Startup.wav", "Audio alert", 2 );
AlertIf( Sell, "SOUND C:\\Windows\\Media\\Ringin.wav", "Audio alert", 2 );


////////////////////////////////////////////////end of code////////////////////////

I hope this tool along with good money management ,will be very useful for traders

My best wishes.