<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Peço desculpas pela falta de clareza, ela é em razão do pouco
    conhecimento sobre o R.<br>
    Entretanto, a indicação do laço while foi suficiente para resolver a
    questão da seguinte forma:<br>
    obs.: talvez ainda haja maneira mais rápida:<br>
    <tt>#Loop 2</tt><br>
    <tt>n = nrow(y)<br>
      while (any ( (diff(y[,5]) == 0 & y[(-n), 13] == 'NC' &
      y[-1, 13] !='NC' )))<br>
      {<br>
      y[-1, 13] = ifelse(diff(y[,5]) == 0 & y[-n, 13] == 'NC', 'NC',
      y[-1, 13])<br>
      }<br>
      })<br>
      #Loop 3:<br>
      dy = diff(y[,5])<br>
      y[-1, 13] = ifelse(y[-1, 13] == 'C' & dy < 0,<br>
       'DOWNTICK', y[-1, 13])<br>
      y[-1, 13] = ifelse(y[-1, 13] == 'C' & dy > 0,<br>
       'UPTICK', y[-1, 13])<br>
      while (any(y[,13]=="C"))<br>
      {<br>
          y[-1, 13] = ifelse(y[-1, 13] == 'C' & dy == 0 & y[-n,
      13]<br>
           %in% c('UPTICK', 'ZERO.UPTICK'), 'ZERO.UPTICK', y[-1, 13]) <br>
          y[-1, 13] = ifelse(y[-1, 13] == 'C' & dy == 0 & y[-n,
      13]<br>
           %in% c('DOWNTICK', 'ZERO.DOWNTICK'), 'ZERO.DOWNTICK', y[-1,
      13])<br>
      }<br>
      })<br>
      <br>
      Muito agradecido,<br>
      Luciano.<br>
      <br>
    </tt><br>
    <br>
    <br>
    Em 6/20/2011 9:16 PM, Benilton Carvalho escreveu:
    <blockquote
      cite="mid:BANLkTi=JMxyRwJZjEm3N4cXuCzYWAyBLyg@mail.gmail.com"
      type="cite">Luciano,
      <div><br>
      </div>
      <div>por gentileza, de uma descricao precisa e um exemplo
        reproduzivel do codigo ao qual vc se refere como lento para que
        possamos tentar ajudar.</div>
      <div><br>
      </div>
      <div>O exemplo que te dei reproduz exatamente o codigo que voce
        passou... mas entendo que, alem da eficiencia do codigo, vc se
        refere a um outro problema, que me parece poder ser resolvido
        com a execucao do codigo que passei em um laco while (no qual vc
        armazena o estado anterior da sua tabela e suspende a execucao
        quando voce obtiver duas tabelas identicas).</div>
      <div><br>
      </div>
      <div>Dito isso, passe-nos um exemplo detalhado das condicoes
        necessarias para cada caso possivel, incluindo uma tabela
        inicial (que possa ser preferencialmente lida sem maiores
        trabalhos por quem se propoe a te ajudar) e a tabela final
        correta, a ser obtida no fim da execucao da rotina.</div>
      <div><br>
      </div>
      <div>b</div>
      <div><br>
        <div class="gmail_quote">2011/6/21 Luciano Ramos Gonçalves <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:lrg.financas@gmail.com">lrg.financas@gmail.com</a>></span><br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div text="#000000" bgcolor="#ffffff"> A correção foi
              acertada. Mas não era o problema que eu havia mencionado.<br>
              Por exemplo:<br>
              <br>
              <table width="357" border="0" cellpadding="0"
                cellspacing="0" height="232">
                <tbody>
                  <tr height="20">
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt; width: 59pt;"
                      width="78" align="center" height="20">Data</td>
                    <td style="width: 59pt;" width="78" align="center">Operação</td>
                    <td style="width: 57pt;" width="76" align="center">Preço</td>
                    <td style="width: 94pt;" width="125" align="center">Classificação</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">10</td>
                    <td align="center">$10.00</td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">20</td>
                    <td align="center">$10.00<br>
                    </td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">30</td>
                    <td align="center">$10.00</td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">40</td>
                    <td align="center">$10.00</td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">50</td>
                    <td align="center">$10.20</td>
                    <td align="center">UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">60</td>
                    <td align="center">$10.20</td>
                    <td align="center">ZERO.UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">70</td>
                    <td align="center">$10.20</td>
                    <td align="center">ZERO.UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">80</td>
                    <td align="center">$10.20</td>
                    <td align="center">ZERO.UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">90</td>
                    <td align="center">$10.20</td>
                    <td align="center">ZERO.UPTICK</td>
                  </tr>
                </tbody>
              </table>
              <br>
              Assim é que a seguinte sequencia deveria ser classificada,<br>
              Mas o código tem dado essa resposta:<br>
              <table width="357" border="0" cellpadding="0"
                cellspacing="0" height="232">
                <tbody>
                  <tr height="20">
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt; width: 59pt;"
                      width="78" align="center" height="20">Data</td>
                    <td style="width: 59pt;" width="78" align="center">Operação</td>
                    <td style="width: 57pt;" width="76" align="center">Preço</td>
                    <td style="width: 94pt;" width="125" align="center">Classificação</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">10</td>
                    <td align="center">$10.00</td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">20</td>
                    <td align="center">$10.00<br>
                    </td>
                    <td align="center">NC</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">30</td>
                    <td align="center">$10.00</td>
                    <td align="center">C</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">40</td>
                    <td align="center">$10.00</td>
                    <td align="center">C</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">50</td>
                    <td align="center">$10.20</td>
                    <td align="center">UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">60</td>
                    <td align="center">$10.20</td>
                    <td align="center">ZERO.UPTICK</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">70</td>
                    <td align="center">$10.20</td>
                    <td align="center">C</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">80</td>
                    <td align="center">$10.20</td>
                    <td align="center">C</td>
                  </tr>
                  <tr style="min-height: 15pt;" height="20">
                    <td style="min-height: 15pt;" align="center"
                      height="20">1/1/2011</td>
                    <td align="center">90</td>
                    <td align="center">$10.20</td>
                    <td align="center">C</td>
                  </tr>
                </tbody>
              </table>
              <br>
              O código olha apenas para o imediatamente anterior, o que
              atrapalha o resultado.<br>
              <br>
              Luciano.<br>
              <br>
              Em 6/20/2011 8:29 PM, Benilton Carvalho escreveu:
              <div>
                <div class="h5">
                  <blockquote type="cite">os sinais nos diffs pro loop 3
                    estavam invertidos (essa era a parte do
                    'nao-testado'):
                    <div><br>
                    </div>
                    <div>
                      <div>dy = diff(y[,3])</div>
                      <div>y[-1, 4] = ifelse(y[-1, 4] == 'C' & dy
                        < 0, 'DOWNTICK', y[-1, 4])</div>
                      <div>y[-1, 4] = ifelse(y[-1, 4] == 'C' & dy
                        > 0, 'UPTICK', y[-1, 4])</div>
                      <div>y[-1, 4] = ifelse(y[-1, 4] == 'C' & dy ==
                        0 & y[-n, 4] %in% c('UPTICK',
                        'ZERO.UPTICK'), 'ZERO.UPTICK', y[-1, 4]) </div>
                      <div>y[-1, 4] = ifelse(y[-1, 4] == 'C' & dy ==
                        0 & y[-n, 4] %in% c('DOWNTICK',
                        'ZERO.DOWNTICK'), 'ZERO.DOWNTICK', y[-1, 4])</div>
                      <div><br>
                      </div>
                      <div>adicionalmente, os resultados que agora passo
                        batem com aqueles providos pelo seu codigo
                        original.</div>
                      <div><br>
                      </div>
                      <div>sobre o primeiro item nao ser classificado no
                        loop 2, e' um reflexo do que o seu codigo faz,
                        pois ele comeca a classificar em y[i+1,4] com
                        'i' comecando em 1...</div>
                      <div><br>
                      </div>
                      <div>b</div>
                      <br>
                      <div class="gmail_quote">2011/6/21 Luciano Ramos
                        Gonçalves <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:lrg.financas@gmail.com"
                            target="_blank">lrg.financas@gmail.com</a>></span><br>
                        <blockquote class="gmail_quote" style="margin:
                          0pt 0pt 0pt 0.8ex; border-left: 1px solid
                          rgb(204, 204, 204); padding-left: 1ex;">
                          <div text="#000000" bgcolor="#ffffff"> Fiz uns
                            testes e realmente ficou muito mais rápido.
                            Apenas três problemas apareceram, todos com
                            a mesma provável resolução.<br>
                            No loop 2:<br>
                            O primeiro negócio não é classificado, e os
                            próximos, digamos, 6, mantém o mesmo preço,
                            logo, todos estes deveriam ser não
                            classificados. O código apenas desclassifica
                            o subsequente. Para que estivesse ok, teria
                            que ser repetido.<br>
                            No loop 3:<br>
                            Acontece algo semelhante. Se havia um
                            Zero.DOWNTICK, e o próximo negócio também
                            não mudou este tb deveria ser ZERO.DOWNTICK,
                            mas o código está mantendo "C".<br>
                            <br>
                            Grato,<br>
                            <br>
                            Luciano.<br>
                            <br>
                            <br>
                            Em 6/20/2011 5:34 PM, Benilton Carvalho
                            escreveu:
                            <div>
                              <div>
                                <blockquote type="cite">
                                  <div>abaixo, nao testado, deve estar
                                    bem proximo do q vc precisa. b</div>
                                  <div><br>
                                  </div>
                                  loop 1:
                                  <div><br>
                                  </div>
                                  <div>y[,4] = ifelse(y[,2] == 10, 'NC',
                                    'C')</div>
                                  <div><br>
                                  </div>
                                  <div>loop 2:</div>
                                  <div><br>
                                  </div>
                                  <div>n = nrow(y)</div>
                                  <div>y[-1, 4] = ifelse(diff(y[,3]) ==
                                    0 & y[-n, 4] == 'NC', 'NC',
                                    y[-1, 4])<br>
                                    <br>
                                  </div>
                                  <div>loop 3:</div>
                                  <div><br>
                                  </div>
                                  <div>dy = diff(y[,3])</div>
                                  <div>y[-1, 4] = ifelse(y[-1, 4] == 'C'
                                    & dy > 0, 'DOWNTICK', y[-1,
                                    4])</div>
                                  <div>y[-1, 4] = ifelse(y[-1, 4] == 'C'
                                    & dy < 0, 'UPTICK', y[-1, 4])</div>
                                  <div>y[-1, 4] = ifelse(y[-1, 4] == 'C'
                                    & dy == 0 & y[-n, 4] %in%
                                    c('UPTICK', 'ZERO.UPTICK'),
                                    'ZERO.UPTICK', y[-1, 4]) </div>
                                  <div>
                                    <div>y[-1, 4] = ifelse(y[-1, 4] ==
                                      'C' & dy == 0 & y[-n, 4]
                                      %in% c('DOWNTICK',
                                      'ZERO.DOWNTICK'), 'ZERO.DOWNTICK',
                                      y[-1, 4]) </div>
                                    <div><br>
                                    </div>
                                    <div><br>
                                    </div>
                                    <div class="gmail_quote">2011/6/20
                                      Luciano Ramos Gonçalves <span
                                        dir="ltr"><<a
                                          moz-do-not-send="true"
                                          href="mailto:lrg.financas@gmail.com"
                                          target="_blank">lrg.financas@gmail.com</a>></span><br>
                                      <blockquote class="gmail_quote"
                                        style="margin: 0pt 0pt 0pt
                                        0.8ex; border-left: 1px solid
                                        rgb(204, 204, 204);
                                        padding-left: 1ex;">
                                        <div text="#000000"
                                          bgcolor="#ffffff"> <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">
                                            <colgroup><col style="width:
                                                59pt;" width="78"
                                                span="2"> <col
                                                style="width: 57pt;"
                                                width="76"> <col
                                                style="width: 94pt;"
                                                width="125"> </colgroup><tbody>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt; width: 59pt;"
                                                  width="78"
                                                  align="center"
                                                  height="20">Data</td>
                                                <td style="width: 59pt;"
                                                  width="78"
                                                  align="center">Operação</td>
                                                <td style="width: 57pt;"
                                                  width="76"
                                                  align="center">Preço</td>
                                                <td style="width: 94pt;"
                                                  width="125"
                                                  align="center">Classificação</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/1/2011</td>
                                                <td align="center">10</td>
                                                <td align="center">$10.00</td>
                                                <td align="center">NC</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/1/2011</td>
                                                <td align="center">20</td>
                                                <td align="center">$9.90</td>
                                                <td align="center">DOWNTICK</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/1/2011</td>
                                                <td align="center">30</td>
                                                <td align="center">$9.90</td>
                                                <td align="center">ZERO.DOWNTICK</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/1/2011</td>
                                                <td align="center">40</td>
                                                <td align="center">$10.10</td>
                                                <td align="center">UPTICK</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/1/2011</td>
                                                <td align="center">50</td>
                                                <td align="center">$10.20</td>
                                                <td align="center">UPTICK</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/2/2011</td>
                                                <td align="center">10</td>
                                                <td align="center">$9.80</td>
                                                <td align="center">NC</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/2/2011</td>
                                                <td align="center">20</td>
                                                <td align="center">$9.80</td>
                                                <td align="center">NC</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/2/2011</td>
                                                <td align="center">30</td>
                                                <td align="center">$9.90</td>
                                                <td align="center">UPTICK</td>
                                              </tr>
                                              <tr style="min-height:
                                                15pt;" height="20">
                                                <td style="min-height:
                                                  15pt;" align="center"
                                                  height="20">1/2/2011</td>
                                                <td align="center">30</td>
                                                <td align="center">$9.90</td>
                                                <td 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>y <-
                                                cbind(x,(rep(NA,nrow(x))))</span></tt><br>
                                            <tt><span></span></tt><tt><span><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></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span>z
                                                <- 1:nrow(x)</span></tt></span><br>
                                          <span style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span>for (t
                                                in z)</span></tt><br>
                                            <tt><span>{</span></tt><br>
                                            <tt><span>    if
                                                (y[t,2]==10)</span></tt><br>
                                            <tt><span>      
                                                 y[t,4]<-"NC"</span></tt><br>
                                            <tt><span>    else y[t,4]
                                                <-"C"</span></tt><br>
                                            <tt><span>}<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>w
                                                <- 1:(nrow(x)-1)</span></tt></span><br>
                                          <span style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span></span></tt>
                                            <tt><span>for (i in w)</span></tt><br>
                                            <tt><span>{</span></tt><br>
                                            <tt><span>    if
                                                (y[i,4]=="NC" &
                                                y[i,3]==y[i+1,3])</span></tt><br>
                                            <tt><span>      
                                                 y[i+1,4]<-"NC"</span></tt><br>
                                            <tt><span>}<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>for (i
                                                in w)</span></tt><br>
                                            <tt><span>{    </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span><br>
                                              </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span><b><big>#</big></b></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span> Se o
                                                preço diminuiu,
                                                DOWNTICK;</span></tt></span><br>
                                          <span style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span></span></tt>
                                            <tt><span>    if
                                                (y[i+1,4]=="C" &
                                                y[i,3]>y[i+1,3])</span></tt><br>
                                            <tt><span>      
                                                 y[i+1,4]<-"DOWNTICK"<br>
                                              </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span><b><big>#</big></b></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span> Se o
                                                preço aumentou, UPTICK;</span></tt></span><br>
                                          <span style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span></span></tt>
                                            <tt><span>    if
                                                (y[i+1,4]=="C" &
                                                y[i,3]<y[i+1,3])</span></tt><br>
                                            <tt><span>      
                                                 y[i+1,4]<-"UPTICK"<br>
                                              </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span><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></span></tt>
                                            <tt><span>    if
                                                (y[i+1,4]=="C" &
                                                y[i,3]==y[i+1,3] & </span></tt><br>
                                            <tt><span>          
                                                 (y[i,4]=="UPTICK" |
                                                y[i,4]=="ZERO.UPTICK"))</span></tt><br>
                                            <tt><span>      
                                                 y[i+1,4]<-"ZERO.UPTICK"<br>
                                              </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span><b><big>#</big></b></span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span> </span></tt></span><span
                                            style="font-size: 10pt;
                                            line-height: 115%;
                                            font-family: "Courier
                                            New";"><tt><span>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></span></tt>
                                            <tt><span>    if
                                                (y[i+1,4]=="C" &
                                                y[i,3]==y[i+1,3] & </span></tt><br>
                                            <tt><span>          
                                                 (y[i,4]=="DOWNTICK" |
                                                y[i,4]=="ZERO.DOWNTICK"))</span></tt><br>
                                            <tt><span>      
                                                 y[i+1,4]<-"ZERO.DOWNTICK"</span></tt><br>
                                            <tt><span>}</span></tt></span>
                                        </div>
                                        <br>
_______________________________________________<br>
                                        R-br mailing list<br>
                                        <a moz-do-not-send="true"
                                          href="mailto:R-br@listas.c3sl.ufpr.br"
                                          target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
                                        <a moz-do-not-send="true"
                                          href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                                          target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                                        Leia o guia de postagem (<a
                                          moz-do-not-send="true"
                                          href="http://www.leg.ufpr.br/r-br-guia"
                                          target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
                                        e forneça código mínimo
                                        reproduzível.<br>
                                      </blockquote>
                                    </div>
                                    <br>
                                    <br clear="all">
                                    <br>
                                    -- <br>
                                    Successful people ask better
                                    questions, and as a result, they get
                                    better answers. (Tony Robbins)<br>
                                  </div>
                                  <pre><fieldset></fieldset>
_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<a moz-do-not-send="true" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
                                </blockquote>
                                <br>
                              </div>
                            </div>
                          </div>
                          <br>
_______________________________________________<br>
                          R-br mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:R-br@listas.c3sl.ufpr.br"
                            target="_blank">R-br@listas.c3sl.ufpr.br</a><br>
                          <a moz-do-not-send="true"
                            href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                            target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                          Leia o guia de postagem (<a
                            moz-do-not-send="true"
                            href="http://www.leg.ufpr.br/r-br-guia"
                            target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
                          e forneça código mínimo reproduzível.<br>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <br>
                      -- <br>
                      Successful people ask better questions, and as a
                      result, they get better answers. (Tony Robbins)<br>
                    </div>
                    <pre><fieldset></fieldset>
_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<a moz-do-not-send="true" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            R-br mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
            <a moz-do-not-send="true"
              href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
              target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
            Leia o guia de postagem (<a moz-do-not-send="true"
              href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
            e forneça código mínimo reproduzível.<br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <br>
        -- <br>
        Successful people ask better questions, and as a result, they
        get better answers. (Tony Robbins)<br>
      </div>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
R-br mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a class="moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
    </blockquote>
    <br>
  </body>
</html>