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

Peak Detection



PureBytes Links

Trading Reference Links

In att. gif you may see that the last detected peak is
46 (!!!) days ago.(point A)
The reason is simple : Even if I have per=3, not any drop
more than -3% occurred the last 46 days for H value.
If the trendlines already exist, it is not difficult to calculate
crosses. You have the equation of the trendline as an array.
In 
http://www.amibroker.com/library/detail.php?id=105
comment one,
trendlineS = aS * ( x -endt ) + bS; 
trendlineR = aR * ( x -endt1 ) + bR; 
are the Support-Resistance line equations.
You may use conditions like

cond1=cross(trendlineS,L) and cum(1)>endt;
(a violation of support, after the last point defining support line)
or

cond2=cross(H,trendlineR) and cum(1)>endt1;
(an exaggeration of Resistance, after the last point defining Resistance line).
The distance between the lines is simply the difference of the two arrays.

dist=trendlineR-trendlineS;
no matter if the lines are parallel or not.
(I have to explain here that the only meaningful distance is the vertical, parallel to
y axis distance. Anything else is for design purposes only and changes withzoom
in, zoom out. An 90 deg angle will be 60 or 30 if you change zoom)
As for angles, please read message # 3825 from Aug 12,2001.
Dimitris Tsokakis


------=_NextPart_001_0016_01C181C1.6F2D5E40
Content-Type: text/html;
charset="iso-8859-7"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-7" http-equiv=Content-Type>
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Here is a reply to Thomas Zmuck message 
#7134:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>In att. gif you may see that the last detected peak 
is</FONT></DIV>
<DIV><FONT face=Arial size=2>46 (!!!) days ago.(point A)</FONT></DIV>
<DIV><FONT face=Arial size=2>The reason is simple : Even if I have per=3, not 
any drop</FONT></DIV>
<DIV><FONT face=Arial size=2>more than -3% occurred the last 46 days for H 
value.</FONT></DIV>
<DIV><FONT face=Arial size=2>If the trendlines already exist, it is not 
difficult to calculate</FONT></DIV>
<DIV><FONT face=Arial size=2>crosses. You have the equation of the trendline as 
an array.</FONT></DIV>
<DIV><FONT face=Arial size=2>In </FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="http://www.amibroker.com/library/detail.php?id=105";>http://www.amibroker.com/library/detail.php?id=105</A></FONT></DIV>
<DIV><FONT face=Arial size=2>comment one,</FONT></DIV>
<DIV><FONT face=Arial size=2>trendlineS = aS * ( x -endt ) + bS; <BR>trendlineR 
= aR * ( x -endt1 ) + bR; </FONT></DIV>
<DIV><FONT face=Arial size=2>are the Support-Resistance line 
equations.</FONT></DIV>
<DIV><FONT face=Arial size=2>You may use conditions like</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><EM>cond1=cross(trendlineS,L) and 
cum(1)&gt;endt</EM>;</FONT></DIV>
<DIV><FONT face=Arial size=2>(a violation of support, after the last point 
defining support line)</FONT></DIV>
<DIV><FONT face=Arial size=2>or</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><EM>cond2=cross(H,trendlineR) and 
cum(1)&gt;endt1;</EM></FONT></DIV>
<DIV><FONT face=Arial size=2>(an exaggeration of Resistance, after the last 
point defining Resistance line).</FONT></DIV>
<DIV><FONT face=Arial size=2>The distance between the lines is simply the 
difference of the two arrays.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><EM>dist=trendlineR-trendlineS;</EM></FONT></DIV>
<DIV><FONT face=Arial size=2>no matter if the lines are parallel or 
not.</FONT></DIV>
<DIV><FONT face=Arial size=2>(I have to explain here that the only meaningful 
distance is the vertical, parallel to</FONT></DIV>
<DIV><FONT face=Arial size=2>y axis distance. Anything else is for design 
purposes only and changes with zoom</FONT></DIV>
<DIV><FONT face=Arial size=2>in, zoom out. An 90 deg angle will be 60 or 30 if 
you change zoom)</FONT></DIV>
<DIV><FONT face=Arial size=2>As for angles, please read message # 3825 from Aug 
12,2001.</FONT></DIV>
<DIV><FONT face=Arial size=2>Dimitris Tsokakis<BR></DIV></FONT></BODY></HTML>

------=_NextPart_001_0016_01C181C1.6F2D5E40--

Attachment:
gif00280.gif

Attachment: Description: "Description: GIF image"