﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RightEdge Forums / General / General Discussion  / spread trading / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>RightEdge Forums</description><link>http://www.rightedgesystems.com/forums/</link><webMaster>rightedge@yyesoftware.com</webMaster><lastBuildDate>Wed, 08 Feb 2012 15:48:43 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>You might consider making your ratio an ISeries.  Here is a sample class that implements an ISeries.  You could add your ratio values to this class and then pass this into the BB.&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;class&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; MyRatioValues : ISeries&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;List&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;double&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&amp;gt; myRatioValues = &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;new&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; List&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;double&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&amp;gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; SeriesChartSettings ChartSettings { &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;get&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;set&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;double&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; LookBack(&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;int&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; nBars)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;            &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; myRatioValues[myRatioValues.Count - nBars];&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;double&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; Current&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;            &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;get&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; { &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; myRatioValues[myRatioValues.Count - &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: purple; FONT-SIZE: 10pt"&gt;1&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;]; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;int&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; Count&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;            &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;get&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; { &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; myRatioValues.Count; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; OldValuesChange&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;            &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;get&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; { &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;false&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;int&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; OldestValueChanged&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 2"&gt;            &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;get&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; { &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 10pt"&gt;return&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: purple; FONT-SIZE: 10pt"&gt;0&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;SPAN style="mso-tab-count: 1"&gt;      &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: black; FONT-SIZE: 10pt"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;P&gt;[quote][b]vitor dantas (7/5/2010)[/b][hr]Ok, i see . . .    really the new way is easier !!! But when i tried to create an bollinger band over the user serie, it returned an error message "Input 0 to indicator bb2 was a user series.  User series cannot be used as inputs to indicators.".&lt;/P&gt;&lt;P&gt;So if i create a ratio between two asset´s and need a indicator over that ratio, how should i proceed ??  Any idea ???&lt;/P&gt;&lt;P&gt;                                          and Again thank´s for the best support !!!&lt;/P&gt;&lt;P&gt;                                                                Vitor[/quote]</description><pubDate>Tue, 06 Jul 2010 08:04:30 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Ok, i see . . .    really the new way is easier !!! But when i tried to create an bollinger band over the user serie, it returned an error message "Input 0 to indicator bb2 was a user series.  User series cannot be used as inputs to indicators.".&lt;/P&gt;&lt;P&gt;So if i create a ratio between two asset´s and need a indicator over that ratio, how should i proceed ??  Any idea ???&lt;/P&gt;&lt;P&gt;                                          and Again thank´s for the best support !!!&lt;/P&gt;&lt;P&gt;                                                                Vitor</description><pubDate>Mon, 05 Jul 2010 20:55:15 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>I'm not sure what's going on, but it still looks like you're basing this on old code.  Have a look at the UserSeries sample that ships with RightEdge.  It is much cleaner and easier to understand.  Plus it works.</description><pubDate>Fri, 02 Jul 2010 11:09:43 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>The system himself creates a dictionary&amp;lt;symbol, MACD&amp;gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000 size=2 face="Courier New"&gt; Dictionary&amp;lt;Symbol, MACD&amp;gt; RatioMACD = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; Dictionary&amp;lt;Symbol, MACD&amp;gt;();&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000 size=2 face="Courier New"&gt; (Symbol symbol &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; SystemData.Symbols)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;    Ratios[symbol] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; DataSeries();&lt;/P&gt;&lt;P&gt;    RatioMACD[symbol] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; MACD(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;12&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;26&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,Ratios[symbol]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;i already checked the Ratios[symbol] is fine !!!&lt;/P&gt;&lt;P&gt;But the RatioMACD[symbol].Current for instance only returns double.NAN...&lt;/P&gt;&lt;P&gt;I´ll post all code down if you can see any problem..&lt;/P&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; System;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; System.Drawing;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; System.Collections.Generic;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; System.Collections.ObjectModel;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; RightEdge.Common;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; RightEdge.Indicators;&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000 size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; SystemMain : SystemBase&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// This is the symbol you want to compare other symbols against&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Symbol BaseSymbol;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// = new Symbol("ACG");&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Dictionary&amp;lt;Symbol, MACD&amp;gt; RatioMACD = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Dictionary&amp;lt;Symbol, MACD&amp;gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Dictionary&amp;lt;Symbol, DataSeries&amp;gt; Ratios = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Dictionary&amp;lt;Symbol, DataSeries&amp;gt;();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; proportion = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;10&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;override&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Startup()&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;BaseSymbol = SystemData.Symbols[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;0&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;];&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (SystemData.Symbols.Count &amp;lt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;2&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;throw&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; RightEdgeError(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Must select at least two symbols (including "&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; +&lt;/P&gt;&lt;P&gt;BaseSymbol + &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;" to run the system against."&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// We will use this to plot the close values of our base series along&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// with each symbol&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[BaseSymbol.ToString()].CreateSeries();&lt;/P&gt;&lt;P&gt;Series[BaseSymbol.ToString()].SeriesColor = Color.Blue;&lt;/P&gt;&lt;P&gt;Series[BaseSymbol.ToString()].AddToCharts();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// The ratio&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIO"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].CreateSeries();&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIO"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].ChartPaneName = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Ratio"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;;&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIO"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].SeriesColor = Color.Red;&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIO"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// The MACD of the ratio&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].CreateSeries();&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].ChartPaneName = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RatioMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;;&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].SeriesColor = Color.Orange;&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;].AddToCharts();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// For each symbol, create a DataSeries which will be used to store&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// the ratio values, and a MACD of that ratio.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;foreach&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (Symbol symbol &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;in&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; SystemData.Symbols)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;Ratios[symbol] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; DataSeries();&lt;/P&gt;&lt;P&gt;RatioMACD[symbol] = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; MACD(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;12&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;26&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,Ratios[symbol]);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;override&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; NewSymbolBar(Symbol symbol, BarData bar)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//if (symbol == BaseSymbol)&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//{&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Do nothing&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// return;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//}&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;BarData baseBar = BarUtils.LastValidBar(Bars[BaseSymbol]);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; baseValue;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; ratio;&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (baseBar == &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;null&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// No valid bars for the base symbol yet&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;baseValue = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.NaN;&lt;/P&gt;&lt;P&gt;ratio = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.NaN;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;else&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2 face="Courier New"&gt;&lt;FONT color=#808080 size=2 face="Courier New"&gt;&lt;FONT color=#808080 size=2 face="Courier New"&gt;///&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;baseValue = baseBar.Close * proportion;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;(proportion == &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;10&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;proportion = bar.Close / baseBar.Close;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Calculate ratio&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;baseValue = baseBar.Close * proportion;&lt;/P&gt;&lt;P&gt;ratio = bar.Close / baseBar.Close / proportion;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Add base value and ratio to the corresponding series on the charts&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[BaseSymbol.ToString()][symbol].SetCurrentValue(baseValue);&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//serie do primeiro do par&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIO"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;][symbol].SetCurrentValue(ratio);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Add the ratio to the DataSeries which the MACD uses as its input&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Ratios[symbol].Add(ratio);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//Console.WriteLine(Ratios[symbol].Current);&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;RatioMACD[symbol].NewBar();&lt;/P&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;][symbol].SetCurrentValue(RatioMACD[symbol].Current);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Tell MACD to calculate its new value&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//foreach(Symbol kvp in RatioMACD.Keys)&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//{&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Console.WriteLine(RatioMACD[symbol].Current);&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;//}&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;P&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000 size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt; DataSeries : ISeries&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; List&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&amp;gt; Values = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; List&amp;lt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&amp;gt;();&lt;/P&gt;&lt;P&gt;SeriesChartSettings st = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; SeriesChartSettings();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;this&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; index]{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Values[index];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Add(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Value){&lt;/P&gt;&lt;P&gt;Values.Add(Value);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; SeriesChartSettings ChartSettings{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; st;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;set&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; LookBack(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; periodos){&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Double.NaN;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Current&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Values[Values.Count-&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; OldestValueChanged&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Count&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Values.Count;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;double&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Value(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; per)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Values[per];&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;bool&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; OldValuesChange {&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;get&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;return&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Wed, 30 Jun 2010 16:49:21 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Where are you getting the indicator values from?  What values are you feeding to the user series?&lt;br&gt;&lt;br&gt;[quote][b]vitor dantas (6/29/2010)[/b][hr]Resuming the creation of the userSerie is working fine, but when i create an indicator over this userSerie - only returns double.NAN . . . It doesn´t give me any value !!!&lt;br&gt;&lt;br&gt;That´s why i´m thinking that i´m mot feeding the indicator properly ...[/quote]</description><pubDate>Wed, 30 Jun 2010 16:10:23 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Resuming the creation of the userSerie is working fine, but when i create an indicator over this userSerie - only returns double.NAN . . . It doesn´t give me any value !!!&lt;/P&gt;&lt;P&gt;That´s why i´m thinking that i´m mot feeding the indicator properly ...</description><pubDate>Tue, 29 Jun 2010 11:19:17 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>I'm afraid I don't understand.  Can you ask the question a different way?&lt;br&gt;&lt;br&gt;[quote][b]vitor dantas (6/22/2010)[/b][hr]Ok , i sow, what i want to do is create a userSeries and create an indicator over the user Serie ! When i do that on that system it returns an empty Indicator of the (userSerie).&lt;br&gt;&lt;br&gt;I think some Attach command is missing something that feed the indicator with the user serie,[/quote]</description><pubDate>Thu, 24 Jun 2010 08:55:31 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Ok , i sow, what i want to do is create a userSeries and create an indicator over the user Serie ! When i do that on that system it returns an empty Indicator of the (userSerie).&lt;/P&gt;&lt;P&gt;I think some Attach command is missing something that feed the indicator with the user serie,</description><pubDate>Tue, 22 Jun 2010 16:41:07 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>You're basing this off of old code.  I would recommend visiting the section [url=http://www.rightedgesystems.com/Documentation/UserGuide/index.html?developing_trading_systems_in_.htm]Developing Trading Systems in RightEdge[/url].  And scroll down to the section titled User Series.   You really want to do something like this:&lt;br&gt;&lt;br&gt;	UserSeries mySeries;&lt;br&gt;	&lt;br&gt;	public override void Startup()&lt;br&gt;	{&lt;br&gt; 		mySeries = new UserSeries();&lt;br&gt;        mySeries.ChartSettings.ChartPaneName = "MySeriesPane";&lt;br&gt;        mySeries.ChartSettings.Color = Color.Red;&lt;br&gt;        mySeries.ChartSettings.DisplayName = "My Ratio";&lt;br&gt;	}&lt;br&gt;&lt;br&gt;	public override void NewBar()&lt;br&gt;	{&lt;br&gt;		mySeries.Current = calculate your value here.&lt;br&gt;	}&lt;br&gt;&lt;br&gt;&lt;br&gt;[quote][b]vitor dantas (6/21/2010)[/b][hr]The system createa serie that is the ratio from the two securities after this we create a macd over the ratio(MacdSerie). But it returns a macdSerie empty. It´s seems that somewere is missing a command to attach the dataserie to the indicator&lt;br&gt;&lt;br&gt;[/quote]</description><pubDate>Tue, 22 Jun 2010 08:37:19 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>The system create a serie that is the ratio from the two securities after this we create a macd over the ratio(MacdSerie). But it returns a macdSerie empty. It´s seems that somewere is missing a command to attach the dataserie to the indicator&lt;/P&gt;&lt;P&gt;                           </description><pubDate>Mon, 21 Jun 2010 09:56:24 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>First, you'll want to use the .Current property instead.  Second, what is the value of RatioMACD[symbol] when you add it to the UserSeries?&lt;br&gt;&lt;br&gt;[quote][b]vitor dantas (6/18/2010)[/b][hr]Hi i downloaded this system is working fine, except for the macdRatio witch remais empty. Any idea ??? Itried&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;br&gt;&lt;br&gt;RatioMACD[symbol].SetInputs(Ratios[symbol]);&lt;br&gt;&lt;br&gt;RatioMACD[symbol].NewBar();&lt;br&gt;&lt;br&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Add MACD value to the chart series&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;br&gt;&lt;br&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;][symbol].SetCurrentValue(BarUtils.LastValueOf(RatioMACD[symbol]));&lt;/FONT&gt;&lt;/FONT&gt;&lt;br&gt;&lt;br&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;but none seems to work. Any idea ??&lt;/FONT&gt;&lt;/FONT&gt;&lt;br&gt;&lt;br&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Thank´s Vitor Dantas&lt;/FONT&gt;&lt;/FONT&gt;[/quote]</description><pubDate>Mon, 21 Jun 2010 07:36:04 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Hi i downloaded this system is working fine, except for the macdRatio witch remais empty. Any idea ??? Itried &lt;/P&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;RatioMACD[symbol].SetInputs(Ratios[symbol]);&lt;/P&gt;&lt;P&gt;RatioMACD[symbol].NewBar();&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;// Add MACD value to the chart series&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;P&gt;Series[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"RATIOMACD"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;][symbol].SetCurrentValue(BarUtils.LastValueOf(RatioMACD[symbol]));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;but none seems to work. Any idea ??&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;                                     Thank´s Vitor Dantas&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><pubDate>Fri, 18 Jun 2010 13:47:13 GMT</pubDate><dc:creator>vitor dantas</dc:creator></item><item><title>RE: spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Yes, you'd have to create a UserSeries that merges the data in code.  Have a look at the [url=http://www.rightedgesystems.com/TradingSystemsDetails.aspx?id=b75511f7-b906-4ee4-a75b-a155a0f3e26c]Ratio trading system[/url].  This is a user submitted system that hasn't been converted to the latest version of RightEdge, but the concepts remain the same.&lt;br&gt;&lt;br&gt;[quote][b]fdanil (3/11/2010)[/b][hr]Hi.  Is it possible in RightEdge to define spreads (for inst. +NATGAS-CRUDE OIL) and chart  them (the spread, not the single legs)?[/quote]</description><pubDate>Fri, 12 Mar 2010 09:03:56 GMT</pubDate><dc:creator>billb</dc:creator></item><item><title>spread trading</title><link>http://www.rightedgesystems.com/forums/Topic11141-7-1.aspx</link><description>Hi.  Is it possible in RightEdge to define spreads (for inst. +NATGAS-CRUDE OIL) and chart  them (the spread, not the single legs)?</description><pubDate>Thu, 11 Mar 2010 11:32:09 GMT</pubDate><dc:creator>fdanil</dc:creator></item></channel></rss>
