Wednesday, March 18, 2009

Regression Channel - AFL

Apa manfaat Regression Channel bagi anda? Sudahkah RC standar Amibroker memenuhi kebutuhan anda?

Saya copy paste kan keterangan tentang RC dari Amibroker... ini dia:

Regression channels

Linear regression may sound intimidating, but the mathematical concept is a simple one. All this technique does is fit a straight line through a finite number of data points by minimizing the sum of the squared vertical distance between the line and each of the points. In our context, this means that if time is represented by days on the horizontal axis and the closing price on those days is plotted as dots on the vertical axis (a normal closing price chart), then we try to fit a straight line through those closing-price dots such that the total sum of the squared vertical distance between each closing price and the line are minimized. This would then be our best-fit line.

Raff regression channel Raff Regression Channels show the range prices can be expected to deviate from a Linear Regression trend line. Developed by Gilbert Raff, the regression channel is a line study the plots directly on the price chart. The Regression Channel provides a precise quantitative way to define a price trend and its boundaries. The Regression Channel is constructed by plotting two parallel, equidistant lines above and below a Linear Regression trend line.

The distance between the channel lines to the regression line is the greatest distance that any one high or low price is from the regression line.

Raff Regression Channels contain price movement, with the bottom channel line providing support and the top channel line providing resistance. Prices may extend outside of the channel for a short period of time. However, if prices remain outside the channel for a long period of time, a reversal in trend may be imminent.

Standar Regression Channel bisa diplot langsung ke chart, dimana ada 3 line:
  1. Regression Line (di tengah),
  2. Support Line (di bawah) dan
  3. Resistance Line (di atas).
Tahukah anda bahwa di AFL Library juga ada AFL RC, dimana ia menghasilkan 3 line itu lebih tepat dalam mencari Peak dan Trough dalam suatu periode lookback. Berikut script AFL nya (bisa juga dicari di AFL Library):

/* Linear Regression Slope */
/* Geoff Mulhall 25-May-2002 */
/* Refer www.equis.com/free/taaz/linearregression.html */
/* for a mathematical explanation of the formulae */

N = LastValue(LLVBars(Low,190)); // lookback period - can be set by the user if necessary
Start = 1;

X = Cum(Start); // Set up the x cordinate array of the Linear Regression Line
Y = Close; // Set the y co-ordinate of the Linear Regression line

/* Calculate the slope (bconst) and the y intercept (aconst) of the line */

SUMX = LastValue(Sum(X,N));
SUMY = LastValue(Sum(Y,N));
SUMXY = LastValue(Sum(X*Y,N));
SUMXSqd = LastValue(Sum(X*X,N));
SUMSqdX = LastValue(SUMX * SUMX);

bconst = (N * SUMXY - SUMX * SUMY)/(N * SUMXSqd - SUMSqdX);
aconst = (SUMY - bconst * (SUMX))/N;

/* Force the x value to be very negative so the graph does not apear before the lookback period */

Domain = IIf ( X > LastValue(X) - N, 1 , -1e10);
Xvar = X * Domain;

/* Linear Regression Line */

Yvar = aconst + bconst * Xvar;

/* Plot the graphs */

GraphXSpace = 10;
MaxGraph=4;

/* Candle chart */
Graph0 = Close;
Graph0Style = 64;
Graph0Color = 43;

/* Linear Regression Lines */
Graph1 = Yvar;
Graph2 = Yvar - LastValue(HHV(Yvar - Low,N));
Graph3 = Yvar + LastValue(HHV(High - Yvar,N));

Graph1Style = 1;
Graph1Color = 2;
Graph2Style = 1;
Graph2Color = 2;
Graph3Style = 1;
Graph3Color = 2;

Menurut Geoff Mulhall (pembuatnya), AFL ini sudah obsolete dengan adanya Regression Channels di Amibroker.

Tapi dengan sedikit kreatifitas dan sedikit kemampuan ngoprek, bisa saja AFL yang obsolete ini dioprek sehingga hasilnya akan lebih baik dan lebih bermanfaat.

Idenya: AFL itu ditambah dengan lines baru dari angka2 "sakti" Fibonacci... Ini cuma ide... jika tertarik, silahkan dioprek, jika tidak, lupakan saja ide ini...

Yuk kita ngoprek...

==========

Hati-hati dalam memilih saham, selalu recek dengan chart Anda, pilih yang cocok saja dan jangan lupa MM dipasang di Trading Plan serta Be Discipline.

Semoga bermanfaat.
ES
Investasikan Dunia Mu Untuk Akherat Mu
DISCLAIMER ON