<?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 : Zig Zag indicator</title>
  <link>http://www.bullcharts.com.au/forum/</link>
  <description>This is an XML content feed of; BullCharts : BullScript : Zig Zag indicator</description>
  <copyright>Copyright (c) 2006-2009 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 12:00:36 +0000</pubDate>
  <lastBuildDate>Fri, 22 Apr 2011 19:07:26 +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=696</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>Zig Zag indicator : Here&amp;#039;s versions suitable...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2719#2719</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> 696<br /><strong>Posted:</strong> 22&nbsp;Apr&nbsp;2011 at 7:07pm<br /><br /><P>Here's versions suitable for traders that prefer the labels Higher High &amp; Lower Low.</P><P>Scan for Higher Lows also included.&nbsp;&nbsp;&nbsp;Looking at AWC you can see it will find these.</P><FONT size=3><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><P>ZigZag - Highs &amp; Lows Indicator</P><P>&#091;target=Price&#093;<BR>size := input("Zig zag size",5,0);<BR>z := zigzag(Close,size,%);<BR>ispeak := z&gt;hist(z,1) and z&gt;future(z,1);<BR>istrough := z&lt;hist(z,1) and z&lt;future(z,1);<BR>P1 := ValueWhen(1,ispeak,z);<BR>P2 := ValueWhen(2,ispeak,z);<BR>Higher := if(ispeak and P1 &gt; P2,"Higher","Lower");<BR>T1 := ValueWhen(1,istrough,z);<BR>T2 := ValueWhen(2,istrough,z);<BR>Lower := if(istrough and T1 &gt; T2,"Higher","Lower");<BR>&#091;name=LowerPeak&#093; <BR>ScanLowerPeak := if(ispeak and P1 &lt; P2,1,0); <BR>&#091;name=HigherPeak&#093; <BR>ScanHigherPeak := if(ispeak and P1 &gt; P2,1,0); <BR>&#091;name=LowerTrough&#093; <BR>ScanLowerTrough := if(istrough and T1 &lt; T2,1,0); <BR>&#091;name=HigherTrough&#093; <BR>ScanHigherTrough := if(istrough and T1 &gt; T2,1,0);</P><P>&#091;linestyle=Solid; color=black&#093;<BR>z;<BR>&#091;color=Blue&#093;<BR>&#091;linestyle=Text; textalign=Above,Center&#093;<BR>if(isPeak, Higher + " High at " + z, undefined);<BR>High;<BR>&#091;linestyle=Text; textalign=Below,Center&#093;<BR>if(isTrough, Lower + " Low at " + z, undefined); <BR>Low;<BR></P><DIV></DIV><DIV></DIV>..................................................................... <DIV></DIV><DIV></DIV><P>ZigZag - Higher Low signal for scanning</P><P>&#091;Description="ZigZag Higher Low Signal"&#093;<BR>size:=input("ZigZag percentage",5,1);<BR>z := zigzag(Close,size,%);<BR>istrough:= ref(Z,-1)&lt;z AND ref(z,-2)&gt;ref(Z,-1);<BR>T1:=ValueWhen(1,istrough,z);<BR>T2:=ValueWhen(2,istrough,z);<BR>HigherLow:=istrough and T1 &gt; T2;<BR>&#091;name=HigherLow&#093;<BR>HigherLow<BR></FONT></P><span style="font-size:10px"><br /><br />Edited by maximo - 23&nbsp;Apr&nbsp;2011 at 2:50am</span>]]>
   </description>
   <pubDate>Fri, 22 Apr 2011 19:07:26 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2719#2719</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Hey Andre, I know whats causing...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2718#2718</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> 696<br /><strong>Posted:</strong> 21&nbsp;Apr&nbsp;2011 at 11:04pm<br /><br /><P>Hey Andre,</P><DIV>I know whats causing the problem with the scan.&nbsp;&nbsp; The use of future() is not appropriate for scans,&nbsp;since it&nbsp;is looking forward&nbsp;in data for the peak, which doesn't make sense for&nbsp;a scan</DIV><DIV>into future data, ie. not possible.&nbsp;&nbsp; Reserve it only for plotting labels or markers&nbsp;on the correct</DIV><DIV>bar for a turning point into the future.</DIV><DIV>&nbsp;</DIV><DIV>Tested this code for a scan and it works using the following parameters.</DIV><DIV>&nbsp;</DIV><DIV>1. First Value to Compare</DIV><DIV>Is an indicator</DIV><DIV>ZigZag Higher Peak Signal</DIV><DIV>&nbsp;</DIV><DIV>2. Type of Comparison</DIV><DIV>Is greater than</DIV><DIV>Any bar in the last 3 bars</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>="ZigZag Higher Peak Signal"</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>size:=</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>"ZigZag percentage"</FONT></FONT><FONT size=3>,5,1);</P><P>z := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>zigzag</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Close</FONT></FONT><FONT size=3>,size,%);</P><P>ispeak:= </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ref</FONT></FONT><FONT size=3>(Z,-1)&gt;z </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>(z,-2)&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ref</FONT></FONT><FONT size=3>(Z,-1);</P><P>P1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,ispeak,z);</P><P>P2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,ispeak,z);</P><P>HigherPeak:=ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &gt; P2;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=HigherPeak</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>HigherPeak</P><DIV></FONT></DIV></DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by maximo - 22&nbsp;Apr&nbsp;2011 at 12:03am</span>]]>
   </description>
   <pubDate>Thu, 21 Apr 2011 23:04:09 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2718#2718</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Hi Maximo, I tested above program...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2716#2716</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=133" rel="nofollow">Andrzej</a><br /><strong>Subject:</strong> 696<br /><strong>Posted:</strong> 20&nbsp;Apr&nbsp;2011 at 11:47pm<br /><br />Hi Maximo,<DIV>I tested above program in whole and with some modifications. First thing, the scan run returing most records ( let say 293 out of 295), displays total 4 columns but labelled them Lower Trough&nbsp;, 2 columns don't have data. </DIV><DIV>But , good news is that&nbsp;custom indicator created without any modification&nbsp;displays on charts what suppose to display.</DIV><DIV>The scan however&nbsp;is a different story. Below is&nbsp;a&nbsp;restricted indicator called&nbsp;Higher Peaks that I&nbsp;wanted to use in scan either as&nbsp;: "Is an indicator" , or "Is an&nbsp;indicator&nbsp;signal&nbsp;" in order to get only records that have Higher Peaks in let say a few weeks: Scan script:</DIV><DIV>&nbsp; "HigherPeak is true any bar in the last 10 bars "</DIV><DIV>Visual chart inspection shows stock that satisfy this criterion but the scan using custom indicator called Higher Peak does not return any records and quite often the scan crash ( seems does not like this syntax). Any ideas or suggestions for what may be a problem this time :-) ?</DIV><DIV>Custom indicator Higher Peaks has following code :</DIV><DIV><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;target</FONT></FONT><FONT size=3>=Price</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>size:= 8;</P><P>z := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>zigzag</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Close</FONT></FONT><FONT size=3>,size,%);</P><P>ispeak := z&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hist</FONT></FONT><FONT size=3>(z,1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> z&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>future</FONT></FONT><FONT size=3>(z,1);</P><P>P1 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,ispeak,z);</P><P>P2 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,ispeak,z);</P><P>Higher := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &gt; P2,</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Higher"</FONT></FONT><FONT size=3>,</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>);</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=HigherPeak</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</FONT></FONT><FONT size=3> </P><P>ScanHigherPeak := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &gt; P2,1,0);</P><P>ScanHigherPeak; </P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=Solid</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>color</FONT></FONT><FONT size=3>=black</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>z;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;color</FONT></FONT><FONT size=3>=Blue</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P><P>&#091;linestyle</FONT></FONT><FONT size=3>=Text</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>textalign</FONT></FONT><FONT size=3>=Above,Center</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>if</FONT></FONT><FONT size=3>(isPeak, Higher + </FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>" Peak at "</FONT></FONT><FONT size=3> + z, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>);</P></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>High</FONT></FONT><FONT size=3>;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=HigherPeak</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>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>&#093;</FONT></FONT><FONT size=3>;</P><P>ScanHigherPeak </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>not</FONT></FONT><FONT size=3> </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hist</FONT></FONT><FONT size=3>(ScanHigherPeak,1);</P><P>　</P><P>　</P></FONT></DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 20 Apr 2011 23:47:15 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2716#2716</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Hi Andre   This indicator will...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2714#2714</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> 696<br /><strong>Posted:</strong> 19&nbsp;Apr&nbsp;2011 at 6:12pm<br /><br />Hi Andre <DIV>&nbsp;</DIV><DIV>This indicator will show that&nbsp;this&nbsp;one is&nbsp;working. Let me know if the scan is working.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;target</FONT></FONT><FONT size=3>=Price</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>size := </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>"Zig zag size"</FONT></FONT><FONT size=3>,4,0);</P><P>z := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>zigzag</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Close</FONT></FONT><FONT size=3>,size,%);</P><P>ispeak := z&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hist</FONT></FONT><FONT size=3>(z,1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> z&gt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>future</FONT></FONT><FONT size=3>(z,1);</P><P>istrough := z&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>hist</FONT></FONT><FONT size=3>(z,1) </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> z&lt;</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>future</FONT></FONT><FONT size=3>(z,1);</P><P>P1 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,ispeak,z);</P><P>P2 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,ispeak,z);</P><P>Higher := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &gt; P2,</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Higher"</FONT></FONT><FONT size=3>,</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Lower"</FONT></FONT><FONT size=3>);</P><P>T1 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,istrough,z);</P><P>T2 := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,istrough,z);</P><P>Lower := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(istrough </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> T1 &gt; T2,</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Higher"</FONT></FONT><FONT size=3>,</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Lower"</FONT></FONT><FONT size=3>);</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=LowerPeak</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</FONT></FONT><FONT size=3> </P><P>ScanLowerPeak := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &lt; P2,1,0); </P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=HigherPeak</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</FONT></FONT><FONT size=3> </P><P>ScanHigherPeak := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(ispeak </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> P1 &gt; P2,1,0); </P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=LowerTrough</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</FONT></FONT><FONT size=3> </P><P>ScanLowerTrough := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(istrough </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> T1 &lt; T2,1,0); </P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;name</FONT></FONT><FONT size=3>=HigherTrough</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</FONT></FONT><FONT size=3> </P><P>ScanHigherTrough := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>if</FONT></FONT><FONT size=3>(istrough </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>and</FONT></FONT><FONT size=3> T1 &gt; T2,1,0);</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=Solid</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>color</FONT></FONT><FONT size=3>=black</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>z;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;color</FONT></FONT><FONT size=3>=Blue</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P><P>&#091;linestyle</FONT></FONT><FONT size=3>=Text</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>textalign</FONT></FONT><FONT size=3>=Above,Center</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>if</FONT></FONT><FONT size=3>(isPeak, Higher + </FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>" Peak at "</FONT></FONT><FONT size=3> + z, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>);</P></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>High</FONT></FONT><FONT size=3>;</P></FONT><FONT color=#800080 size=3><FONT color=#800080 size=3><P>&#091;linestyle</FONT></FONT><FONT size=3>=Text</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>textalign</FONT></FONT><FONT size=3>=Below,Center</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>if</FONT></FONT><FONT size=3>(isTrough, Lower + </FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>" Trough at "</FONT></FONT><FONT size=3> + z, </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>undefined</FONT></FONT><FONT size=3>); </P></FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3><P>Low</FONT></FONT><FONT size=3>;</P></FONT><FONT size=3></DIV></FONT><span style="font-size:10px"><br /><br />Edited by maximo - 19&nbsp;Apr&nbsp;2011 at 10:19pm</span>]]>
   </description>
   <pubDate>Tue, 19 Apr 2011 18:12:19 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2714#2714</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Thank you for your help. I have...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2712#2712</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=133" rel="nofollow">Andrzej</a><br /><strong>Subject:</strong> 696<br /><strong>Posted:</strong> 16&nbsp;Apr&nbsp;2011 at 2:37pm<br /><br /><P>Thank you for your help. I have followed up the same idea in your code using ref function. Here is a complete snippet.</P><FONT color=#800080><FONT color=#800080><P><FONT size=1>&#091;target</FONT></FONT></FONT><FONT size=1> =Price<FONT color=#800080><FONT color=#800080>&#093;</P></FONT></FONT></FONT><P><FONT size=1>size:= 4;</FONT></P><P><FONT size=1>z:=<FONT color=#0000c0><FONT color=#0000c0>zigzag</FONT></FONT>(<FONT color=#0000c0><FONT color=#0000c0>Close</FONT></FONT>,size,%);</FONT></P><FONT color=#008000><FONT color=#008000 size=1><P>{Define using Ref function instead of hist and future }</P></FONT></FONT><P><FONT size=1>ispeak1:= z&gt;<FONT color=#0000c0><FONT color=#0000c0>ref</FONT></FONT>(z,-1) <FONT color=#0000c0><FONT color=#0000c0>and</FONT></FONT> <FONT color=#0000c0><FONT color=#0000c0>ref</FONT></FONT>(z,1)&lt;<FONT color=#0000c0><FONT color=#0000c0>ref</FONT></FONT>(z,-2);</FONT></P><P><FONT size=1>peak1:=<FONT color=#0000c0><FONT color=#0000c0>ValueWhen</FONT></FONT>(1,ispeak1,<FONT color=#0000c0><FONT color=#0000c0>ref</FONT></FONT>(<FONT color=#0000c0><FONT color=#0000c0>C</FONT></FONT>,-1));</FONT></P><P><FONT size=1>peak2:=<FONT color=#0000c0><FONT color=#0000c0>ValueWhen</FONT></FONT>(2,ispeak1,<FONT color=#0000c0><FONT color=#0000c0>ref</FONT></FONT>(<FONT color=#0000c0><FONT color=#0000c0>C</FONT></FONT>,-1));</FONT></P><FONT color=#008000><FONT color=#008000><P><FONT size=1>{Condition}</FONT></FONT></FONT><FONT size=1>filter := peak1 &gt; peak2 ; </FONT><FONT size=1>filter;</FONT></P><P><FONT size=1>peak1;</FONT></P><FONT color=#008000><FONT color=#008000 size=1><P>{Columns}</P><DIV></FONT></FONT><FONT color=#800080><FONT color=#800080><FONT size=1>&#091;name</FONT></FONT></FONT><FONT size=1>="IPeak1"<FONT color=#800080><FONT color=#800080>;</FONT></FONT> <FONT color=#800080><FONT color=#800080>dp</FONT></FONT>="3"<FONT color=#800080><FONT color=#800080>&#093;</FONT></FONT> peak1;</FONT></DIV><DIV><FONT size=1></FONT>&nbsp;</DIV><DIV><FONT size=1>However, when running scan on S&amp;P ASX300 it returns 0 records saying: undefined filter results. I think it means that values for peak1 , peak2 are not created. The last line <FONT color=#800080><FONT color=#800080><FONT size=1>&#091;name</FONT></FONT></FONT><FONT size=1>="IPeak1"<FONT color=#800080><FONT color=#800080>;</FONT></FONT> <FONT color=#800080><FONT color=#800080>dp</FONT></FONT>="3"<FONT color=#800080><FONT color=#800080>&#093;</FONT></FONT> peak1 should return value for peak1, but it doesn't. Variable z is created and can be seen in scan. </FONT></FONT></DIV><DIV><FONT size=1>Are you able to retest the snippet and get values peak1/peak2 and some records on Weekly or daily data please ?</FONT></DIV><DIV><FONT size=1>thank you Maximo for you time and interest.</FONT></DIV><DIV><FONT size=1>Andrzej</DIV></FONT>]]>
   </description>
   <pubDate>Sat, 16 Apr 2011 14:37:16 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2712#2712</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Hey Andrzej   This indicator...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2707#2707</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> 696<br /><strong>Posted:</strong> 13&nbsp;Apr&nbsp;2011 at 1:15am<br /><br />Hey Andrzej <DIV>&nbsp;</DIV><DIV>This indicator uses ValueWhen to save previous values of ZigZag, RSI &amp; Close to measure divergence.&nbsp; Hope it helps with the coding.&nbsp; I think using the future fuction in your code was a problem.</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>="Divergence of RSI using ZigZag"</FONT><FONT color=#800080 size=3><FONT color=#800080 size=3>&#093;</P></FONT></FONT><FONT size=3><P>expr := </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>expression</FONT></FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3><FONT color=#008b8b size=3>"Expression"</FONT></FONT><FONT size=3>);</P><P>nrsi := </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>"RSI Time periods"</FONT></FONT><FONT size=3>,14,1);</P><P>RSIval := rsi(expr, nrsi);</P><P>Zper := </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>"ZigZag percentage"</FONT></FONT><FONT size=3>,3,1);</P><P>I1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%)&gt;</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>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%),-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>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%),1)&lt;</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>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%),-2);</P></FONT><FONT color=#008000 size=3><FONT color=#008000 size=3><P>{ save values 1 peak ago }</P></FONT></FONT><FONT size=3><P>V1:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,I1,</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>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%),-1));</P><P>V2:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(1,I1,</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>{ save values 2 peaks ago }</P></FONT></FONT><FONT size=3><P>V3:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,I1, </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>Zigzag</FONT></FONT><FONT size=3>(RSIval,Zper,%),-1));</P><P>V4:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>ValueWhen</FONT></FONT><FONT size=3>(2,I1,</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>{ compare values for divergence }</P></FONT></FONT><FONT size=3><P>C1:=V1&gt;V3 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> V2&lt;V4 ;</P><P>C1 </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>(C1,-1)=0 </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>AND</FONT></FONT><FONT size=3> RSIval &gt; </FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Ref</FONT></FONT><FONT size=3>(RSIval,-1)</P><DIV></DIV></FONT></DIV><span style="font-size:10px"><br /><br />Edited by maximo - 13&nbsp;Apr&nbsp;2011 at 1:17am</span>]]>
   </description>
   <pubDate>Wed, 13 Apr 2011 01:15:01 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2707#2707</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Thanks Maximo, I tried to define...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2701#2701</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=133" rel="nofollow">Andrzej</a><br /><strong>Subject:</strong> 696<br /><strong>Posted:</strong> 10&nbsp;Apr&nbsp;2011 at 2:46pm<br /><br />Thanks Maximo, I tried to define and create variable latest peak as follows:<DIV><P><FONT color=#000000><FONT size=1>ispeak1:=ValueWhen(1,(z&gt;hist(z,1) and z&gt;future(z,1)),z);</FONT></P><DIV></FONT><FONT color=#008000><FONT color=#000000 size=1>ispeak1:=prev(1,z&gt;hist(z,1) and z&gt;future(z,1));</FONT></FONT></DIV><DIV><DIV><FONT color=#008000><FONT color=#000000 size=1>Do you know why formula is still not working ?</FONT></FONT></DIV><DIV><FONT size=1>Variable ispeak1 is still not created when I use code to show it:</FONT></DIV></DIV><DIV><FONT color=#008000><FONT color=#008000><P><FONT size=1>{Columns}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </FONT></FONT></FONT><FONT size=1><FONT color=#800080><FONT color=#800080>&#091;name</FONT></FONT>="IPeak1"<FONT color=#800080><FONT color=#800080>;</FONT></FONT> <FONT color=#800080><FONT color=#800080>dp</FONT></FONT>="3"<FONT color=#800080><FONT color=#800080>&#093;</FONT></FONT> ispeak1;</FONT></P></DIV><DIV><FONT color=#008000><FONT color=#000000 size=1>thanks</FONT></FONT></DIV><DIV><FONT size=1><FONT color=#008000><FONT color=#000000>&nbsp;</DIV></FONT></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Sun, 10 Apr 2011 14:46:51 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2701#2701</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Yes previous() or prev() function...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2700#2700</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> 696<br /><strong>Posted:</strong> 07&nbsp;Apr&nbsp;2011 at 2:30am<br /><br />Yes previous() or prev() function is a bit tricky and needs experimentation to understand its operation. <DIV>&nbsp;</DIV><DIV>Previous&nbsp;&nbsp;same as prev(1,1)&nbsp; {&nbsp;most recent value, ie peak }</DIV><DIV>&nbsp;</DIV><DIV>prev(1,2) { second most recent value, peak before most recent}</DIV><DIV>prev(1,3) { third&nbsp;most recent value, peak before that.. etc. }</DIV><DIV>&nbsp;</DIV><DIV>The use of ValueWhen()&nbsp; eg. variable:=ValueWhen(1,test condition,save this variable if condition was true);</DIV><DIV>Just saves a value when a condition is true, so it can be used to save peak values as they occur too.</DIV><DIV>&nbsp;</DIV><DIV>It seems to me both functions are the same except Prev doesn't need any condition to save any previous values.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><span style="font-size:10px"><br /><br />Edited by maximo - 07&nbsp;Apr&nbsp;2011 at 2:38am</span>]]>
   </description>
   <pubDate>Thu, 07 Apr 2011 02:30:53 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2700#2700</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Thank you maximo for the quick...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2699#2699</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=133" rel="nofollow">Andrzej</a><br /><strong>Subject:</strong> 696<br /><strong>Posted:</strong> 06&nbsp;Apr&nbsp;2011 at 10:01pm<br /><br /><P>Thank you maximo for the quick advice.</P><P>I replaced hist() with previous() but still can not get variable&nbsp;ispeak1 to be calculated.</P><DIV>Do I need to replace future () as well ?</DIV><DIV>I would try to use valuewhen () but not sure what parameters I need to enter .</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 06 Apr 2011 22:01:55 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2699#2699</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Hi Andrzej  hist() can&amp;#039;t...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2696#2696</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> 696<br /><strong>Posted:</strong> 04&nbsp;Apr&nbsp;2011 at 4:55pm<br /><br />Hi Andrzej<DIV>&nbsp;</DIV><DIV>hist() can't be used to look at previous peaks, the Previous() function must be use or ValueWhen().</DIV><DIV>&nbsp;</DIV><DIV>hist() is looking back only the previous bar and not the previous peak is why it's not working.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Mon, 04 Apr 2011 16:55:53 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2696#2696</guid>
  </item> 
  <item>
   <title>Zig Zag indicator : Can anyone please help with comparing...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2695#2695</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=133" rel="nofollow">Andrzej</a><br /><strong>Subject:</strong> 696<br /><strong>Posted:</strong> 01&nbsp;Apr&nbsp;2011 at 6:38pm<br /><br /><FONT size=2>Can anyone please help with comparing the last two peaks using zigzag function.</FONT><DIV><FONT size=3></FONT>&nbsp;</DIV><DIV><FONT size=3>size:= 4;z:=</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>zigzag</FONT></FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3><FONT color=#0000c0 size=3>Close</FONT></FONT><FONT size=3>,size,%);</DIV></FONT><DIV><FONT size=2>I am defining the last peak as:</FONT></DIV><DIV><FONT size=2>ispeak1:=z&gt;<FONT color=#0000c0><FONT color=#0000c0>hist</FONT></FONT>(z,1) <FONT color=#0000c0><FONT color=#0000c0>and</FONT></FONT> z&gt;<FONT color=#0000c0><FONT color=#0000c0>future</FONT></FONT>(z,1);</FONT></DIV><DIV><FONT size=2>Ispeak2:=z&gt;<FONT color=#0000c0><FONT color=#0000c0>hist</FONT></FONT>(z,2) <FONT color=#0000c0><FONT color=#0000c0>and</FONT></FONT> z&gt;<FONT color=#0000c0><FONT color=#0000c0>future</FONT></FONT>(z,2);</FONT></DIV><DIV><FONT size=3>Then I want to compare ispeak1 against ispeak2.</FONT></DIV><DIV><FONT color=#008000 size=3><FONT color=#008000 size=3><P>filter := ispeak1 &gt;ispeak2</P><DIV></FONT></FONT><FONT size=3>However, it seems that values of variables ispeak1 and ispeak 2 are not defined, not present?. How can I get these variables to compare them , the same as variable&nbsp;z .</FONT></DIV><DIV><FONT size=3>Thank you</FONT></DIV></DIV>]]>
   </description>
   <pubDate>Fri, 01 Apr 2011 18:38:53 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=696&amp;PID=2695#2695</guid>
  </item> 
 </channel>
</rss>