<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>BullCharts : Class A divergence</title>
  <link>http://www.bullcharts.com.au/forum/</link>
  <description>This is an XML content feed of; BullCharts : BullScript : Class A divergence</description>
  <copyright>Copyright (c) 2006-2009 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 08:53:36 +0000</pubDate>
  <lastBuildDate>Sat, 27 Feb 2010 17:04:29 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.bullcharts.com.au/forum/RSS_post_feed.asp?TID=556</WebWizForums:feedURL>
  <image>
   <title>BullCharts</title>
   <url>http://www.bullcharts.com.au/forum/http://www.bullcharts.com.au/images/bull_logo.gif</url>
   <link>http://www.bullcharts.com.au/forum/</link>
  </image>
  <item>
   <title>Class A divergence : Let P and Q be two probability...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2311#2311</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=717" rel="nofollow">sonu panwar</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 27&nbsp;Feb&nbsp;2010 at 5:04pm<br /><br /><p>Let <i>P</i> and <i>Q</i> be two probability distributions over a space Ω such that <i>P</i> is <a href="http://en.wikipedia.org/wiki/Absolutely_c&#111;ntinuous" target="_blank">absolutely continuous</a> with respect to <i>Q</i>. Then, for a <a href="http://en.wikipedia.org/wiki/C&#111;nvex_functi&#111;n" target="_blank">convex function</a> <i>f</i> such that <i>f</i>(1) = 0, the <i>f</i>-divergence of <i>Q</i> from <i>P</i> is</p><dl><dd><img src="http://upload.wikimedia.org/math/d/7/b/d7b2d4bccab6ee98efb5df71c3ff5251.png" border="0" alt="%20D_f%28P%5Cparallel%20Q%29%20=%20%5Cint_%7b%5COmega%7d%20f%5Cleft%28%5Cfrac%7bdP%7d%7bdQ%7d%5Cright%29%5C,dQ." /></dd></dl><p>If <i>P</i> and <i>Q</i> are both absolutely continuous with respect to a reference distribution <i>μ</i> on Ω then their <a href="http://en.wikipedia.org/wiki/Probability_densities" target="_blank">probability densities</a> <i>p</i> and <i>q</i> satisfy <i>dP = p dμ</i> and <i>dQ = q dμ</i>. In this case the <i>f</i>-divergence can be written as</p><dl><dd><img src="http://upload.wikimedia.org/math/1/8/9/189cdf170ee204604ce5bec1612a2394.png" border="0" alt="%20D_f%28P%5Cparallel%20Q%29%20=%20%5Cint_%7b%5COmega%7d%20f%5Cleft%28%5Cfrac%7bp%28x%29%7d%7bq%28x%29%7d%5Cright%29q%28x%29%5C,d%5Cmu%28x%29." /></dd></dl><h2><span ="editsecti&#111;n"></span> <span ="mw-line" id="Instances_of_f-divergences">Instances of <i>f</i>-divergences</span></h2>]]>
   </description>
   <pubDate>Sat, 27 Feb 2010 17:04:29 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2311#2311</guid>
  </item> 
  <item>
   <title>Class A divergence : Okay I&amp;#039;ve added DMI. Good...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2234#2234</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 25&nbsp;Dec&nbsp;2009 at 2:01am<br /><br /><P>Okay I've added DMI. &nbsp;Good to hear it's faster.&nbsp;&nbsp; </P><DIV><SPAN lang=EN-AU></SPAN>&nbsp;</DIV><DIV><SPAN lang=EN-AU>&#091;Description<FONT size=3>="Bullish &amp; Bearish Divergence, Max"</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</DIV></FONT></FONT><FONT size=3><P>d := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>InputDate</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Start Date"</FONT></FONT><FONT size=3>, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>date</FONT></FONT><FONT size=3>(2009,2,10));</P><P>start:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>BarsSince</FONT></FONT><FONT size=3>(OnOrSkipped(d));</P><P>ind:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"MACD=1, RSI=2, STOC=3, DMI=4"</FONT></FONT><FONT size=3>,1,1);</P><P>pds:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"indicator periods"</FONT></FONT><FONT size=3>,5,1);</P><P>Ch:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"peak/trough depth minimum (0-100%)"</FONT></FONT><FONT size=3>,0,0)/100;</P><P>MD := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>macd</FONT></FONT><FONT size=3>()-</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>macd</FONT></FONT><FONT size=3>(),9,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P>DSI := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3> - </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>llv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>L</FONT></FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>) / </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hhv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>H</FONT></FONT><FONT size=3>,pds) - </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>llv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>L</FONT></FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>))*100,2,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P>y:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>If</FONT></FONT><FONT size=3>(ind=1,MD, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>If</FONT></FONT><FONT size=3>(ind=2,RSI(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,pds), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>If</FONT></FONT><FONT size=3>(ind=3,DSI, DX(pds)))), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3>{ detect indicator peak }</P></FONT></FONT><FONT size=3><P>Pky:=y&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&gt;=(y+</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2))/2*(1+Ch);</P><P>Pky1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P><P>Pky2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ save corresponding price bar peak }</P></FONT></FONT><FONT size=3><P>Pkx1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>Pkx2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ detect indicator trough }</P></FONT></FONT><FONT size=3><P>Try:=y&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&lt;=(y+</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2))/2*(1-Ch);</P><P>Try1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P><P>Try2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ save corresponding price bar trough }</P></FONT></FONT><FONT size=3><P>Trx1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>Trx2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>y;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>marker</FONT></FONT><FONT size=3>=type1</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>name</FONT></FONT><FONT size=3>=Bull_Div</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>(Try </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Trx1&lt;Trx2 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Try1&gt;Try2);</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>marker</FONT></FONT><FONT size=3>=type2</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>name</FONT></FONT><FONT size=3>=Bear_Div</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>(Pky </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Pkx1&gt;Pkx2 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Pky1&lt;Pky2);</P><DIV></FONT></SPAN>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>¸.·°¯°·.¸¸.-&gt; Merry Christmas &lt;-.¸¸.·°¯°·.¸&nbsp;&nbsp;&nbsp; </DIV>]]>
   </description>
   <pubDate>Fri, 25 Dec 2009 02:01:20 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2234#2234</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi Maximo,  That really makes...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2233#2233</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=712" rel="nofollow">hektorgsd</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 24&nbsp;Dec&nbsp;2009 at 4:28pm<br /><br /><P>Hi Maximo,</P><DIV>&nbsp;</DIV><DIV>That really makes it quicker. I really appreciate your help<img src="http://www.bullchart.com.au/forum/smileys/smiley32.gif" height="17" width="18" border="0" alt="Clap" /></DIV><DIV>&nbsp;</DIV><DIV>The new formula does not have DMI? Could you please help with the script with the DMI divergence with the start time option? I like having the four to compare!</DIV><DIV>&nbsp;</DIV><DIV>Merry Xmas</DIV><DIV>&nbsp;</DIV><DIV>H.</DIV>]]>
   </description>
   <pubDate>Thu, 24 Dec 2009 16:28:46 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2233#2233</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi,   I&amp;#039;m not so sure that...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2232#2232</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 23&nbsp;Dec&nbsp;2009 at 10:53pm<br /><br />Hi, <DIV>&nbsp;</DIV><DIV>I'm not so sure that it would make it much faster,&nbsp;though give it a try and let me know.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;Description</FONT></FONT><FONT size=3>="Bullish &amp; Bearish Divergence, Max"</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>d := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>InputDate</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Start Date"</FONT></FONT><FONT size=3>, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>date</FONT></FONT><FONT size=3>(2009,2,10));</P><P>start:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>BarsSince</FONT></FONT><FONT size=3>(OnOrSkipped(d));</P><P>ind:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"MACD=1, RSI=2, STOC=3"</FONT></FONT><FONT size=3>,3,1);</P><P>pds:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"indicator periods"</FONT></FONT><FONT size=3>,5,1);</P><P>Ch:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Input</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"peak/trough depth minimum (0-100%)"</FONT></FONT><FONT size=3>,0,0)/100;</P><P>MD := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>macd</FONT></FONT><FONT size=3>()-</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>macd</FONT></FONT><FONT size=3>(),9,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P>DSI := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3> - </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>llv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>L</FONT></FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>) / </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ma</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hhv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>H</FONT></FONT><FONT size=3>,pds) - </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>llv</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>L</FONT></FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>))*100,2,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>E</FONT></FONT><FONT size=3>), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P>y:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(start,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>If</FONT></FONT><FONT size=3>(ind=1,MD,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>If</FONT></FONT><FONT size=3>(ind=2,RSI(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,pds),DSI)), </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>prev</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>));</P><P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3>{ detect indicator peak }</P></FONT></FONT><FONT size=3><P>Pky:=y&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&gt;=(y+</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2))/2*(1+Ch);</P><P>Pky1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P><P>Pky2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ save corresponding price bar peak }</P></FONT></FONT><FONT size=3><P>Pkx1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>Pkx2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ detect indicator trough }</P></FONT></FONT><FONT size=3><P>Try:=y&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1)&lt;=(y+</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-2))/2*(1-Ch);</P><P>Try1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P><P>Try2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ save corresponding price bar trough }</P></FONT></FONT><FONT size=3><P>Trx1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>Trx2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>C</FONT></FONT><FONT size=3>,-1));</P><P>y;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>marker</FONT></FONT><FONT size=3>=type1</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>name</FONT></FONT><FONT size=3>=Bull_Div</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>(Try </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Trx1&lt;Trx2 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Try1&gt;Try2);</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>marker</FONT></FONT><FONT size=3>=type2</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>;</FONT></FONT><FONT size=3> </FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>name</FONT></FONT><FONT size=3>=Bear_Div</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>(Pky </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Pkx1&gt;Pkx2 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> Pky1&lt;Pky2);</P><DIV></DIV></FONT></DIV><span style="font-size:10px"><br /><br />Edited by maximo - 23&nbsp;Dec&nbsp;2009 at 11:02pm</span>]]>
   </description>
   <pubDate>Wed, 23 Dec 2009 22:53:56 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2232#2232</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi maximo,    I have been...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2228#2228</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=712" rel="nofollow">hektorgsd</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 21&nbsp;Dec&nbsp;2009 at 12:29pm<br /><br /><FONT size=2 face="Arial, Helvetica, sans-serif">Hi maximo,<DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV>I have been testing this indicator, looking for multiple confirmations. The only problem is that my PC takes a fair while to calulate the divergences. I use it on daily chart, is it possible to write into the script to say just to work out the bullish and bearish&nbsp;divergences for the last 1 or 2 years ( not 10 years worth of data). I am sure this would make the calulations much faster.<DIV></DIV><DIV></DIV>Thanks for your help<DIV></DIV>H.</FONT>]]>
   </description>
   <pubDate>Mon, 21 Dec 2009 12:29:09 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2228#2228</guid>
  </item> 
  <item>
   <title>Class A divergence : thanks Maximo...just saw the further...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2055#2055</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=223" rel="nofollow">Bana</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 08&nbsp;May&nbsp;2009 at 11:30am<br /><br />thanks Maximo...just saw the further enhancements you had posted. <br><br>]]>
   </description>
   <pubDate>Fri, 08 May 2009 11:30:19 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2055#2055</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi Maximo, what a great bit of...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2051#2051</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=294" rel="nofollow">jalna</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 02&nbsp;May&nbsp;2009 at 10:08pm<br /><br />Hi Maximo, what a great bit of code writing. Thanks, its a great indicator. Thanks heaps]]>
   </description>
   <pubDate>Sat, 02 May 2009 22:08:52 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2051#2051</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi Jalna,   Just select the...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2049#2049</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 30&nbsp;Apr&nbsp;2009 at 3:38am<br /><br />Hi Jalna, <DIV>&nbsp;</DIV><DIV>Just select the number of the indicator you want to display in the settings:&nbsp; 1=MACD the default setting is 4 for the Stochastic and&nbsp;2=RSI.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I set up 3 seperate instances of this with a different number in the indicator select number.&nbsp;&nbsp;&nbsp;The other number is used as the period for the indicator.&nbsp; ie. 5 is the period for the default Stochastic, so you are right about that.&nbsp;&nbsp;&nbsp;This number is a bit small for the RSI,&nbsp;so 10 or 14 for&nbsp;it would be better.&nbsp;</DIV><DIV>The MACD&nbsp;uses the standard settings.</DIV><DIV>&nbsp;</DIV><DIV>Traders International sell the Stochastic &amp; Macd indicator with a day trading education package for $7500.&nbsp;&nbsp; That's&nbsp;quite&nbsp;a hefty sum for&nbsp;an education in indicators lol.</DIV><DIV>&nbsp;</DIV><DIV>Many&nbsp;divergences are short term, like with that day trading mob.&nbsp; As short as a few minutes to days on the daily chart.&nbsp;&nbsp; All depends on your time frame.</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by maximo - 30&nbsp;Apr&nbsp;2009 at 3:50am</span>]]>
   </description>
   <pubDate>Thu, 30 Apr 2009 03:38:32 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2049#2049</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi Maximo, thanks for all the...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2048#2048</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=294" rel="nofollow">jalna</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 29&nbsp;Apr&nbsp;2009 at 10:24pm<br /><br />Hi Maximo, thanks for all the work on the divergence indicator. Divergence seems to be getting popular especially with EW enthusiasts<br>&nbsp;I downloaded your code but it didn't have the 3 indicators underneath&nbsp; . I am mainly interested in the MACD. It is the same as the Elliott Wave oscillator.<br>The chart you posted up, was that just a demo of what would be happening on the indicator you have written. The indicator appears to be the Stoch<br>Are these very short term divergences too or are the indicators set at their normal periods ? Thanks<br>]]>
   </description>
   <pubDate>Wed, 29 Apr 2009 22:24:29 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2048#2048</guid>
  </item> 
  <item>
   <title>Class A divergence :  Example of multi-matching.   Edited...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2046#2046</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 26&nbsp;Apr&nbsp;2009 at 1:01am<br /><br /><P><img src="http://www.bullcharts.com.au/forum/uploads/189/DivergenceXJO.gif" height="866" width="1025" border="0" /></P><DIV>Example of multi-matching.&nbsp; </DIV><DIV>&nbsp;</DIV><P>&nbsp;</P><span style="font-size:10px"><br /><br />Edited by maximo - 26&nbsp;Apr&nbsp;2009 at 1:19am</span>]]>
   </description>
   <pubDate>Sun, 26 Apr 2009 01:01:05 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2046#2046</guid>
  </item> 
  <item>
   <title>Class A divergence : Hi Bana,   I had a good look...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2045#2045</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 25&nbsp;Apr&nbsp;2009 at 11:46pm<br /><br />Hi Bana, <DIV>&nbsp;</DIV><DIV>I had a good look at this indicator and&nbsp;have reconstructed the code for a&nbsp;few reasons.</DIV><DIV>&nbsp;</DIV><DIV>1.&nbsp; It didn't sync the indicator peaks with the price on the very bar the peak occurs.&nbsp; This results in an occasional mismatch&nbsp;so</DIV><DIV>&nbsp;indicating divergence when there wasn't any. This sync is also called correct correspondence.</DIV><DIV>&nbsp;</DIV><DIV>2. Binary indicators aren't very user friendly.. like which spike means what again?</DIV><DIV>&nbsp;</DIV><DIV>3.&nbsp;Also&nbsp;didn't show the actual indicator being used, which would be good to see.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;I have added the MACD difference (histogram line)&nbsp;and Stochastic Momentum.</DIV><DIV>You can now&nbsp;compare&nbsp;divergences&nbsp;on multiple indicators and&nbsp;see if they match.&nbsp;&nbsp;&nbsp;&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>Enjoy!</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#800080 size=3><P>&#091;Description</FONT><FONT size=3>="Bullish &amp; Bearish Divergence, Max"</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>ind:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"MACD=1, RSI=2, DMI=3, STOC=4"</FONT><FONT size=3>,4,1);</P><P>pds:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"indicator periods"</FONT><FONT size=3>,5,1);</P><P>Ch:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"peak/trough depth minimum (0-100%)"</FONT><FONT size=3>,0,0)/100;</P><P>MD := </FONT><FONT color=#0000c0 size=3>macd</FONT><FONT size=3>()-</FONT><FONT color=#0000c0 size=3>ma</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>macd</FONT><FONT size=3>(),9,</FONT><FONT color=#0000c0 size=3>E</FONT><FONT size=3>);</P><P>DS := </FONT><FONT color=#0000c0 size=3>ma</FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3>ma</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3> - </FONT><FONT color=#0000c0 size=3>llv</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>L</FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3>E</FONT><FONT size=3>) / </FONT><FONT color=#0000c0 size=3>ma</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hhv</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>H</FONT><FONT size=3>,pds) - </FONT><FONT color=#0000c0 size=3>llv</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>L</FONT><FONT size=3>,pds),pds,</FONT><FONT color=#0000c0 size=3>E</FONT><FONT size=3>))*100,2,</FONT><FONT color=#0000c0 size=3>E</FONT><FONT size=3>);</P><P>y:=</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=1,MD,</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=2,RSI(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,pds),</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=3,DX(pds),DS)));</P><P></FONT><FONT color=#008000 size=3>{ detect indicator peak }</P></FONT><FONT size=3><P>Pky:=y&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&gt;=(y+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2))/2*(1+Ch);</P><P>Pky1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>Pky2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><P>{ save corresponding price bar of peak }</P></FONT><FONT size=3><P>Pkx1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,-1));</P><P>Pkx2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,-1));</P></FONT><FONT color=#008000 size=3><P>{ detect indicator trough }</P></FONT><FONT size=3><P>Try:=y&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&lt;=(y+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2))/2*(1-Ch);</P><P>Try1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>Try2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P></FONT><FONT color=#008000 size=3><P>{ save corresponding price bar of trough }</P></FONT><FONT size=3><P>Trx1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,-1));</P><P>Trx2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,-1));</P><P>y;</P></FONT><FONT color=#800080 size=3><P>&#091;linestyle</FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>marker</FONT><FONT size=3>=type1</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>name</FONT><FONT size=3>=Bull_Div</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>(Try </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Trx1&lt;Trx2 </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Try1&gt;Try2);</P></FONT><FONT color=#800080 size=3><P>&#091;linestyle</FONT><FONT size=3>=marker</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>marker</FONT><FONT size=3>=type2</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>name</FONT><FONT size=3>=Bear_Div</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>(Pky </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Pkx1&gt;Pkx2 </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Pky1&lt;Pky2);</P><DIV></DIV></FONT></DIV><span style="font-size:10px"><br /><br />Edited by maximo - 26&nbsp;Apr&nbsp;2009 at 5:32pm</span>]]>
   </description>
   <pubDate>Sat, 25 Apr 2009 23:46:00 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2045#2045</guid>
  </item> 
  <item>
   <title>Class A divergence : thanks Maximo. Will give it a...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2039#2039</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=223" rel="nofollow">Bana</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 12&nbsp;Apr&nbsp;2009 at 4:50pm<br /><br />thanks Maximo. Will give it a go and put feedback here later on.]]>
   </description>
   <pubDate>Sun, 12 Apr 2009 16:50:07 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2039#2039</guid>
  </item> 
  <item>
   <title>Class A divergence : Gives interesting signals on XJO,...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2037#2037</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=189" rel="nofollow">maximo</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 12&nbsp;Apr&nbsp;2009 at 12:47am<br /><br /><P>&nbsp;Gives interesting signals on XJO, have fun testing.</P><DIV>&nbsp;</DIV><DIV><FONT color=#008000 size=3><P>{Class A price/indicator divergence v3 }{ +1 signal = bullish trough divergences }{ -1 signal = bearish peak divergences }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo.com }</P></FONT><FONT size=3><P>ind:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"MACD=1, RSI=2, DMI=3, Mom=4"</FONT><FONT size=3>,2,1);</P><P>pds:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"indicator periods"</FONT><FONT size=3>,10,1);</P><P>f:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"price field: Close=1, High/Low=2"</FONT><FONT size=3>,1,1);</P><P>Ch:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"peak/trough depth minimum (0-100%)"</FONT><FONT size=3>,0,0)/100;</P><P>shift:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"shift signals back to match divergences=1"</FONT><FONT size=3>,0,0);</P></FONT><FONT color=#008000 size=3><P>{ y:=insert any indicator or Fml("formula name") }</P></FONT><FONT size=3><P>y:=</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=1,</FONT><FONT color=#0000c0 size=3>MACD</FONT><FONT size=3>(),</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=2,RSI(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,pds),</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(ind=3,DX(pds),Mo(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,pds))));</P><P>xu:=</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(f=1,</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,</FONT><FONT color=#0000c0 size=3>H</FONT><FONT size=3>);</P><P>xd:=</FONT><FONT color=#0000c0 size=3>If</FONT><FONT size=3>(f=1,</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,</FONT><FONT color=#0000c0 size=3>L</FONT><FONT size=3>);</P><P>Pkx:=xu&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-1)&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-1)&gt;=(xu+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-2))/2*(1+Ch);</P><P>Pkx1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Pkx,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-1));</P><P>Pkx2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Pkx,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xu,-1));</P><P>Trx:=xd&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-1)&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-1)&lt;=(xd+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-2))/2*(1-Ch);</P><P>Trx1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Trx,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-1));</P><P>Trx2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Trx,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(xd,-1));</P><P>Pky:=y&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&gt;=(y+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2))/2*(1+Ch);</P><P>Pky1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>Pky2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Pky,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>Try:=y&gt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&lt;</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2) </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1)&lt;=(y+</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-2))/2*(1-Ch);</P><P>Try1:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(1,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>Try2:=</FONT><FONT color=#0000c0 size=3>ValueWhen</FONT><FONT size=3>(2,Try,</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(y,-1));</P><P>0;</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(Trx </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Try </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Trx1&lt;Trx2 </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Try1&gt;Try2,shift)-</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>((Pkx </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Pky </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Pkx1&gt;Pkx2 </FONT><FONT color=#0000c0 size=3>AND</FONT><FONT size=3> Pky1&lt;Pky2),shift)</P><DIV></DIV></FONT></DIV>]]>
   </description>
   <pubDate>Sun, 12 Apr 2009 00:47:23 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2037#2037</guid>
  </item> 
  <item>
   <title>Class A divergence : Divergences are very powerful...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2036#2036</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=223" rel="nofollow">Bana</a><br /><strong>Subject:</strong> 556<br /><strong>Posted:</strong> 11&nbsp;Apr&nbsp;2009 at 9:38am<br /><br />Divergences are very powerful signals. Apparently there is a formula in Metastock to search for these. It would be worth testing if it can be converted to bullscript. Any help will be greatly appreciated. thanks<br><br><br><font size="1" face="Verdana, Arial, Helvetica, sans-serif"> Class A price/indicator divergence v3 }{ +1 signal = bullish trough divergences }{ -1 signal = bearish peak divergences }{ ©Copyright 2003 Jose Silva }{ josesilva22@yahoo.com }<br><br>ind:=Input("MACD=1,&nbsp; RSI=2,&nbsp; DMI=3,&nbsp; Mom=4",1,4,1);<br>pds:=Input("indicator periods",2,2520,10);<br>f:=Input("price field: Close=1, High/Low=2",1,2,1);<br>Ch:=Input("peak/trough depth minimum (0-100%)",0,100,0)/100;<br>shift:=Input("shift signals back to match divergences=1",0,1,0);<br><br>{y:=insert any indicator or Fml("formula name")}<br>y:=If(ind=1,MACD(),If(ind=2,RSI(C,pds),<br>&nbsp;If(ind=3,DMI(C),Mo(C,pds))));<br><br>xu:=If(f=1,C,H);<br>xd:=If(f=1,C,L);<br>Pkx:=xu&lt;Ref(xu,-1) AND Ref(xu,-1)&gt;Ref(xu,-2)<br>&nbsp;AND Ref(xu,-1)&gt;=(xu+Ref(xu,-2))/2*(1+Ch);<br>Pkx1:=ValueWhen(1,Pkx,Ref(xu,-1));<br>Pkx2:=ValueWhen(2,Pkx,Ref(xu,-1));<br>Trx:=xd&gt;Ref(xd,-1) AND Ref(xd,-1)&lt;Ref(xd,-2)<br>&nbsp;AND Ref(xd,-1)&lt;=(xd+Ref(xd,-2))/2*(1-Ch);<br>Trx1:=ValueWhen(1,Trx,Ref(xd,-1));<br>Trx2:=ValueWhen(2,Trx,Ref(xd,-1));<br><br>Pky:=y&lt;Ref(y,-1) AND Ref(y,-1)&gt;Ref(y,-2)<br>&nbsp;AND Ref(y,-1)&gt;=(y+Ref(y,-2))/2*(1+Ch);<br>Pky1:=ValueWhen(1,Pky,Ref(y,-1));<br>Pky2:=ValueWhen(2,Pky,Ref(y,-1));<br>Try:=y&gt;Ref(y,-1) AND Ref(y,-1)&lt;Ref(y,-2)<br>&nbsp;AND Ref(y,-1)&lt;=(y+Ref(y,-2))/2*(1-Ch);<br>Try1:=ValueWhen(1,Try,Ref(y,-1));<br>Try2:=ValueWhen(2,Try,Ref(y,-1));<br><br>0;<br>Ref(Trx AND Try AND Trx1&lt;Trx2<br>&nbsp;AND Try1&gt;Try2,shift)<br>-Ref((Pkx AND Pky AND Pkx1&gt;Pkx2<br>&nbsp;AND Pky1&lt;Pky2),shift)</font><br>]]>
   </description>
   <pubDate>Sat, 11 Apr 2009 09:38:48 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=556&amp;PID=2036#2036</guid>
  </item> 
 </channel>
</rss>