<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:EnableOpenTypeKerning/>
<w:DontFlipMirrorIndents/>
<w:OverrideTableStyleHps/>
</w:Compatibility>
<m:mathPr>
<m:mathFont m:val="Cambria Math"/>
<m:brkBin m:val="before"/>
<m:brkBinSub m:val="--"/>
<m:smallFrac m:val="off"/>
<m:dispDef/>
<m:lMargin m:val="0"/>
<m:rMargin m:val="0"/>
<m:defJc m:val="centerGroup"/>
<m:wrapIndent m:val="1440"/>
<m:intLim m:val="subSup"/>
<m:naryLim m:val="undOvr"/>
</m:mathPr></w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="true"
DefSemiHidden="true" DefQFormat="false" DefPriority="99"
LatentStyleCount="267">
<w:LsdException Locked="false" Priority="0" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Normal"/>
<w:LsdException Locked="false" Priority="9" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="heading 1"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 2"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 3"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 4"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 5"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 6"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 7"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 8"/>
<w:LsdException Locked="false" Priority="9" QFormat="true" Name="heading 9"/>
<w:LsdException Locked="false" Priority="39" Name="toc 1"/>
<w:LsdException Locked="false" Priority="39" Name="toc 2"/>
<w:LsdException Locked="false" Priority="39" Name="toc 3"/>
<w:LsdException Locked="false" Priority="39" Name="toc 4"/>
<w:LsdException Locked="false" Priority="39" Name="toc 5"/>
<w:LsdException Locked="false" Priority="39" Name="toc 6"/>
<w:LsdException Locked="false" Priority="39" Name="toc 7"/>
<w:LsdException Locked="false" Priority="39" Name="toc 8"/>
<w:LsdException Locked="false" Priority="39" Name="toc 9"/>
<w:LsdException Locked="false" Priority="35" QFormat="true" Name="caption"/>
<w:LsdException Locked="false" Priority="10" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Title"/>
<w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/>
<w:LsdException Locked="false" Priority="11" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtitle"/>
<w:LsdException Locked="false" Priority="22" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Strong"/>
<w:LsdException Locked="false" Priority="20" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Emphasis"/>
<w:LsdException Locked="false" Priority="59" SemiHidden="false"
UnhideWhenUsed="false" Name="Table Grid"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Placeholder Text"/>
<w:LsdException Locked="false" Priority="1" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="No Spacing"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 1"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 1"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 1"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 1"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 1"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 1"/>
<w:LsdException Locked="false" UnhideWhenUsed="false" Name="Revision"/>
<w:LsdException Locked="false" Priority="34" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="List Paragraph"/>
<w:LsdException Locked="false" Priority="29" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Quote"/>
<w:LsdException Locked="false" Priority="30" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Quote"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 1"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 1"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 1"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 1"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 1"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 1"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 1"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 1"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 2"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 2"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 2"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 2"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 2"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 2"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 2"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 2"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 2"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 2"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 2"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 2"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 2"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 2"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 3"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 3"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 3"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 3"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 3"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 3"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 3"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 3"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 3"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 3"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 3"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 3"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 3"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 3"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 4"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 4"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 4"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 4"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 4"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 4"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 4"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 4"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 4"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 4"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 4"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 4"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 4"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 4"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 5"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 5"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 5"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 5"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 5"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 5"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 5"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 5"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 5"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 5"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 5"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 5"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 5"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 5"/>
<w:LsdException Locked="false" Priority="60" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Shading Accent 6"/>
<w:LsdException Locked="false" Priority="61" SemiHidden="false"
UnhideWhenUsed="false" Name="Light List Accent 6"/>
<w:LsdException Locked="false" Priority="62" SemiHidden="false"
UnhideWhenUsed="false" Name="Light Grid Accent 6"/>
<w:LsdException Locked="false" Priority="63" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 1 Accent 6"/>
<w:LsdException Locked="false" Priority="64" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Shading 2 Accent 6"/>
<w:LsdException Locked="false" Priority="65" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 1 Accent 6"/>
<w:LsdException Locked="false" Priority="66" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium List 2 Accent 6"/>
<w:LsdException Locked="false" Priority="67" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 1 Accent 6"/>
<w:LsdException Locked="false" Priority="68" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 2 Accent 6"/>
<w:LsdException Locked="false" Priority="69" SemiHidden="false"
UnhideWhenUsed="false" Name="Medium Grid 3 Accent 6"/>
<w:LsdException Locked="false" Priority="70" SemiHidden="false"
UnhideWhenUsed="false" Name="Dark List Accent 6"/>
<w:LsdException Locked="false" Priority="71" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Shading Accent 6"/>
<w:LsdException Locked="false" Priority="72" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful List Accent 6"/>
<w:LsdException Locked="false" Priority="73" SemiHidden="false"
UnhideWhenUsed="false" Name="Colorful Grid Accent 6"/>
<w:LsdException Locked="false" Priority="19" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Emphasis"/>
<w:LsdException Locked="false" Priority="21" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Emphasis"/>
<w:LsdException Locked="false" Priority="31" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Subtle Reference"/>
<w:LsdException Locked="false" Priority="32" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Intense Reference"/>
<w:LsdException Locked="false" Priority="33" SemiHidden="false"
UnhideWhenUsed="false" QFormat="true" Name="Book Title"/>
<w:LsdException Locked="false" Priority="37" Name="Bibliography"/>
<w:LsdException Locked="false" Priority="39" QFormat="true" Name="TOC Heading"/>
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tabela normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin-top:0cm;
mso-para-margin-right:0cm;
mso-para-margin-bottom:10.0pt;
mso-para-margin-left:0cm;
line-height:115%;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
</style>
<![endif]--><tt><span style="font-size: 10pt; line-height: 115%;">Colaboradores
do grupo, realizei um teste de financas em R, conhecido como
TICKTEST, porém meu código ficou muito lento. Talvez alguém
possa ajudar a torná-lo mais ágil. <br>
<br>
Grato,<br>
Luciano<br>
<br>
Resumidamente:<br>
1 - Prentende-se classificar mudanças de preço em uma ação.<br>
2 - O primeiro negócio do dia não é classificado. Os negócios
subsequentes em que haja estabilidade no preço tb não são
classificados.<br>
3 - Classifica-se as restantes conforme o movimento do preço. Se
sobe, UPTICK. Se desce, DOWNTICK. Se é estável e a última
variação foi positiva, ZERO.UPTICK. </span></tt><tt><span
style="font-size: 10pt; line-height: 115%;">Se é estável e a
última variação foi positiva, ZERO.DOWNTICK.</span></tt><br>
<tt><span style="font-size: 10pt; line-height: 115%;"><br>
Um exemplo dos dados:<br>
<br>
</span></tt>
<table width="357" border="0" cellpadding="0" cellspacing="0"
height="232">
<col style="width: 59pt;" width="78" span="2"> <col style="width:
57pt;" width="76"> <col style="width: 94pt;" width="125"> <tbody>
<tr style="height: 15pt;" height="20">
<td class="xl65" style="height: 15pt; width: 59pt;" width="78"
align="center" height="20">Data</td>
<td class="xl65" style="width: 59pt;" width="78"
align="center">Operação</td>
<td class="xl65" style="width: 57pt;" width="76"
align="center">Preço</td>
<td class="xl65" style="width: 94pt;" width="125"
align="center">Classificação</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/1/2011</td>
<td class="xl65" align="center">10</td>
<td class="xl67" align="center">$10.00</td>
<td class="xl65" align="center">NC</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/1/2011</td>
<td class="xl65" align="center">20</td>
<td class="xl67" align="center">$9.90</td>
<td class="xl65" align="center">DOWNTICK</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/1/2011</td>
<td class="xl65" align="center">30</td>
<td class="xl67" align="center">$9.90</td>
<td class="xl65" align="center">ZERO.DOWNTICK</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/1/2011</td>
<td class="xl65" align="center">40</td>
<td class="xl67" align="center">$10.10</td>
<td class="xl65" align="center">UPTICK</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/1/2011</td>
<td class="xl65" align="center">50</td>
<td class="xl67" align="center">$10.20</td>
<td class="xl65" align="center">UPTICK</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/2/2011</td>
<td class="xl65" align="center">10</td>
<td class="xl67" align="center">$9.80</td>
<td class="xl65" align="center">NC</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/2/2011</td>
<td class="xl65" align="center">20</td>
<td class="xl67" align="center">$9.80</td>
<td class="xl65" align="center">NC</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/2/2011</td>
<td class="xl65" align="center">30</td>
<td class="xl67" align="center">$9.90</td>
<td class="xl65" align="center">UPTICK</td>
</tr>
<tr style="height: 15pt;" height="20">
<td class="xl66" style="height: 15pt;" align="center"
height="20">1/2/2011</td>
<td class="xl65" align="center">30</td>
<td class="xl67" align="center">$9.90</td>
<td class="xl65" align="center">ZERO.UPTICK</td>
</tr>
</tbody>
</table>
<tt><span style="font-size: 10pt; line-height: 115%;"><br>
<u><b>O CÓDIGO EM SI:</b></u><br>
<b><big>#</big></b> Abre o arquivo de dados, cria um novo objeto
"y" com uma coluna vazia.<br>
x <-
read.table("dados.txt",sep=";",header=F,skip=1)</span></tt><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><br>
<tt><span style="">y
<- cbind(x,(rep(NA,nrow(x))))</span></tt><br>
<tt><span style=""></span></tt><tt><span style=""><br>
<big><b># 1º Loop:</b></big> Se a operação foi nº 10 não
classifica, o resto classifica.<br>
</span></tt>
<tt><span style=""></span></tt></span><span style="font-size:
10pt; line-height: 115%; font-family: "Courier New";"><tt><span
style="">z
<- 1:nrow(x)</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style="">for
(t in z)</span></tt><br>
<tt><span style="">{</span></tt><br>
<tt><span style="">
if (y[t,2]==10)</span></tt><br>
<tt><span style="">
y[t,4]<-"NC"</span></tt><br>
<tt><span style="">
else y[t,4] <-"C"</span></tt><br>
<tt><span style="">}<br>
<br>
<big><b># 2º Loop:</b></big> Se a operação anterior não foi
classificada e o preço não mudou na atual, desclassifica esta
também.<br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style="">w
<- 1:(nrow(x)-1)</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt>
<tt><span style="">for
(i in w)</span></tt><br>
<tt><span style="">{</span></tt><br>
<tt><span style="">
if (y[i,4]=="NC" & y[i,3]==y[i+1,3])</span></tt><br>
<tt><span style="">
y[i+1,4]<-"NC"</span></tt><br>
<tt><span style="">}<br>
<big><b># 3º Loop:</b></big> divide as operações classificadas
em quatro classes:<br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style="">for
(i
in w)</span></tt><br>
<tt><span style="">{
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style=""><br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style=""><b><big>#</big></b></span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""> Se o preço diminuiu,
DOWNTICK;</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt>
<tt><span style="">
if (y[i+1,4]=="C" & y[i,3]>y[i+1,3])</span></tt><br>
<tt><span style="">
y[i+1,4]<-"DOWNTICK"<br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style=""><b><big>#</big></b></span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""> Se o preço aumentou,
UPTICK;</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt>
<tt><span style="">
if (y[i+1,4]=="C" & y[i,3]<y[i+1,3])</span></tt><br>
<tt><span style="">
y[i+1,4]<-"UPTICK"<br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style=""><b><big>#</big></b>
Se o preço permaneceu constante, mas a ultima variação foi
positiva, ZERO.UPTICK;</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt>
<tt><span style="">
if (y[i+1,4]=="C" & y[i,3]==y[i+1,3] & </span></tt><br>
<tt><span style="">
(y[i,4]=="UPTICK" | y[i,4]=="ZERO.UPTICK"))</span></tt><br>
<tt><span style="">
y[i+1,4]<-"ZERO.UPTICK"<br>
</span></tt></span><span style="font-size: 10pt; line-height:
115%; font-family: "Courier New";"><tt><span style=""></span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""><b><big>#</big></b></span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""> </span></tt></span><span
style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style="">Se o preço permaneceu
constante, mas a ultima variação foi negativa, ZERO.DOWNTICK;</span></tt></span><br>
<span style="font-size: 10pt; line-height: 115%; font-family:
"Courier New";"><tt><span style=""></span></tt>
<tt><span style="">
if (y[i+1,4]=="C" & y[i,3]==y[i+1,3] & </span></tt><br>
<tt><span style="">
(y[i,4]=="DOWNTICK" |
y[i,4]=="ZERO.DOWNTICK"))</span></tt><br>
<tt><span style="">
y[i+1,4]<-"ZERO.DOWNTICK"</span></tt><br>
<tt><span style="">}</span></tt></span>
</body>
</html>