Lable:

Older Posts >> Home

Saturday, July 11, 2009

My Amibroker Price Chart AFL

My Amibroker price chart AFL is very simple one with no great bells and whistles. Posting this on Kurichh's request.

//****************************************//
// Author: doji@chartreader.co.in
// Web: http://www.chartreader.co.in/
//****************************************//

_N(Title = StrFormat(EncodeColor( colorGold) + "{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
SetChartOptions(0,chartShowArrows|chartShowDates);

// Background to suit my blog
SetChartBkColor(ColorRGB(23,23,23));

// Display line chart for tick data automatically
priceStyle = IIf( (Interval(0) == -900), styleLine, styleBar);

// Quick counting of bars by range selector
if (BeginValue(BarIndex()) != 0 AND EndValue(BarIndex()) != BarCount-1) {
range = EndValue(BarIndex())-BeginValue(BarIndex());
Title += StrFormat("\nRange Bars: %g", range);
}

CandleBorder = ParamColor("Candle Border Color", colorBlack );
UpCandleColor = ParamColor("Up Candle Color", colorGreen );
DownCandleColor = ParamColor("Down Candle Color", colorRed );

// set amibroker to display colored bars
Graph0BarColor = IIf( C > O,UpCandleColor ,DownCandleColor);

Plot( C, "Close", CandleBorder, styleNoTitle | ParamStyle("Style") | priceStyle );

Just incase you face problems with copy-paste, please download from this link.

Have fun!

Wednesday, June 3, 2009

AFL to Count Number of Bars Quickly

I wrote this simple AFL some time back to count number of bars quickly between two points on the charts:
if (BeginValue(BarIndex()) != 0 AND EndValue(BarIndex()) != BarCount-1) {
range = EndValue(BarIndex())-BeginValue(BarIndex());
Title += StrFormat("\nRange Bars: %g", range);
}
Just copy paste this at the end of your price afl and use range selection. To select a range, double click in the chart on your 1st bar and then double click again on your last bar. You will see green and red vertical lines and the number of bars is displayed under the title. Double click again on one of the start or end bars to deselect the range.

Bar counting is useful identifying Wolfe Wave patterns and other time-symmetry sensitive patterns.

Example chart below:


Thursday, April 16, 2009

My Gartley AFL, with Explorations and Performance Improvemens

Gartley AFL was first ported to Amibroker by Daniel Ervi from code originally posted for Wealth-Lab by Mark Conway. But, it suffers severe performance problems when the number of bar in the chart are high. I modified this code to include Start and End bar parameters with a low default value which increases Amibroker performance drastically. Also, I added exploration feature which helps in scanning and backtesting. Download my version of this AFL here.
 

The Chart Reader Copyright © 2009. Privacy Policy