<?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 : Trend Line Indicator Coding</title>
  <link>http://www.bullcharts.com.au/forum/</link>
  <description>This is an XML content feed of; BullCharts : BullScript : Trend Line Indicator Coding</description>
  <copyright>Copyright (c) 2006-2009 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 11:58:47 +0000</pubDate>
  <lastBuildDate>Thu, 03 Apr 2008 14:56:45 +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=464</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>Trend Line Indicator Coding : Maximo,  You are out doing yourself,...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1754#1754</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=206" rel="nofollow">blackdog</a><br /><strong>Subject:</strong> 464<br /><strong>Posted:</strong> 03&nbsp;Apr&nbsp;2008 at 2:56pm<br /><br /><DIV>Maximo,</DIV><DIV>&nbsp;</DIV><DIV>You are out doing yourself, given the limitations in BS, this is brilliant coding for a trend line. Results are a bit variable but better than anything else for auto trend lines in BC.</DIV><DIV>&nbsp;</DIV><DIV>BD</DIV>]]>
   </description>
   <pubDate>Thu, 03 Apr 2008 14:56:45 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1754#1754</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding :  </title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1745#1745</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> 464<br /><strong>Posted:</strong> 30&nbsp;Mar&nbsp;2008 at 9:55pm<br /><br /><P><IMG src="uploads/maximo/2008-03-30_215532_TrendLines-WOW.png" border="0"></P>]]>
   </description>
   <pubDate>Sun, 30 Mar 2008 21:55:38 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1745#1745</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : Okay another indicator finished....</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1744#1744</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> 464<br /><strong>Posted:</strong> 30&nbsp;Mar&nbsp;2008 at 9:46pm<br /><br /><P>Okay another indicator finished.&nbsp; Does trendlines now, above and below, support or resistance, depending on the trend.&nbsp;Have fun!</P><FONT color=#008000 size=3><P>{ TrendLines }</P></FONT><FONT color=#800080 size=3><P>&#091;target</FONT><FONT size=3>=Price</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>lineStyle</FONT><FONT size=3>=Solid</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>color</FONT><FONT size=3>=orange</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>tp:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Length"</FONT><FONT size=3>,100,2);</P><P>os:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Offset"</FONT><FONT size=3>,0,0);</P><P>n := </FONT><FONT color=#0000c0 size=3>input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Width:5=Tight 10=Medium 20=Loose"</FONT><FONT size=3>,10,0);</P><P>Select:=</FONT><FONT color=#0000c0 size=3>input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Channel=0 Trendline=1"</FONT><FONT size=3>,0,0,1);</P><P>Regline:=</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinearReg</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))-</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinRegSlope</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))*</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))))+</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os)))-</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os))),os);</P><P>Width:=</FONT><FONT color=#0000c0 size=3>HHV</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>H</FONT><FONT size=3>,n)-</FONT><FONT color=#0000c0 size=3>LLV</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>L</FONT><FONT size=3>,n);</P><P>lastpoint:=</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(Regline,-os));</P><P>startpoint:=</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(Regline,-(tp-1)-os));</P><P>CW:=</FONT><FONT color=#0000c0 size=3>valuewhen</FONT><FONT size=3>(1,Regline,</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>HHV</FONT><FONT size=3>(Width*0.5,tp),-os)));</P><P>UP:=</FONT><FONT color=#0000c0 size=3>if</FONT><FONT size=3>(lastpoint &gt; startpoint,1,0);</P></FONT><FONT color=#0000c0 size=3><P>if</FONT><FONT size=3>(select=0,Regline-CW,</FONT><FONT color=#0000c0 size=3>if</FONT><FONT size=3>(UP=1,Regline-CW,</FONT><FONT color=#0000c0 size=3>undefined</FONT><FONT size=3>));</P></FONT><FONT color=#0000c0 size=3><P>if</FONT><FONT size=3>(select=0,Regline+CW,</FONT><FONT color=#0000c0 size=3>if</FONT><FONT size=3>(UP=0,Regline+CW,</FONT><FONT color=#0000c0 size=3>undefined</FONT><FONT size=3>));</P><P></FONT>&nbsp;</P>]]>
   </description>
   <pubDate>Sun, 30 Mar 2008 21:46:57 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1744#1744</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : I had a look at that, it&amp;#039;s...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1742#1742</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> 464<br /><strong>Posted:</strong> 30&nbsp;Mar&nbsp;2008 at 3:05am<br /><br /><P>I had a look at that, it's probably meant to a draw linear regression channel&nbsp;with its width based on either Standard Deviation or Standard Error&nbsp;(STE=StEyx in BS), however couldnt get it to work even after adding those&nbsp;other variables.</P><P>Afterwards&nbsp;I decided&nbsp;to finish the&nbsp;Linear Regression Channel indicator.&nbsp; Because the channel width in it was just a makeshift one, works okay but not very accurate when using an offset value.&nbsp; StdDev and StdErr require too much fidling going from chart to chart so i devised a width system based on Highest High - Lowest Low values.&nbsp; Have a play with it, values 5,10,20 for the width seem to work best.&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </P><FONT color=#008000 size=3><P>{ Linear Regression Channel }</P></FONT><FONT color=#800080 size=3><P>&#091;target</FONT><FONT size=3>=Price</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>lineStyle</FONT><FONT size=3>=Solid</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>color</FONT><FONT size=3>=orange</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>tp:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Length"</FONT><FONT size=3>,100,2);</P><P>os:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Offset"</FONT><FONT size=3>,0,0);</P><P>n := </FONT><FONT color=#0000c0 size=3>input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Width"</FONT><FONT size=3>,10,0);</P><P>Regline:=</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinearReg</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))-</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinRegSlope</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))*</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))))+</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os)))-</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os))),os);</P><P>Width:=</FONT><FONT color=#0000c0 size=3>Abs</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>,n)-</FONT><FONT color=#0000c0 size=3>LLV</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>L</FONT><FONT size=3>,n));</P><P>CW:=</FONT><FONT color=#0000c0 size=3>valuewhen</FONT><FONT size=3>(1,Regline,</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>HHV</FONT><FONT size=3>(Width*0.5,tp),-os)));</P><P>Regline-CW; </FONT><FONT color=#008000 size=3>{upper channel line}</P></FONT><FONT size=3><P>Regline+CW; </FONT><FONT color=#008000 size=3>{lower channel line}</FONT></P><P><FONT color=#008000 size=3>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Sun, 30 Mar 2008 03:05:41 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1742#1742</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : I was speaking to a reliable source...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1739#1739</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=413" rel="nofollow">RODCAM</a><br /><strong>Subject:</strong> 464<br /><strong>Posted:</strong> 28&nbsp;Mar&nbsp;2008 at 6:25pm<br /><br /><P>I was speaking to a reliable source (who helped me with the step indicator coding to which you also responded&nbsp;) today&nbsp;who confirmed as much. I was thinking of trying Amibroker but the coding frightened me given BS is relatively simple. Not sure if you have seen the metastocktools.com site which has some excellent coding examples for MS which may be able to be converted to BS (given the coding similarities), but on the surface they are beyond my current capability. This is an example using linear regression channel:</P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ End date point }<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">end:=Year()&gt;EnYear<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>OR (Year()=EnYear AND (Month()&gt;EnMnth<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>OR Month()=EnMnth AND DayOfMonth()&gt;=EnDay));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">end:=end AND Alert(end=0,2);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">end:=If(LastValue(Cum(Ref(end,pds)))=0,<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>LastValue(Cum(1))=Cum(1),end);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ Linear Regression Trend/Slope end-points }<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">lastValLRI:=LastValue(Highest(<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>If(end,LinearReg(x,pds),0)));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">lastValLRS:=LastValue(Highest(<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>If(end,LinRegSlope(x,pds),-10000)));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">adjust:=LastValue(LastValue(Cum(1))<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>-Highest(If(end,Cum(1),0)));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">countback:=LastValue(Cum(1))-Cum(1)-adjust;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ Rem next line to extend plot to end of chart }<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">countback:=Ref(Ref(countback,-adjust),adjust);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ Lin Reg Trendline }<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">LR:=lastValLRI-lastValLRS*countback;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">restrict:=adjust-(LastValue(Cum(1))-pds);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">LRT:=Ref(Ref(LR,-restrict),restrict);<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ Lin Reg StdDev/StdError channels }<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">bandType:=If(multi&gt;=0,Stdev(x,pds),STE(x,pds));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">diff:=ValueWhen(1,Cum(IsDefined(LRT))=1,<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><SPAN style="mso-spacerun: yes">&nbsp;</SPAN>bandType*Abs(multi));<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">upLR:=LRT+diff;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">lwLR:=LRT-diff;<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU"><o:p>&nbsp;</o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">{ Plot on price chart }<o:p></o:p></SPAN></P><P =Ms&#111;normal style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; tab-stops: 45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-fareast-: EN-AU">upLR;lwLR;LRT<o:p></o:p></SPAN></P><P>Cheers Rod</P>]]>
   </description>
   <pubDate>Fri, 28 Mar 2008 18:25:49 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1739#1739</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : Rodcam,  So far I have beenunsuccessful...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1737#1737</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=206" rel="nofollow">blackdog</a><br /><strong>Subject:</strong> 464<br /><strong>Posted:</strong> 28&nbsp;Mar&nbsp;2008 at 12:41pm<br /><br /><DIV>Rodcam,</DIV><DIV>&nbsp;</DIV><DIV>So far I have been&nbsp;unsuccessful in using BS&nbsp;to draw automatic trendlines. Amibroker is the only software I know of that can include trendlines in its coding, but you still have to draw them manually first. (Amibroker has a far more powerful scripting lanuage than BS, so maybe just too hard to automate.)</DIV><DIV>&nbsp;</DIV><DIV>I like Maximos solution using linear regression, it &nbsp;is pretty good approximation for an automatically generated trendline.</DIV><DIV>&nbsp;</DIV><DIV>BD</DIV>]]>
   </description>
   <pubDate>Fri, 28 Mar 2008 12:41:21 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1737#1737</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : maximo, thanks that is getting...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1724#1724</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=413" rel="nofollow">RODCAM</a><br /><strong>Subject:</strong> 464<br /><strong>Posted:</strong> 08&nbsp;Mar&nbsp;2008 at 2:43pm<br /><br /><P>maximo, thanks that is getting pretty close to the mark on what I wanted and also gives me some 'ideas' on how to approach the other coding exercise. If/when I sort out the other coding approach I'll post the results. Cheers RODCAM</P>]]>
   </description>
   <pubDate>Sat, 08 Mar 2008 14:43:16 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1724#1724</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : RODCAM i know what you mean.....</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1721#1721</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> 464<br /><strong>Posted:</strong> 05&nbsp;Mar&nbsp;2008 at 11:13pm<br /><br /><P>RODCAM i know what you mean..&nbsp; I did try the trendline business but i think it's probably easier to just input&nbsp;2 values&nbsp;(beginning and end barnumbers or peaks) and&nbsp;use PREV to draw a straight line between them.&nbsp; Though i got distracted and found some code for Linear Regression&nbsp;Lines for Metastock and used it.. saves time and i can just flick through the charts and see the trend/trendline or channel.</P><FONT color=#008000 size=3><P>{Linear Regression Lines}</P></FONT><FONT color=#800080 size=3><P>&#091;target</FONT><FONT size=3>=Price</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>Color</FONT><FONT size=3>=Orange</FONT><FONT color=#800080 size=3>;</FONT><FONT size=3> </FONT><FONT color=#800080 size=3>Width</FONT><FONT size=3>=2</FONT><FONT color=#800080 size=3>&#093;</P></FONT><FONT size=3><P>tp:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Periods"</FONT><FONT size=3>,80,2);</P><P>os:=</FONT><FONT color=#0000c0 size=3>Input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Offset"</FONT><FONT size=3>,0,0);</P><P>F:=</FONT><FONT color=#0000c0 size=3>input</FONT><FONT size=3>(</FONT><FONT color=#008b8b size=3>"Channel (1=On, 0=Off)"</FONT><FONT size=3>,1,0);</P><P>Regline:=</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>((</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinearReg</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))-</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>LinRegSlope</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,tp),-os))*</P><P>(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))))+</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os)))-</P></FONT><FONT color=#0000c0 size=3><P>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>C</FONT><FONT size=3>,(0-(</FONT><FONT color=#0000c0 size=3>LastValue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>Ref</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>sum</FONT><FONT size=3>(1),-os))-tp+os))),os);</P></FONT><FONT color=#0000c0 size=3><P>if</FONT><FONT size=3>(F=0,Regline,</FONT><FONT color=#0000c0 size=3>undefined</FONT><FONT size=3>);</P><P>w1:=</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hist</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>,5),2))-</FONT><FONT color=#0000c0 size=3>lastvalue</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>,5));</P><P>w2:=</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hist</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>,5),15))-</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hist</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>,5),15));</P><P>w3:=</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hist</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>,5),20))-</FONT><FONT color=#0000c0 size=3>lastvalue</FONT><FONT size=3>(</FONT><FONT color=#0000c0 size=3>hist</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>,5),20));</P><P>w4:=(w1+w2+w3)*.25;</P></FONT><FONT color=#0000c0 size=3><P>if</FONT><FONT size=3>(F&gt;0,Regline-w4,</FONT><FONT color=#0000c0 size=3>undefined</FONT><FONT size=3>); </FONT><FONT color=#008000 size=3>{upper channel}</P></FONT><FONT color=#0000c0 size=3><P>if</FONT><FONT size=3>(F&gt;0,Regline+w4,</FONT><FONT color=#0000c0 size=3>undefined</FONT><FONT size=3>); </FONT><FONT color=#008000 size=3>{lower channel}</FONT></P><P><FONT color=#008000 size=3>&nbsp;</P></FONT>]]>
   </description>
   <pubDate>Wed, 05 Mar 2008 23:13:09 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1721#1721</guid>
  </item> 
  <item>
   <title>Trend Line Indicator Coding : I am trying to build a trendline...</title>
   <link>http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1720#1720</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.bullcharts.com.au/forum/member_profile.asp?PF=413" rel="nofollow">RODCAM</a><br /><strong>Subject:</strong> 464<br /><strong>Posted:</strong> 04&nbsp;Mar&nbsp;2008 at 7:58pm<br /><br /><P>I am trying to build a trendline indicator rather than use the drawing tool but find the example in the manual difficult to understand. It should be relatively simple to input two dates and draw a trendline between the two dates but I can't seem to get my mind around the logic shown in the help manual. Anyone able to give me some guidance? </P><P>The following is my code:</P><P>&#091;author=RODCAM; target=price&#093;</P><P>sdate:= InputDate("Start Date", date(2007,6,30);</P><P>cdate:= sdate;</P><P>edate:= InputDate("End Date", date(2008,1,30);</P><P>xdate:= edate;</P><P>expr:= expression("Expression",C);</P><P>period:= sdate=cdate and edate=xdate;</P><P>&#091;name=Trend; color=blue; width=2&#093;</P><P>trendline(expr,period,1,0,0)</P><span style="font-size:10px"><br /><br />Edited by RODCAM</span>]]>
   </description>
   <pubDate>Tue, 04 Mar 2008 19:58:24 +0000</pubDate>
   <guid isPermaLink="true">http://www.bullcharts.com.au/forum/forum_posts.asp?TID=464&amp;PID=1720#1720</guid>
  </item> 
 </channel>
</rss>