[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] whoops, here's the "picture"



PureBytes Links

Trading Reference Links

I'm not up to speed on AB code...yet. Here's a TSF approach that can work well. Attached is a chart of KLAC, showing triggers on the Forecast Oscillator (same indicator). The Forecast Oscillator is a TSF set to 13 periods (in this example). In this case, whenever price moves more than 11% (in the opposite direction of your position) from the projected linear regression, you reverse your position (all signals are calculated EOD, and position are put on the following opening) . Since 1/1/2000, this has produced results, in KLAC, of 28-9 with a return of $159 (no slippage or commissions). Just thought I'd toss in an approach that, at times, can extract a few pennies.

Take care,

Steve
www.cedarcreektrading.com
----- Original Message ----- 
From: CS 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Monday, April 22, 2002 8:24 AM
Subject: Re: [amibroker] Re: Time Series Forecast


"The Time Series Forecast indicator is based on the trend of a security'sprice over a specified time period. The trend is determined by calculating a linear regression trendline using the "least squares fit" method. The least squares fit technique fits a trendline to the data in the chart by minimizing the distance between the data points and the linear regression trendline.  
Any point along the Time Series Forecast is equal to the ending value of a Linear Regression trendline plus its slope. For example, the ending value of a Linear Regression trendline (plus its slope) that covers 10 days will have the same value as a 10-day Time Series Forecast. This differs slightly from the Linear Regression indicator (see Linear Regression Indicator) in that the Linear Regression indicator does not add the slope to the ending value of the regression line. This makes the TSF a bit more responsive to short term price changes. If you plot the TSF and the Linear Regression indicator side-by-side, you'll notice that the TSF hugs the prices more closely than the Linear Regression indicator.

Rather than plotting a straight Linear Regression trendline, the Time Series Forecast indicator plots the ending values of multiple Linear Regression trendlines. The resulting Time Series Forecast indicator is sometimes referred to as a "moving linear regression" study or a "regression oscillator.""
   
I use it as a type of moving average or smoother of other indicators. Sometimes.
   
-CS


----- Original Message ----- 
From: Cathy Finnegan 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Sunday, April 21, 2002 5:54 PM
Subject: RE: [amibroker] Re: Time Series Forecast


This looks interesting! I just plotted it,,, What's it supposed to ..er.. indicate.. show.. do??
     
cathy
-----Original Message-----
From: CS [mailto:csaxe@x...]
Sent: Sunday, April 21, 2002 8:42 PM
To: amibroker@xxxxxxxxxxxxxxx; pacific5_au@xxxx
Subject: Re: [amibroker] Re: Time Series Forecast


See if this gets through.
       
T1=7; //Periods

Y=C; //array

TSF=LinRegSlope(Y,T1)+((T1*Sum(Cum(1)*Y,T1)-Sum(Cum(1),T1)*Sum(Y,T1))/(T1*Sum((Cum(1)^2),T1)-

(Sum(Cum(1),T1)^2))*Cum(1)+(MA(Y,T1)-MA(Cum(1),T1)*(T1*Sum(Cum(1)*Y,T1)-

Sum(Cum(1),T1)*Sum(Y,T1))/(T1*Sum((Cum(1)^2),T1)-(Sum(Cum(1),T1)^2))));

GraphXSpace=2;

Graph0=TSF;

Graph1=Y;

Title="Time Series Forecast Periods="+WriteVal(T1);

-CS
----- Original Message ----- 
From: pacific5_au 
To: amibroker@xxxxxxxxxxxxxxx 
Sent: Sunday, April 21, 2002 5:08 PM
Subject: [amibroker] Re: Time Series Forecast


Hi CS

Thanks for your post. Unfortunately the file is empty 0 kb when down 
loaded. Could you plse re-up the file as a zip file or just post the 
code text. (a Yahoo situation.)

Many thanks

pacific

--- In amibroker@xxxx, "CS" <csaxe@xxxx> wrote:
> -CS
> ----- Original Message ----- 
> From: Owen Davies 
> To: amibroker@xxxx 
> Sent: Sunday, April 21, 2002 8:25 AM
> Subject: [amibroker] Time Series Forecast
> 
> 
> Has anyone coded this Metastock indicator for AmiBroker?
> According to the Equis Help description, it's the end point of
> the linear regression line plus the slope. Not something I'm
> competent enough to produce for AB, alas.
> 
> Thanks.
> 
> Owen Davies
> 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


------=_NextPart_001_012C_01C1E9E8.1F0CC6A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>CS &amp; list,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm not up to speed on AB code...yet.&nbsp; Here's 
a TSF approach that can work well.&nbsp; Attached is a chart of KLAC, showing 
triggers on the Forecast Oscillator (same indicator).&nbsp; The Forecast 
Oscillator is a TSF set to 13 periods (in this example).&nbsp; In this case, 
whenever price moves more than 11% (in the opposite direction of your position) 
from the projected linear regression, you reverse your position (all signals are 
calculated EOD, and position are put on the following opening) .&nbsp; Since 
1/1/2000, this has produced results, in KLAC, of 28-9 with a return of $159(no 
slippage or commissions).&nbsp; Just thought I'd toss in an approach that, at 
times, can extract a few pennies.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Take care,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Steve</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="http://www.cedarcreektrading.com";>www.cedarcreektrading.com</A></FONT></DIV>
<DIV></FONT>----- Original Message ----- </DIV></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV 
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
CS </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A 
href="mailto:amibroker@xxxxxxxxxxxxxxx"; 
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, April 22, 2002 8:24 
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [amibroker] Re: Time Series 
Forecast</DIV>
<DIV><BR></DIV>
<DIV><FONT size=2>"The Time Series Forecast indicator is based on the trend of 
a security's price over a specified time period.&nbsp; The trend is determined 
by calculating a linear regression trendline using the "least squares fit" 
method.&nbsp; The least squares fit technique fits a trendline to the data in 
the chart by minimizing the distance between the data points and the linear 
regression trendline.&nbsp; <BR>Any point along the Time Series Forecast is 
equal to the ending value of a Linear Regression trendline plus its 
slope.&nbsp; For example, the ending value of a Linear Regression trendline 
(plus its slope) that covers 10 days will have the same value as a 10-dayTime 
Series Forecast.&nbsp; This differs slightly from the Linear Regression 
indicator (see Linear Regression Indicator) in that the Linear Regression 
indicator does not add the slope to the ending value of the regression 
line.&nbsp; This makes the TSF a bit more responsive to short term price 
changes.&nbsp; If you plot the TSF and the Linear Regression indicator 
side-by-side, you'll notice that the TSF hugs the prices more closely than the 
Linear Regression indicator.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>Rather than plotting a straight Linear Regression trendline, 
the Time Series Forecast indicator plots the ending values of multiple Linear 
Regression trendlines.&nbsp; The resulting Time Series Forecast indicatoris 
sometimes referred to as a "moving linear regression" study or a "regression 
oscillator.""</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>I use it as a type of moving average or smoother of other 
indicators. Sometimes.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>-CS</DIV>
<DIV><BR></DIV></FONT>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV 
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
<A href="mailto:caeriel1@xxxx"; title=caeriel1@xxxxx>Cathy 
Finnegan</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A 
href="mailto:amibroker@xxxxxxxxxxxxxxx"; 
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, April 21, 2002 5:54 
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [amibroker] Re: Time 
Series Forecast</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=464245200-22042002><FONT color=#0000ff face=Arial 
size=2>This looks interesting!&nbsp; I just plotted it,,,&nbsp;&nbsp;What's 
it supposed to ..er.. &nbsp;indicate..&nbsp; show..&nbsp; 
do??</FONT></SPAN></DIV>
<DIV><SPAN class=464245200-22042002><FONT color=#0000ff face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=464245200-22042002><FONT color=#0000ff face=Arial 
size=2>cathy</FONT></SPAN></DIV>
<BLOCKQUOTE>
<DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma 
size=2>-----Original Message-----<BR><B>From:</B> CS 
[mailto:csaxe@x...]<BR><B>Sent:</B> Sunday, April 21, 2002 8:42 
PM<BR><B>To:</B> <A 
href="mailto:amibroker@xxxxxxxxxxxxxxx";>amibroker@xxxxxxxxxxxxxxx</A>; <A 
href="mailto:pacific5_au@xxxx";>pacific5_au@xxxx</A><BR><B>Subject:</B> 
Re: [amibroker] Re: Time Series Forecast<BR><BR></FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>See if this gets through.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>
<P><FONT color=#0000ff>T1=7; //Periods</FONT></P>
<P><FONT color=#0000ff>Y=C; //array</FONT></P>
<P><FONT 
color=#0000ff>TSF=LinRegSlope(Y,T1)+((T1*Sum(Cum(1)*Y,T1)-Sum(Cum(1),T1)*Sum(Y,T1))/(T1*Sum((Cum(1)^2),T1)-</FONT></P>
<P><FONT 
color=#0000ff>(Sum(Cum(1),T1)^2))*Cum(1)+(MA(Y,T1)-MA(Cum(1),T1)*(T1*Sum(Cum(1)*Y,T1)-</FONT></P>
<P><FONT 
color=#0000ff>Sum(Cum(1),T1)*Sum(Y,T1))/(T1*Sum((Cum(1)^2),T1)-(Sum(Cum(1),T1)^2))));</FONT></P>
<P><FONT color=#0000ff>GraphXSpace=2;</FONT></P>
<P><FONT color=#0000ff>Graph0=TSF;</FONT></P>
<P><FONT color=#0000ff>Graph1=Y;</FONT></P>
<P><FONT color=#0000ff>Title="Time Series Forecast 
Periods="+WriteVal(T1);</FONT></P></FONT></DIV>
<DIV><FONT size=2>-CS</FONT></DIV></FONT></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV 
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
<A href="mailto:pacific5_au@xxxx"; 
title=pacific5_au@xxxx>pacific5_au</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A 
href="mailto:amibroker@xxxxxxxxxxxxxxx"; 
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Sunday, April 21, 20025:08 
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [amibroker] Re: Time 
Series Forecast</DIV>
<DIV><BR></DIV><TT>Hi CS<BR><BR>Thanks for your post. Unfortunatelythe 
file is empty 0 kb when down <BR>loaded. Could you plse re-up the file 
as a zip file or just post the <BR>code text. (a Yahoo 
situation.)<BR><BR>Many thanks<BR><BR>pacific<BR><BR>--- In <A 
href="mailto:amibroker@xxxx";>amibroker@xxxx</A>..., "CS" &lt;<A 
href="mailto:csaxe@xxxx";>csaxe@xxxx</A>...&gt; wrote:<BR>&gt; 
-CS<BR>&gt;&nbsp;&nbsp; ----- Original Message ----- 
<BR>&gt;&nbsp;&nbsp; From: Owen Davies <BR>&gt;&nbsp;&nbsp; To: <A 
href="mailto:amibroker@xxxx";>amibroker@xxxx</A>... <BR>&gt;&nbsp;&nbsp;Sent: 
Sunday, April 21, 2002 8:25 AM<BR>&gt;&nbsp;&nbsp; Subject: [amibroker] 
Time Series Forecast<BR>&gt; <BR>&gt; <BR>&gt;&nbsp;&nbsp; Has anyone 
coded this Metastock indicator for AmiBroker?<BR>&gt;&nbsp;&nbsp; 
According to the Equis Help description, it's the end point 
of<BR>&gt;&nbsp;&nbsp; the linear regression line plus the slope.&nbsp; 
Not something I'm<BR>&gt;&nbsp;&nbsp; competent enough to produce for 
AB, alas.<BR>&gt; <BR>&gt;&nbsp;&nbsp; Thanks.<BR>&gt; 
<BR>&gt;&nbsp;&nbsp; Owen Davies<BR>&gt; <BR>&gt; <BR>&gt;&nbsp;&nbsp; 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
<BR>Service.<BR><BR></TT><BR><BR><TT>Your use of Yahoo! Groups is 
subject to the <A href="http://docs.yahoo.com/info/terms/";>Yahoo!Terms 
of Service</A>.</TT> <BR></BLOCKQUOTE><BR><BR><TT>Your use of Yahoo! 
Groups is subject to the <A 
href="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service</A>.</TT> 
<BR></BLOCKQUOTE><BR><BR><TT>Your use of Yahoo! Groups is subject to the <A 
href="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service</A>.</TT> 
<BR></BLOCKQUOTE><BR><TT>Your use of Yahoo! Groups is subject to the <A 
href="http://docs.yahoo.com/info/terms/";>Yahoo! Terms of Service</A>.</TT> 
<BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_012C_01C1E9E8.1F0CC6A0--

Attachment:
gif00305.gif

Attachment: Description: "Description: GIF image"