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!

12 comments:

kurichh on July 11, 2009 at 4:13 PM said...

thanks for the AFL as well as for answerign my queries :)

kurichh on July 11, 2009 at 4:17 PM said...

hi doji .. do correct the line
Title += StrFormat("\nRange Bars: %g", range);

it has to be

Title = StrFormat("\nRange Bars: %g", range);

kurichh on July 11, 2009 at 4:20 PM said...

also just curious to ask .. are u a AFL coder ?? :)

Doji (Blog Author) on July 11, 2009 at 4:50 PM said...

it has to be "+=" only. It is meant to add to the existing title in new line. Yes, I do code afl.

Doji

kurichh on July 11, 2009 at 9:03 PM said...

oh strangely then it gave an error when i entered "+=" but when i changed it to = it worked fine.. Sorry if i disturbed u :( ..
what should i do now in order to get rid of += ??

Unknown on July 12, 2009 at 12:03 AM said...

Hello....Doji

I wana ask u that do u have Pattern Explorer...
and one more thing,
The AFL u given does not give any single...
I think the file just mere a Template in which background color and bar is set...
and one more thing
does AB=CD pattern needs to satisfy
BC/AB
CD/BC
CD/AB
Do u use any Stock Scanner because to find such pattern is realy tough even it needs couple to hours to find such patterns...
Thank You

Lalchand Khatri on July 12, 2009 at 12:04 AM said...

Great information nice comments thank you for such a nice information....
Gold planning

Doji (Blog Author) on July 12, 2009 at 2:00 PM said...

@kurichh,
Save this as a new afl under your "C:\Program Files\AmiBroker\Formulas\Basic Charts" directory, refresh-all or restart your amibroker. You should see a the new afl under 'Basic Charts" in your amibroker, double click that.

@mmanoj,
I dont use pattern explorer and this is not a exploration afl. All the 3 ratios are important for ABCD.

@Lalchand
Thank you.

-Doji

kurichh on July 13, 2009 at 7:56 AM said...

@doji :- thanks :0

Unknown on July 13, 2009 at 8:01 AM said...

OK Thnks Doji

Shirshendu Ghosh on August 22, 2009 at 10:09 PM said...

Hi Doji,

Can u pls share full code of this amibroker chart? i make copy-paste the code but no indication is showing

kurichh on August 23, 2009 at 1:21 PM said...

hi shiris..this is the full chart.. go to any sheet in ami..rightclick --edit formula..delete the old one---put this new one-- then click apply and then save... hope u see the new one :)

Post a Comment

 

The Chart Reader Copyright © 2009. Privacy Policy