<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--Web 2.0 Content Powered by MyST Blogsite® (http://blogsite.com)-->
<!--A service of MyST Technology Partners, Inc. (http://myst-technology.com)-->
<?xml-stylesheet href="http://forex.gftforex.com/public/styles/etc/object.xsl" type="text/xsl"?>

<?myst-baseUrl http://forex.gftforex.com/public/?>

<MySmartChannels Public="true" UserID="119227" dT="104" t0="1231457392268">
     <GetChannelItem_Result>
      <Item>
       <Resource>
        <ObjectID>194928</ObjectID>
        <ObjectClass>Resource</ObjectClass>
        <OwnerID ObjectClass="Domain" Title="[Weblog] Forex Technical Indicators">128472</OwnerID>
        <CreatedByID ObjectClass="User" Title="ICopsey">128654</CreatedByID>
        <ModifiedByID ObjectClass="User" Title="ICopsey">128654</ModifiedByID>
        <CreateTime Title="2008-01-17 01:27:16 EST">1200551236101</CreateTime>
        <ModifyTime Title="2008-01-17 01:27:16 EST">1200551236101</ModifyTime>
        <SecurityModel>Controlled</SecurityModel>
        <Name>Calculating where two moving averages will cross on the current bar…</Name>
        <Summary>Calculating the crossing point of two averages in Chart Studio</Summary>
        <Description>&lt;p&gt;&lt;font size="1"&gt;Many traders place importance on the crossing of two moving averages. Indeed, these are given the special names of:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Golden Cross &amp;ndash; when a shorter moving average crosses above a longer moving average&lt;br /&gt;Dead Cross &amp;ndash; when a shorter moving average crosses below a longer moving average&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Now wouldn&amp;rsquo;t be useful to be able to have an indicator which provides the price at which two averages will cross on the current bar?&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Well, here it is:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font size="1"&gt;First of all, let us go through how this is calculated. Let us take a 5 period and 10 period moving average. At the price at which two averages cross quite obviously they equal each other. We know at that point that:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Average(close,5) = Average(close,10)&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Breaking that down we know that an average is calculated by summing the past &amp;ldquo;x&amp;rdquo; closes and dividing by &amp;ldquo;x.&amp;rdquo; So for a 5 period average we take today&amp;rsquo;s close plus the past 4 and divide by 5. For a 10 period average we take today&amp;rsquo;s close plus the past 9 and divide by 10. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;In this case we will not use &amp;ldquo;today&amp;rsquo;s close&amp;rdquo; but today&amp;rsquo;s &amp;ldquo;crossing price.&amp;rdquo;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Also, to make the formula generic we&amp;rsquo;ll use P1 for the length of the short moving average and P2 for the long moving average. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;The common number to both is the crossing price. We know the rest. So we can rewrite the equation thus:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;(Sum(Close,P1-1)[1] + cross price ) / P1 = (Sum(Close,P2-1)[1]+ cross price ) / P2&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Where the suffix [1] represents the value of the prior bar&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;If we then bring this down we can derive:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font size="1"&gt;Cross Price&amp;nbsp; = (Sum(Close,P2-1)[1] * P1 - Sum(Close,P1-1)[1] * P2 ) / (P2 - P1) &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;font size="1"&gt;The moving average cross rate is very easy to input into Chart Studio. Open this feature and open a new technique. Cut and paste the following into the area that appears:&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;&lt;em&gt;indicator MvgAvgCrossRate2;&lt;br /&gt;input price = close, period1 = 5, Period2 = 20 ;&lt;br /&gt;draw &amp;nbsp;MACR(&amp;quot;MA Cross Rate&amp;quot;) ;&lt;br /&gt;vars &amp;nbsp;c(number),&amp;nbsp; Sum1(series), Sum2(series), CR(series), i(number), b(number), f(number);&lt;br /&gt;begin&lt;br /&gt;&amp;nbsp;f := front(price);&lt;br /&gt;&amp;nbsp;b := back(price);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum1 := Summation(price, period1 - 1) ;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sum2 := Summation(price, period2 - 1);&lt;br /&gt;&amp;nbsp; for i := f + 1 to b do begin&lt;br /&gt;&amp;nbsp; CR[i] :=&amp;nbsp; ( (Sum2[i-1] * Period1) - (Sum1[i-1]&amp;nbsp; * Period2) ) / (Period2 - Period1) ;&lt;br /&gt;&amp;nbsp; end;&lt;br /&gt;&amp;nbsp; MACR := CR ;&lt;br /&gt;&amp;nbsp;end.&lt;br /&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;Following this select &amp;ldquo;Build&amp;rdquo; and select &amp;ldquo;Verify Module&amp;rdquo; from the top menu bar&lt;br /&gt;You will be prompted to enter a name for this analysis technique. Write in &amp;ldquo;Mov Avg Cross Rate.&amp;rdquo;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;The Select &amp;ldquo;Build&amp;rdquo; again and this time you should see this succeed in the output window at the bottom of the studio. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;Then select &amp;ldquo;Build&amp;rdquo; again but this time choose &amp;ldquo;Install Module&amp;rdquo;&lt;br /&gt;The module will be installed into the User Modules.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;You will now be able to access Mov Avg Cross Rate in the charting application via the &amp;ldquo;set Up Indicators&amp;rdquo; icon at the top of the chart.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;The indicator may be plotted on top of the price chart or below in a sub chart. &lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;&lt;em&gt;&lt;img alt="Moving average cross rate on Dollar-Yen" hspace="0" src="http://i10.photobucket.com/albums/a111/ToshiYamada/Articles/MovingAverageCrossRate.gif" align="absMiddle" border="2" /&gt;&lt;/em&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;The image above has the MA Cross rate applied in both price chart and sub chart for comparison with the respective moving averages also plotted.&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="verdana,arial,helvetica,sans-serif" size="1"&gt;&lt;br /&gt;Ian Copsey&lt;br /&gt;&lt;/font&gt;&lt;/p&gt;</Description>
        <ResourceTypeID ObjectClass="ResourceType" Title="Item:Link">9</ResourceTypeID>
        <ContentType>application/xml</ContentType>
        <ContentDocument>
         <ItemProperties>
               <CommonProperties>
                <Hidden>false</Hidden>

                <Keywords>
                 <Keyword>cross</Keyword>

                 <Keyword>currencies</Keyword>

                 <Keyword>dead cross</Keyword>

                 <Keyword>Forex</Keyword>

                 <Keyword>FX</Keyword>

                 <Keyword>golden cross</Keyword>

                 <Keyword>indicator</Keyword>

                 <Keyword>moving average</Keyword>

       </Keywords>

                <Links>
                 <Link>
                  <Title>FX-Strategy Pro Commentary</Title>

                  <Synopsis>Powerful analysis for profitable trading</Synopsis>

                  <URL>http://www.gftforex.com/services/procommentary?aid=446</URL>

        </Link>

       </Links>

      </CommonProperties>

               <RemoteInfo>
                <UserAgent>Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; hc; .NET CLR 1.1.4322; .NET CLR 2.0.50727)</UserAgent>

                <RemoteHost>127.0.0.1</RemoteHost>

                <RemoteAddr>127.0.0.1</RemoteAddr>

                <RemoteUser>ICopsey</RemoteUser>

                <ForwardedFor>202.216.243.97</ForwardedFor>

      </RemoteInfo>

     </ItemProperties>
        </ContentDocument>
       </Resource>
       <Shares/>
       <Subjects/>
       <UserPermissions>
        <CanDelete>false</CanDelete>
        <CanDiscover>true</CanDiscover>
        <CanEdit>false</CanEdit>
        <CanEditPermissions>false</CanEditPermissions>
        <CanRead>true</CanRead>
       </UserPermissions>
       <CommentInfo>
        <CommentChannelRef>
         <ChannelID/>
        </CommentChannelRef>
        <Comments/>
       </CommentInfo>
       <Views>
        <SourceID ObjectClass="Channel" Title="[Weblog] Forex Technical Indicators">128472</SourceID>

               <View>
                <Name>blog</Name>

                <Model>blogsite/GFTForex/web</Model>

                <Style/>

                <Scheme/>

       </View>

      </Views>
        <Views>
         <SourceID ObjectClass="Channel" Shared="true" Title="[Public] Global Forex Trading Blog">119250</SourceID>

                <View>
                 <Name>blog</Name>

                 <Model>blogsite/GFTForex/whatsnew</Model>

                 <Style/>

                 <Scheme/>

       </View>

                <View>
                 <Name>edit-item</Name>

                 <Model>blogsite/GFTForex/web</Model>

                 <Style/>

                 <Scheme/>

       </View>

                <View>
                 <Name>left</Name>

                 <Model>blogsite/GFTForex/left-content</Model>

                 <Style/>

                 <Scheme/>

       </View>

                <View>
                 <Name>right</Name>

                 <Model>blogsite/GFTForex/right-content</Model>

                 <Style/>

                 <Scheme/>

       </View>

                <View>
                 <Name>wide</Name>

                 <Model>blogsite/GFTForex/wide-content</Model>

                 <Style/>

                 <Scheme/>

       </View>

      </Views>
        </Item>
       </GetChannelItem_Result>
      </MySmartChannels>
