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

[RT] Re: CL_EL help with recent TASC article



PureBytes Links

Trading Reference Links

<x-html><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4030.2400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Courier New" size=2>The attached&nbsp; .gif&nbsp; file shows a 
set of channels around a</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Gann trend calculated as previously 
described.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>The Magenta line wandering within this 
channel is the result</FONT></DIV>
<DIV><FONT face="Courier New" size=2>of a computation based on Ehler's 
INSTANTANEOUS TREND computation</FONT></DIV>
<DIV><FONT face="Courier New" size=2>from his article in May&nbsp;TASC 
magazine.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>The code follows and&nbsp;initially came 
from the TASC site.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>A slight modification -- I added a 
parameter called SMOOTH which</FONT></DIV>
<DIV><FONT face="Courier New" size=2>allows us to modify the Period computation 
within the&nbsp;function</FONT></DIV>
<DIV><FONT face="Courier New" size=2>to reduce the lag (value of less than 100) 
or increase the reliability</FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>of the period length estimate (value 
greater than 100).</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Ehler's approach is an interesting way of 
determining the length</FONT></DIV>
<DIV><FONT face="Courier New" size=2>of the dominant cyclic elements in a price 
series and removal of</FONT></DIV>
<DIV><FONT face="Courier New" size=2>such by use of simple 
averaging.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Read carefully what he has to say about 
LAG/DELAY before jumping</FONT></DIV>
<DIV><FONT face="Courier New" size=2>off into a never, never, land.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>The attached&nbsp; .ela&nbsp; was written 
in&nbsp; TS2000i and has not been</FONT></DIV>
<DIV><FONT face="Courier New" size=2>checked out in TS4 or SC so be 
careful.&nbsp; This is just a function</FONT></DIV>
<DIV><FONT face="Courier New" size=2>to compute the InstantaneousTrendline 
defined by Ehler.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>It was interesting to compare the results 
of this method to</FONT></DIV>
<DIV><FONT face="Courier New" size=2>a simple T3 average and to the Kauffman 
Adaptive average.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>With sufficient "smoothing" it is 
interesting to note how a</FONT></DIV>
<DIV><FONT face="Courier New" size=2>system that is basically Aberration (but 
using the Ehler IT</FONT></DIV>
<DIV><FONT face="Courier New" size=2>function to compute an average) behaves on 
a comparative basis</FONT></DIV>
<DIV><FONT face="Courier New" size=2>to a simple and an adaptive 
average.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Clyde</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2> <BR>{&nbsp; </FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Instantaneous Trend Line</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Ehlers uses a two-mode market model: 
trending or cycling. By removing the<BR>dominant cycle from the price data, the 
remaining information is mostly<BR>about trend. Here is the EasyLanguage Code to 
plot Instantaneous Trend Line.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Since the estimation of period of cyclic 
phenomena may be suspect, the<BR>user is provided a Smooth input which allows 
the user to specify the<BR>percentage of the computed Period to use for 
averaging to determine trend.<BR>A Value of 100 yields the original Ehler 
results.</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" 
size=2>}<BR>Inputs:&nbsp;Price(NumericSeries),Smooth(NumericSimple);<BR>&nbsp;&nbsp;<BR>Vars:&nbsp;InPhase(0),&nbsp;&nbsp;&nbsp;Quadrature(0),&nbsp;&nbsp;Phase(0),&nbsp;&nbsp;DeltaPhase(0),<BR>&nbsp;&nbsp;&nbsp;count(0),&nbsp;&nbsp;&nbsp;&nbsp;InstPeriod(0),&nbsp;&nbsp;Period(0),&nbsp;Trendline(Price),<BR>&nbsp;&nbsp;&nbsp;NewPrice(Price);</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" 
size=2>Vars:&nbsp;SmoothFact(iff(Smooth&gt;0,Smooth*.01,1));</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>{If CurrentBar &gt; 5 then 
begin}</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Compute InPhase and Quadrature 
components}<BR>&nbsp;Value1 = Price - Price[6];<BR>&nbsp;Value2 
=Value1[3];<BR>&nbsp;Value3 =.75*(Value1 - Value1[6]) + .25*(Value1[2] - 
Value1[4]);<BR>&nbsp;InPhase = .33*Value2 + .67*InPhase[1];<BR>&nbsp;Quadrature 
= .2*Value3 + .8*Quadrature[1];</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Use ArcTangent to compute the 
current phase}<BR>&nbsp;If AbsValue(InPhase +InPhase[1]) &gt; 0 then Phase = 
ArcTangent(AbsValue((Quadrature+Quadrature[1]) / 
(InPhase+InPhase[1])));</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Resolve the ArcTangent 
ambiguity}<BR>&nbsp;If InPhase &lt; 0 and Quadrature &gt; 0 then Phase = 180 - 
Phase;<BR>&nbsp;If InPhase &lt; 0 and Quadrature &lt; 0 then Phase = 180 + 
Phase;<BR>&nbsp;If InPhase &gt; 0 and Quadrature &lt; 0 then Phase = 360 - 
Phase;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Compute a differential phase, 
resolve phase wraparound, and limit delta phase errors}<BR>&nbsp;DeltaPhase = 
Phase[1] - Phase;<BR>&nbsp;If Phase[1] &lt; 90 and Phase &gt; 270 then 
DeltaPhase = 360 + Phase[1] - Phase;<BR>&nbsp;If DeltaPhase &lt; 1 then 
DeltaPhase = 1;<BR>&nbsp;If DeltaPhase &gt; 60&nbsp; then Deltaphase = 
60;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Sum DeltaPhases to reach 360 
degrees.&nbsp; The sum is the instantaneous period.}<BR>&nbsp;InstPeriod = 
0;<BR>&nbsp;Value4 = 0;<BR>&nbsp;For count = 0 to 60 begin<BR>&nbsp;&nbsp;Value4 
= Value4 + DeltaPhase[count];<BR>&nbsp;&nbsp;If Value4 &gt; 360 and InstPeriod = 
0 then begin<BR>&nbsp;&nbsp;&nbsp;InstPeriod = 
count;<BR>&nbsp;&nbsp;end;<BR>&nbsp;end;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Resolve Instantaneous Period errors 
and smooth}<BR>&nbsp;If InstPeriod = 0 then InstPeriod = 
InstPeriod[1];<BR>&nbsp;Value5 = .25*(InstPeriod) + .75*Period[1];</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;{Compute Trendline as simple average 
over the measured dominant cycle period}<BR>&nbsp;Period = 
IntPortion(Value5*SmoothFact);<BR>&nbsp;If Period&gt;MaxBarsBack-5 then 
Period=MaxBarsBack-5;<BR>&nbsp;Trendline = 0;<BR>&nbsp;For&nbsp; count = 0 to 
Period {+ 1} begin<BR>&nbsp;&nbsp;Trendline = Trendline + 
Price[count];<BR>&nbsp;end;<BR>&nbsp;If Period &gt; 0 then Trendline = Trendline 
/ (Period + 1{2});</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp; 
{Value1=T3Average(Trendline,5);}</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;NewPrice = .33*(Price + 
.5*(Price - Price[3])) + .67*NewPrice[1];</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;if CurrentBar &lt; 26 then 
begin<BR>&nbsp;&nbsp;Trendline = Price;<BR>&nbsp;&nbsp;NewPrice = 
Price;<BR>&nbsp;End;<BR>&nbsp;{Trendline=T3Average(Trendline,Smooth);}<BR>&nbsp;{Trendline=Trendline+(NewPrice-Trendline)*Smooth*.01;}<BR>&nbsp;&nbsp;&nbsp;<BR>{end;}</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Ehler_Instant_Trend = 
Trendline;<BR>&nbsp;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New"><BR><FONT size=2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>- - - - - - - - - - - - - - - - - - - - - - 
- - - - - - - -<BR>Clyde Lee&nbsp;&nbsp; 
Chairman/CEO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (Home of 
SwingMachine)<BR>SYTECH 
Corporation&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
email:&nbsp;&nbsp; &lt;</FONT><A href="mailto:clydelee@xxxxxxx";><FONT 
face="Courier New" size=2>clydelee@xxxxxxx</FONT></A><FONT face="Courier New" 
size=2>&gt; <BR>7910 Westglen, Suite 105&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Work:&nbsp;&nbsp;&nbsp; (713) 783-9540<BR>Houston,&nbsp; TX&nbsp; 
77063&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Fax:&nbsp;&nbsp;&nbsp;&nbsp; (713) 783-1092&nbsp;&nbsp;&nbsp; <BR>- - - - - - - 
- - - - - - - - - - - - - - - - - - - - - - -<BR>- - - - - - - - - - - - - - - - 
- - - - - - - - - - - - - -<BR>To subscribe / unsubscribe from SwingMachine 
list<BR></FONT><A href="http://www.egroups.com/list/swingmachine/";><FONT 
face="Courier New" 
size=2>http://www.egroups.com/list/swingmachine/</FONT></A></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>After joining list the freeware 
SwingMachine program <BR>(DOS Version) is available in the&nbsp; VAULT&nbsp; 
at:<BR></FONT><A href="http://www.egroups.com/list/swingmachine/";><FONT 
face="Courier New" 
size=2>http://www.egroups.com/list/swingmachine/</FONT></A><BR><FONT 
face="Courier New" size=2>- - - - - - - - - - - - - - - - - - - - - - - - - - - 
- - -<BR></FONT></DIV>
<DIV><FONT face="Courier New" size=2>----- Original Message ----- </FONT>
<DIV><FONT face="Courier New" size=2>From: &lt;</FONT><A 
href="mailto:FrankKaeb@xxxxxxx";><FONT face="Courier New" 
size=2>FrankKaeb@xxxxxxx</FONT></A><FONT face="Courier New" 
size=2>&gt;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>To: &lt;</FONT><A 
href="mailto:code-list@xxxxxxxxxxxxx";><FONT face="Courier New" 
size=2>code-list@xxxxxxxxxxxxx</FONT></A><FONT face="Courier New" 
size=2>&gt;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Sent: Monday, April 10, 2000 
14:05</FONT></DIV>
<DIV><FONT face="Courier New" size=2>Subject: CL_EL help with recent TASC 
article</FONT></DIV></DIV>
<DIV><FONT face="Courier New"><BR><FONT size=2></FONT></FONT></DIV><FONT 
face="Courier New" size=2>&gt; Does anyone have the EL code in .ELA format for 
the recent article by Ehlers <BR>&gt; about Hilbert transformation and 
instantaneous trendlines?<BR>&gt; <BR>&gt; Frank <BR>&gt; 
---------------------------------<BR>&gt; Subscribe/Unsubscribe at <BR>&gt; 
</FONT><A href="http://www.markbrown.com/list.htm";><FONT face="Courier New" 
size=2>http://www.markbrown.com/list.htm</FONT></A><BR><FONT face="Courier New" 
size=2>&gt; </FONT></BODY></HTML>
</x-html>
Attachment Converted: "f:\eudora\attach\junk117.gif"

Attachment Converted: "f:\eudora\attach\EHLINSTT.ELA"