Você está na página 1de 59
91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: A Implementagao da Analise Automatica das Ondas de Elliott em MQL5 *RoVas | 6 marco, 2014 Introducao Um dos métodos mais populares de andlise do mercado ¢ o principio das ondas de Elliott. No entanto, este processo é muito complicado, o que leva & utilizacéo de instrumentos adicionais. Um desses instrumentos é 0 marcador automatico. Este artigo descreve a criacdo de um analisador automatic de ondas de Elliott na linguagem MOLS. Supde-se que 0 leitor ja esteja familiarizado com a teoria da onda, se nao, vocé precisa consultar as fontes adequadas. 1. Principio das Ondas de Elliott Ondas de Elliott - é um modelo tedrico do comportamento do mercado, desenvolvido por Ralph Nelson Elliott, segundo 0 qual todos os movimentos de precos no mercado estao sujeitos a psicologia humana e é um processo ciclico de mudancas das ondas de impulso a correcao e vice versa, ‘As ondas de impulso sao uma sequéncia de cinco flutuacées de precos, as ondas corretivas - uma sequéncia de trs ou cinco flutuacdes de presos. AS ondas de impuiso em sua forma, estrutura e as regras que thes séo aplicaveis sao dos seguintes tipos: 41. Impulsos = Aextremidade da segunda onda nunca chega ao inicio da primeira onda; = Aterceira onda sempre se estende além do topo da primeira onda; = 0 fim da quarta onda nunca chega ao topo da primeira onda; + Aterceira onda nunca é a menor de todas as ondas atuantes; + Aterceira onda é sempre um impulso; = Aprimeira onda pode ser um impulso ou um dominante diagonal; = A quinta onda pode ser um impulso ou uma diagonal; + Assegunda onda pode assumir a forma de qualquer onda corretiva, exceto um triangulo; = Aquarta onda pode assumir a forma de qualquer Figura 1. Impulse onda correcional; 2. Diagonais principais: + Aextremidade da segunda onda nunca chega ao inicio da primeira onda; = Aterceira onda sempre se estende além do topo da primeira onda; = 0 fim da quarta onda ven sempre por cima da primefra onda, mas nunca ultrapassa o comeco da terceira onda; + Aterceira onda nunca é a menor de todas as ondas atuantes; + Aterceira onda é sempre um impulso; = Aprimeira onda pode ser um impulso ou ur dominante diagonal; + A quinta onda pode ser um impulso ou uma diagonal; Figura 2. Diagonal principal + Asegunda onda pode assumir a forma de qualquer onda corretiva, exceto um triangulo; + Aquarta onda pode assumir a forma de qualquer onda correcional; hitpslwwnzmel5.convptlarcles!2607print= ‘59 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: 3. Diagonais: Figura 3. Diagonal ‘As ondas corretivas sao classificadas em: 4, Tigue-zagues: Figura 4. Zigue-zague 5. Planos: Figura 5. Plano 6. Zigue-zagues Duplos: hitps:iwwnzmel5.comvptlarcles/2607print= ‘A extremidade da segunda onda nunca chega ao inicio da primeira onda; A terceira onda sempre se estende além do topo da primeira onda; fim da quarta onda vem geralmente sobre o topo da primeira onda, mas nunca passa por cima da terceira ond A terceira onda nunca é a menor de todas as ondas atuantes; A primeira, segunda e terceira ondas podem assumir a forma de qualquer onda corretiva, exceto um triéngulo; A quarta e quinta ondas podem assumir a forma de qualquer onda correcional; A onda A pode assumir a forma de um impulso ou um dominante diagonal; A onda C pode assumir a forma de um impulso ou uma diagonal; A onda B pode assumir a forma de qualquer onda corretiva;, Anda Cestende-se além do topo da onda A; fim da onda B nao ultrapassa 0 inicio da onda A; ‘onda A pode assumir a forma de qualquer onda corretiva, exceto um triangulo; A onda B pode assumir a forma de qualquer onda corretiva;, ‘A onda C pode assumir a forma de um impulso ou uma diagonal; 2159 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: Y Figura 6. 2igue-zague Duplo 7. Zigue-zagues triplos Figura 7, Tigue-zagve triplo 8, Duplo Trés: WwW ¥ Figura 8. Duplo Trés 9. Triplo Trés: Figura 9. Tipo Tres 10, Contra¢ao do Triangul hitps:iwwnzmel5.comvptlarcles/2607print= + Aonda We Y assumem a forma de um zigue-zague; = Aonda X pode assumir a forma de qualquer onda corretiva; + Aonda Y estende-se além do topo da onda W; = 0 fim da onda X nao ultrapassa 0 inicio da onda W; = As ondas W, Y e Z assumem a forma de um zigue- zague; + Aonda X pode assumir a forma de qualquer onda corretiva, exceto um triangulo; = Aonda XX pode assumir a forma de qualquer onda corretiva; = Aonda Y estende-se além do topo da onda W; = Aonda Z estende-se além do topo da onda Y; = 0 fim da onda X nao ultrapassa 0 inicio da onda W; =O fim da onda XX nao ultrapassa o inicio da onda ¥: = A onda W assume a forma de qualquer onda corretiva, exceto um triangulo; + As ondas K e Y podem assumir a forma de qualquer onda corretiva; = As ondas W, X e Y podem assumir qualquer forma de uma onda corretiva, exceto um triangulo; = As ondas XX e Z podem assumir a forma de qualquer onda corretiva; 3159 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Eliot em MALS - Argos MLS: = Aonda C nunca vai além dos limites de preco da onda B; = Aonda'D nunca vai além dos limites de preco da onda C; = Aonda E nunca vai além dos limites de preco da onda D; = As ondas A, B e C podem assumir a forma de qualquer onda corretiva, exceto um triangulo; = As ondas D e E podem assumir a forma de qualquer, onda corretiva; D + Aonda C é sempre maior em comprimento que a onda B + Aonda D é sempre maior em comprimento que a onda C = As ondas A, Be C podem assumir a forma de qualquer onda corretiva, exceto para o triangulo = As ondas De E podem assumir a forma de qualquer onda corretiva Figura 11. Expansto do Tringulo: Os modelos e regras de ondas, apresentados acima, correspondem apenas & noao classica da analise de onda. HA também a sua concepcao moderna, formada durante o estudo do mercado Forex. Por exemplo, um novo modelo de triéngulo obliquo (destizante) é encontrado, os impulsos com o tridngulo na segunda onda sio identificados, etc. Como pode ser visto a partir das figuras 1-11, cada impulso ou onda corretiva consiste do mesmo impulso e ondas corretivas (mostradas pela linha tracejada), mas em menor grau. Este é 0 chamado fractal {aninhamento) de ondas de Elliott: ondas de um grande grau consistem de ondas de menor grau, 0 que, por sua vez, 540 compostas de ondas muito menores, e assim por diante. Nesta nota, podemos completar a breve introducao ao principio das ondas de Elliott e ir para o tépico de mark-up automatico das ondas. 2. Algoritmo do mark-up automatico das Ondas de Elliott Como vocé provavel mente ja percebeu, a andlise de Onda de Elliott é um proceso complexo e multifacetado. Portanto, as pessoas comecaram desde o inicio pesquisar e aplicar os instrumentos que ajudam a facilita-la. Uma dessas ferramentas tornourse 0 mecanismo de mark-up automatico das Ondas de Elliott. Podemos distinguir dois principios de mark-ups automaticos: 1, De acordo com a fractalidade das ondas, a analise é levada a cabo de cima para baixo, a partir da onda maior para as menores; 2. Aanalise é levada a cabo por um enumeracao direta de todas as op¢des possiveis. Um diagrama de bloco de analise automatica das Ondas de Elliott ¢ demonstrado na figura 12. hitps:iwwnzmel5.comvptlarcles/2607print= 459 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Eliott em MALS - Argos MALS: Start Using the ZigZag, find the points, needed to mark a wave (atthe specified interval) ._—____ Select the Sth subwave formar of peaks using the points ' - a _7~ 1s there any Select the 2nd subwave anatcamencien? |_ves No + Select the tst subweve Check the formed wave [Seba te te ehuen® | JL wi The wave YES<— 10! Finish) correspond to rules? Figura 12. Um diagrama de bloco de analise automatica das ondas de Eliott Considere 0 algoritmo em mais detalhes, com base no exemplo do mark-up automatico de impulso (ver Figura 13). Na primeira etapa, no intervalo de tempo necessario da tabela de precos, utilizando o "Zigue-zague”, a quantidade de pontos necessarios para fazer o mark-up sao realcados. O numero de pontos depende de que tipo de onda queremos analisar. Assim, para a analise do impulso, sao necessarios seis pontos - 5 vértices e um ponto de partida. Se fossemos analisar o ziguezague, o numero de pontos necessarios teria sido de 4 - 3 vértices e um ponto de partida. Se 0 "Zigue-zague" identificou seis pontos na tabela de precos, entéo podemos gerar imediatamente um mark- Uup do impulso: primeiro ponto - 0 ponto de partida da primeira onda, o segundo ponto - o vértice da primeira ‘onda, 0 terceiro ponto - o vértice da segunda onda, 0 quarto ponto - 0 vértice da terceira onda, 0 quinto ponto - 0 vértice da quarta onda, e 0 sexto ponto - 0 vértice da quinta onda. No entanto, na Figura 13, 0 "Zigue-zague" identificou 8 pontos. Neste caso, sera necessdrio enumerar por esses pontos todas as opcdes possiveis e mark-ups da onda. E haverd cinco deles (marcados com cores diferentes). E cada versao do mark-up tera de ser verificada de acordo com as regras. hitps:iwwnzmel5.comvptlarcles/2607print= 5159 ra10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Eliot! em MALS - Argos MLS: 13400 55/555 13020 1.26005 121800 333 1.7880 109630 4444 108630 331 soso 97320 111 4 093320 y 222 25120 oa30 7 On 1988 2 May 2000 7 ERAN 2201 31M 2002 To Nov 202 22 in EEE Figura 13. Opcdes para marcar o mark-up de um impulso "2 Sep2004 54 Apr 2008 Depois de se verificar em oposicao as regras, no caso do mark-up da onda ser um impulso por todos os parametros, todas as suas sub-ondas sao analisadas da mesma maneira. (0 mesmo aplica-se as andlises de todos 0s outros impulsos e as ondas de correcao. 3. Os tipos de ondas para o mark-up automatico Como afirmado anteriormente, a analise sera realizada a partir do topo para baixo, dando as instrucdes do programa para encontrar alguma onda num determinado intervalo. No entanto, no intervalo maior, é impossivel determinar o estado da onda, seu inicio e fim. Vamos chamar de uma onda nao iniciada e inacabada. Todas as ondas podem ser divididas nos seguintes grupos: 1. Ondas nao iniciadas: 1 6. ‘As ondas com uma primeira onda nao iniciada- 1-2-3-4-5 (por exemplo, um impulso com uma ‘onda nao iniciada 1, 0 nimero de pontos necessarios - 5), e 1-2-3 (por exemplo, um Zigue-zague ‘com uma onda nao iniciada A, o numero de pontos necessérios - 3); ‘As ondas com uma segunda onda nao iniciada - 2-3-4-5 (por exemplo, uma diagonal com uma ‘onda nao iniciada 2, 0 niimero de pontos necessarios - 4), e 2-3 (por exemplo, um plano com uma ‘onda nao iniciada B, 0 néimero de pontos necessarios -2); ‘Ondas com uma terceira onda nao comecada - 3-4-5 (por exemplo, um Zigue-zague Triplo com uma onda nao iniciada Y, 0 némero de pontos necessarios - 3); ‘Ondas com uma quarta onda nao iniciada - 4-5 (por exemplo, um Triangulo com uma onda nao iniciada D, 0 néimero de pontos necessarios -2); ‘Ondas com uma quinta onda nao iniciada - 5 (por exemplo, um impulso com uma onda nao iniciada 5, 0 némero de pontos necessarios - 1); ‘Ondas com uma terceira onda nao iniciada - 3 (por exemplo, um duplo trés com uma onda nao iniciada Z, 0 numero de pontos necessarios - 1); 2. Ondas inacabadas: 1 2, hitpsiwwn.melS.comiplarcles!2607print= ‘Ondas com uma quinta onda inacabada - -1-2-3-4-5 (por exemplo, um impulso com uma onda nao inacabada 5, 0 niimero de pontos necessarios - 5); ‘Ondas com uma terceira onda inacabada - 1-2-3-4> (por exemplo, um zigue-zague Triplo com uma onda inacabada XX, 0 numero de pontos necessarios - 4); 359 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: 3. Ondas com uma terceira onda inacabada - 1-2-3> (por exemplo, um dominante diagonal da onda inacabada 3, 0 niimero de pontos necessarios -3); 4, Ondas com uma segunda onda nao inacabada - 1-2> (por exemplo, um Zigue-zague com uma onda inacabada B, o ndmero de pontos necessarios -2); 5. Ondas com uma primeira onda inacabada - 1> (por exemplo, um plano com uma onda inacabada A, o niamero de pontos necessarios -1); 3. Ondas nao iniciadas e inacabadas: 1. Ondas com uma primeira onda néo iniciada e uma segunda onda inacabada -1-2> (por exemplo, uum Zigue-zague com uma onda nao iniciada A e uma onda inacabada B, o néimero de pontos necessarios - 1); 2. Ondas com uma segunda onda nao iniciada e uma terceira onda inacabada -2-3>(por exemplo, uum Zigue-zague com uma onda nao iniciada B e uma onda inacabada C, o némero de pontos necessarios - 1); 3. Ondas com uma terceira onda nao iniciada e uma quarta onda inacabada -3-4>(por exemplo, um impulso com uma onda nao iniciada 3 uma onda inacabada 4, 0 niimero de pontos necessarios - 1); 4, Ondas com uma quarta onda nao iniciada e uma quinta onda inacabada -4-5>(por exemplo, um impulso com uma onda nao iniciada 4 e uma onda inacabada 5, 0 niimero de pontos necessarios - 1); 5. Ondas com uma primeira onda nao iniciada e uma terceira onda inacabada -1-2-3>(por exemplo, um triplo trés com uma onda nao iniciada W e uma onda inacabada Y, 0 niimero de pontos necessarios - 2); 6. Ondas com uma segunda onda nao iniciada e uma quarta onda inacabada -2-3-4>(por exemplo, um dominante diagonal com uma onda nao iniciada 2 e uma onda inacabada 4, 0 niimero de pontos necessarios - 2); 7, Ondas com uma terceira onda nao iniciada e uma quinta onda inacabada -3-4-5>(por exemplo, uma diagonal com uma onda nao iniciada 3 e uma onda inacabada 5, 0 niimero de pontos necessarios - 2); 8, Ondas com uma primeira onda nao iniciada e uma quarta onda inacabada -1-2-3-4>(por exemplo, um triplo trés com uma onda nao iniciada W e uma onda inacabada XX, o ntimero de pontos necessarios - 3); 9. Ondas com uma segunda onda nao iniciada e uma quinta onda inacabada -2-3-4-5>(por exemplo, um impulso com uma onda nao iniciada 2 e uma onda inacabada 5, o numero de pontos necessarios - 3); 10. Ondas com uma primeira onda nao iniciada e uma quinta onda inacabada -1-2-3-4-5>(por ‘exemplo, um Triplo zigue-zague com uma onda nao iniciada W e uma onda inacabada Z, o numero de pontos necessarios - 4); 4, Ondas completadas - 1-2-3-4-5 (0 ntimero de pontos necessarios - 6) e 1-2-3 (0 niimero de pontos necessarios - 4). O sinal “<" apés 0 ndimero da onda, indica que ela nao iniciou. 0 sinal ">" apés 0 niimero da onda, indica que ela esta incompleta. Na figura 14 podemos ver as seguintes ondas: 1, Uma a com uma primeira onda nao iniciada A -A -8-C; 2. Uma onda com uma primeira onda nao iniciada W e uma segunda inacabada X -W<-X>; 3. Ondas completadas B e hitps:iwwnzmel5.comvptlarcles/2607print= 7159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MOLS - Argos MALS: 17290 KR 150250 142990 ree 121650 11690 107350 100310 93050 B overs ovi7i0 Thunisea1Feb a2 Loui Lima? iFeb2000 TGe20@ xna00s iFwb20m@ Tomani0 Figura 14. Ondas ndo iniciada e inacabadas 4. A descricao das estruturas de dados do analisador automatico das Ondas de Elliott Para escrever 0 analisador automatico das Ondas de Elliott, precisaremos das seguintes estruturas de dados: 4,1. Aestrutura da descrigéo das ondas analisadas no programa: r f lye uct TwaveDescription NameWiave; o Numiave; ber of sub- i Subwaves [6]; P - Nanes Formula; L ValueVertex(6]; 1 7 x6] 7 ind f ipublic Cobjee Iitpsslwwn.melS.comiplarcles!2607print= 359 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: public: cArzayr wIndexVertex; — // index the vertexes of the zigzag CArrayDouble *ValueVertex; —// value of the vertexes of the zigzags 08 4.4, Classe para representar a arvore de ondas: ntation of the tree of the wave: public: CArzay0b} ‘child; // the child of the given tree node TWave save; // the wave, stored in the given tree node string Texts // text of the tree nod ‘TNode *Add (string Text, TWave *Wave=NULL) // of adding the a: 1 ‘Node *Node=new TNode; Node.child=new CArrayObj; Node.Text =Text; Node. Wave-Nave; Child. add (Node) 5 return (Node) 4.5. A estrutura para o armazenamento dos pontos, encontrado pelo zigue-zague: // The structuxt struct TPoints £ for storing the points, found by the igzag double ValuePoints[]; // the value e found point: int IndexPoints[]? // the indexes of the found points int NumBoint: // the number of found points Me 4.6. Uma classe para armazenar os parametros da secao ja analisadado grafico: // & class for storing the parameters class TNodeInfo:Cobject ( he already analyzed si ion, corresponding t public: iat IndexStart, IndexFinish; Iveady analyzed sect double Valuestart,ValueFinish; // the already analyze: string Subwaves; name of the wave and the group TWode sNode; a nting to the already al be po > 4.7. Uma classe para armazenar a marca¢ao das ondas antes de coloca-las no grafico: //® class for storing the marking of waves bi class TLabel:public Cobject 4 ze plat ng them on the chart public: double Value; // the value of the ve int Level; // the level of the string Text; // the mark ha 5. A descricdo da funcao do analisador automatico das ondas de Elliott Para escrever 0 analisador automatico das Ondas de Elliott, precisaremos das seguintes funcd 5.1, Zigue-zague hitps:lwwnzmel5.comvptlarcles/2607print= 9159 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: ‘A fungao de busca dos extremos dos "Zigue-zagues’ int Zigzag(int#, int Start, int Finish, CArrayInt *IndexVertex,CArrayDouble *ValueVertex) Um elemento chave no analisador automatico das Ondas de Elliott é o “Zigue-zague", pelo qual as ondas serao construdas. 0 célculo do "Zigue-zague” por qualquer parmetro deve ser feito muito rapidamente. No nosso analisador, estaremos usando o "zigue-zague’, retirado do artigo “How to Write Fast Non-Redrawing LigZas ‘A funcao Zigue-zague calcula o Zigue-zague, com o parametro H no intervalo do inicio ao fim, e, em seguida, registra 0s indices encontrados dos vértices e os valores dos vértices, respectivamente, nas matrizes IndexVertex e ValueVertex, cujos enderecos sao passados a esta funcao. ‘A fungo Zigue-zague retorna o niimero de vértices encontrados do "Zigue-zague”. 5,2. FillZigZagArray Funcao do enchimento do "Zigue-zague” e o armazenamento dos seus parametros: void FillZigzagArray(int Start, int Finish) Como foi mostrado antes, teremos que encontrar 0 numero necessario de pontos na tabela de precos para o mark-up da onda. E, portanto, precisaremos ter uma matriz de vertices de "Zigue-zague’, com parametros diferentes, que depois repetiremos para encontrar esses pontos. ‘A funcao FillZigzagArray calcula 0 "zigue-zague" no intervalo do grafico do inicio ao fim, com todos os valores possiveis do parametro H (até ao niimero de vértices do "Zigue-zague” nao sera igual ou inferior a dois), armazena as informacées sobre os vértices encontrados nos objetos de classe TZigzag e os registros desses objetos na ZigzagArray da matriz global, 0 anunciamento deste € como segue: cArrayObj *ZigzagArray; 5, Find ts ‘A fungao de busca em um determinado intervalo requer o niimero de pontos na tabela de precos: bool FindPoints(int NunPoints, int IndexStart, int IndexFinish,double ValueStart,double ¥ ‘A funcao FindPoints procura por pelo menos trés pontos NumPoints na tabela de precos, no intervalo necessario, de indexStart para IndexFinish, com os valores necessarios do primeiro e Ultimo pontos do ValueStart € ValueFinish, e os salva (ou seja, os pontos), em uma estrutura de pontos, no qual o link é passado para esta funcao. A fungao de FindPoints retorna a verdadeiro, se 0 numero necessario de pontos for encontrado, caso contrario, retorna para falso. 5,4, NotStartedAndNotFinishedWaves A funcao da analise das ondas nao iniciadas inacabadas: void NotStartedAndNotFinishedWaves(TWave *ParentWave, int NunWave, TNode *Node, string Sul A funcao NotStartedAndNotFinishedWaves analisa todas as ondas do terceiro grupo de ondas - as ondas nao iniciadas e nao finalizadas. A funcao analisa a onda NumWave (com um nivel de onda Level), ondas com o nome ParentWave.Name, que podem tomar a forma de ondas sub-ondas (a forma de um Zigzag, lisas, Zigzag Duplo, e (ou), etc.). A onda analisada, NumWave, sera armazenada no né da arvore de ondas, 0 nd do no do 0. Por exemplo, se ParentWave.Name = "impulse, NumWave = 5, Subwaves = "Impulse, Diagonal, e Level = 2, ‘entao podemos dizer que a funcao NotStartedAndNotFinishedWaves analisaré a quinta onda de Impulso, que possui um nivel de onda de dois, e pode tomar a forma de um Impulso ou Diagonal. hitpslwwnzmel5.comvptlarcles!2607print= 10159 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: Como exemplo, usamos um diagrama de bloco de anélise de algoritmo das ondas nao iniciadas e nao finalizadas 1<-2-3> na funcao NotStartedAndNotFinishedWaves: Figura 15. 0 diagrama de bloco da analise de onda com a formula" sre="http://p.mql5.com/data/2/260/fig15.gif” height="1746" width="750" style="vertical-align:middle;" /> Figura 15. 0 dlagrama de bloco da andlise de onda com a férmula "1<-2-3> Quando estiver usando a fungao NotStartedAndNotFinishedWaves, as seguintes fungdes sao chamadas: NotStartedWaves, NotFinishedWaves, e FinishedWaves. 5,5, NotStartedWaves Aanalise da fungao de ondas inacabadas: void NotStartedWaves(TWave “ParentWave, int NumWave, TNode *Node, string Subwaves, int Leva A funcao NotStartedWaves analisa todas as ondas do primeiro grupo de ondas - as ondas nao iniciadas. A fungao analisa a onda NumWave (com o nivel de nivel de onda) da onda chamada ParentWave.Name, que pode assumir a forma de ondas de sub-ondas. A onda analisada, NumWave, sera armazenada no no da arvore de ‘ondas, 0 né do né do fitho. Quando a funcéo NotStartedWaves esta trabalhando, as seguintes funcées sAo chamadas: NotStartedWaves e FinishedWaves. Todas as ondas sao analisadas de forma semelhante ao diagrama de blocos na Figura 15. 5,6, NotFinishedWaves Aaanalise da funcao de ondas inacabadas: void NotFinishedWaves (Twave *ParentWave, int NutWave,TNode *Node, string Subwaves, int Ley ‘A funcao NotFinishedWaves analisa todas as ondas do segundo grupo de ondas - ondas inacabadas. A fungéo analisa a onda NumWave (com o nivel de nivel de onda) da onda chamada ParentWave.Name, que pode assumir a forma de ondas de sub-ondas. A onda analisada, NumWave, seré armazenada no né da arvore de ‘ondas, 0 n6 do né do filho. Quando a fungao NotFinishedWaves esta trabalhando, as seguintes fungdes sao chamadas: NotFinishedWaves e FinishedWaves. Todas as ondas sao analisadas de forma semelhante ao diagrama de blocos na Figura 15. FinishedWaves Aanalise da fungao de ondas completadas (acabadas): void FinishedWaves (TWave *ParentWave, int NumWave,TNode *Node, string Subwaves, int Level)) ‘A funcao FinishedWaves analisa todas as ondas do quarto grupo - as ondas completadas. A funcao analisa a ‘onda NumWave (com o nivel de nivel de onda) da onda chamada ParentWave.Name, que pode assumir a forma de ondas de sub-ondas. A onda analisada, NumWave, sera armazenada no né da arvore de ondas, 0 né do né do filho. Quando a funcao FinishedWaves esta trabalhando, a fungao FinishedWaves é chamada: Todas as ondas sao analisadas de forma semelhante ao diagrama de blocos na Figura 15. FindWaveinWaveDescri ‘A fungao de busca da onda na estrutura de dados da WaveDescription : int FindWaveTnWaveDescription (string NameWave} hitpsslwwnzmel5.convplarles/2607print= ‘1159 1910372019 MALS Site/A implementagdo da Andise Automatica das Ondas de Eliott em MQLS - Argos MALS ‘A fungo FindWavelnWaveDescription, pelo nome da onda NameWave, transmitido como um parémetro, 0 procura na matriz de estruturas WaveDescription e devolve o nlimero de indice correspondente a esta onda. ‘A matriz de estruturas WaveDescription parece da seguinte forma: ‘TaveDescription WaveDescription|]= ( { "Impulse", 5, ( "Impulse, Leading Diagonal,", vImpulse,", "Zigzag, Flat, Doubl “Impulse, Diagonal ) ‘ ‘Leading Diagonal", 5, i “Impulse, Leading Diagonal,", "Zigzag, Flat, Double Zigzag, Triple “Impulse, ", "Zigzag, Flat, Double Zigzag, Triple “Impulse, Diagonal," ) { "Diagonal", 5, 4 “Zigzag, Flat, Double Zigzag, Triple "Zigzag, Flat, Double Zigzag, Triple "Zigzag, Flat, Double Zigzag, Triple "Zigzag, Flat, Double Zigzag, Triple "zigzag, Flat, Double Zigzag, Triple ) ‘ "zigzag", 3, ( “Impulse, Leading Diagonal,", "Zigzag, Flat, Double Zigzag, Triple “impulse, Diagonal, ", Flat", 3, a "zigzag, Flat, Double Zigzag, Triple Zigzag, Double Three, Triple Three,", “Zigzag, Flat, Double Zigzag, Triple Zigzag, Double Three, Triple Three, Contractin “Impulse, Diagonal,", Double Zigzag",3, Iitpsslwiwn.mel5.comiplartcles!2607print= Zigzag, Double Zigzag, Double Zigzag, Double Bigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double ‘Three, Triple ‘Three, Triple Three, Triple ‘Three, Triple Three, Triple Three, Triple Three, Triple Three, Triple “zigzag, Flat, Double Zigzag,Triple Zigzag,Double Three,Triple Three,", aigzag, Triple Zigzag, Double Three, Triple Three, Contractin Three,", ‘Three, Contract in: Three, Taree, Taree, Three, Contractin ‘Three, Contractin ‘Three, Contract in: 12159 1910372019, "Zigzag," “zigzag, "» ) ‘ “Triple Zigzag",5, 4 "Zigzag," "Zigzag, Flat, Double "Zigzag, "s "Zigzag, Flat, Double "2igzag," ) ‘ "Double Three", 3, ( "zigzag, Elat, Double “Zigzag, Flat, Double "Zigzag, Flat, Double ) ‘ "Triple Three", 5, ( "Zigzag, Flat, Double "Zigzag, Flat, Double "Zigzag, Flat, Double "Zigzag, Flat, Double “Zigzag, Flat, Double ) 1 ‘Contracting Triangle" ‘ "Zigzag, Flat, Double "Zigzag, Flat, Double “Zigzag, Flat, Double "Zigzag, Flat, Double "zigzag, Flat, Double “Expanding Triangle",5, 4 “Zigzag, Flat, Double "Zigzag, Flat, Double "zigzag, Flat, Double "Zigzag, Flat, Double "Zigzag, Flat, Double Iitpsslwiwn.mel5.comiplartcles!2607print= Zigzag, Triple Zigzag, Triple Zigzag, Triple Zigzag, Triple Bigzag, Triple Bigzag, Triple Zigzag, Triple Zigzag, Triple Zigzag, Triple Zigzag, Triple nee Zigzag, Triple Zigzag, Triple Zigzag, Triple Bigzag, Triple Zigzag, Triple Zigzag, Triple Bigzag, Triple Zigzag, Triple Zigzag, Triple Bigzag, Triple "Zigzag, Flat, Double Zigzag, Triple 2igzag,Double Three, Triple Three, Contractin: Zigzag, Double Zigzag, Triple Zigzag, Double Zigzag, Double Bigzag, Double Bigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double Zigzag, Double 2igzag, Double Zigzag, Double Zigzag, Double 2igzag, Double Zigzag, Double Zigzag, Double Zigzag, Double MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: ‘Three, Triple Three,", Three, Con ting Triangle, Exy Three, Triple Three,", ‘Three, Triple Three, Contractin ‘Three, Triple Three, Contractin: ‘Three, Triple Three, Triple Three, Triple Three, Triple Three, Triple Three,", Three, ", Taree," ‘Three, Contractin Three, Contractin: Three, Triple Three, Triple Three, Triple ‘Three, Triple Three, Triple Taree,", Three, ", Three, ", ‘Three, Contractin Three, Contract in: Three,", Taree,", Three, ", Three, Contractin ‘Three, Contract in: Three, Triple Three, Triple Three, Triple Three, Triple ‘Three, Triple 1359 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: ‘A funcao FindWavelnWaveDescription é utilizada_na anilise de funcéo das seguintes onda: NotStartedAndNotFinishedWaves, NotStartedWaves, NotFinishedWaves, e FinishedWaves. 5,9. Already ‘A fungao que verifica se a dada seco do grafico ja foi analisada: bool Already (TWave *Wave, int NunWave,TNode *Node, string Subwaves) Uma vez que a andlise automética das Ondas de Elliott ocorre pelo métado de enumeracao, a situaco pode surgir quando a dada seco do grafico jé foi analisada para a presenca de uma onda ou um grupo de ondas. Para saber isso, vocé precisa salvar o link para o né na atvore das ondas da onda ja analisada, e s6 entao publicar o link. Tudo isso acontece em funcao Already. ‘A fungao Already procura um NodelnfoArray de matriz global, que armazena os objetos da classe TNodelnfo, 0 intervalo do grafico correspondente a onda NumWave, da onda chamada Wave. O nome, que tem a forma de ‘ondas sub-ondas, e registros no né do endereco, do né da secao j4 marcada do grafico. Se esta secao nao existe, entéo, um novo objeto da classe TNodelnfo é criado e preenchido, e é registrado na matriz NodeinfoArray. A fungo retorna a verdadeiro se o intervalo do grafico jé foi analisado, caso contrario, retorna para falso ‘A matriz NodeinfoArray declarada da seguinte maneira: CArray0bj NodeInfoArray; 5.10. As fungées de verificagao das ondas para as regras Ela inclui_as fungdes VertexAAboveB, WaveAMoreWaveB e WaveRules, a partir da qual as duas primeiras fungdes so chamadas. Ao testar, lembre-se que as ondas podem ser nao iniciadas e (ou) incompletas, e, por ‘exemplo, para a onda com a férmula "| <-2-3>", nao pode ser determinado se a quarta onda ultrapassou 0 territério da primeira onda porque nao existe ainda quarta onda. 5.10. WaveRules Funcao de verificar as ondas para as regras: bool WaveRules (TWave *Wave) A funcao WaveRules retorna para verdadeiro se uma onda, com 0 nome Wave.Name é “correta’, caso contrario retorna para falso. Em seu trabalho, a funcdo WaveRules é chamada pela funcao VertexAAboveVertexB € WaveAMoreWaveB. 5.10.2. VertexAAboveVertexB ‘A fungao de verificacao do excesso de um vértice sobre o outro vértice: int VertexaaboveVertexB (int A,int B,bool InternalPoints) ‘A funcao VertexAAboveVertexB retorna ao niimero> = 0, se 0 topo da onda A excedeu o topo da onda B, caso contrario ela retorna para -1. Se os internalPoints = verdadeiro, entao os pontos internos de ondas (minimo e (ou) maximo) dos valores das ondas) sao tomados em consideracao. 5.10.3, WaveAMoreWaveB ‘A fungo de verificagio do excesso de comprimento de uma onda ao longo do comprimento de uma outra: int WavedMoreWdaveB (int A, int B) ‘A funcdo WaveAMoreWaveB retorna um niimero> = 0 se a onda A é maior que a B, caso contrario, ela retorna para -1. hitps:iwwnzmel5.comvptlarcles/2607print= 14159 1910372019 MALS Site/A implementagdo da Andise Automatica das Ondas de Eliott em MQLS - Argos MALS 11. A funcao de limpar a meméria 5.11.1, ClearTree ‘A funcao de limpar a arvore de ondas com o né superior do né: void Clearfree(INode *Node) 5.14.2, ClearNodeInfoArray, ‘A fungo limpa a matriz ClearNodeinfoarray: void ClearNodeInfoarray() 5.11.3, ClearZigzagArray ‘A fungo para limpeza da matriz ClearNodelnfoArray: void Clear2igzagarray() 5.12, A funcao de contornar as ondas da arvore e a emissao dos resultados da analise para o gréfico Apés a conclusao da analise automatica das Ondas de Elliott, temos uma arvore de ondas. © exemplo pode ser apresentado como na figura abaixo: [_Firstnode | \ {Impulse | ' ar } Impulse =) ' Flat | ay ; Iitpsslwin.mel5.comipiartcles!2607print= 1559 91032019 MALS Sita/A implementagao da Andlse Automatica das Ondas de Eliott em MALS - Argos MLS: =) Impulse Diagonal Leading Diagonal] as | impuise | oz) { Triangle | (es) BO cs =} | Triangle =) { Diagonal Figura 16, Um exemplo de uma arvore de ondas ‘Agora, para apresentar os resultados da analise do grafico, & preciso dar a volta a determinada arvore. Conforme mostrado na Figura 16, ha calma para algumas opcodes (uma vez que existem varias opcoes de ‘ondas), e cada opcao de um desvio leva a uma diferente mark-ups. Podemos distinguir dois tipos de nés de arvore. 0 primeiro tipo ‘om os nomes de onda ("impulso”, "Zigue-zague" etc.) O segundo tipo - os nés com 0 numero de onda ('1", "<", “etc.) Toda a informacao sobre os parametros de onda é armazenada nos primeiros tipos de nds. Portanto, ao visitar esses nés, vamos recuperar e registrar informacdes sobre a onda a fim de em seguida apresenta-la no grafico. Para simplificar, vamos contornar a arvore, visitando apenas as primeiras versdes das ondas. Um exemplo de contorno é apresentado na Figura 17 e é destacado em vermelho. Firstnode hitpsiwwnzmel5.convptlarcles/2607print= 1659 1910372019, MALS Site/A Implementagdo da Anélse Aulomatica das Ondas Eliott em MALS - Argos MALS Impulse impulse [-—— |__agj |_f5 Diagonal A t Leading Diagonal Iitpsslwin.mel5.comiplartcles!2607print= 17159 91032019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio! em MALS - Argos MLS: ca aa | Triangle | B=) {Diagonal | { J (2) (=) Figura 17. Exempla de contorno de uma érvore de onda, 5.12.1, FillLabelArray A fungao de contorno de uma arvore de onda void FillLabelArray(TNode *Node) ‘A funcao FillLabelArray contorna a arvore de onda com o né raiz atendendo apenas as primeiras versdes das ‘ondas na arvore, e, preenche uma LabelArray de matriz global, os indices dos quais, armazenam um link para a matriz de vertices (matriz de objetos da classe TLabel), com o indice dado no grafico. ‘A matriz Labelarray é definida como segue: cArrayObj *Labelarray[]; 5.12.2, CreateLabels A fungao de exibir os resultados da analise no grafico: void Createzabels(} ‘A fungao CreateLabels cria os objetos graficos "Text", correspondente as marcas de onda no grafico. As marcas das ondas sao criadas com base na matriz LabelArray. 5.12, Label Cort ‘A fungao de atualizagao (corre¢ao), dos topos das ondas no grafico: void CorrectLabel (} A fungao CorrectLabel corrige as marcas de onda no grafico quando é rolada e (ou) durante a sua restrigao. 6. A implementacao do particionamento automatico das Ondas de Elliott 6,1. A funcao Zigue-zague: double dl-H*Point (); Iitpsslwiwn.mel5.comiplartcles!2607print= 1859 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: int 3-0, int TemptaxBar int TempwinBar double TempMax = rates [Start] -high; double TempMin = rates (Start) .low; for(int isStart+l;iTempMax) ‘ // if it has, correct the correspond. Tompéax=rates (i) -highs ‘TempMaxBar=i; ) else if (rates [i] lowTempMin+aH) ‘ // otherwise, if the 1a ValueVertex.Add (TempMin) ; IndexVertex.Add (TampMinBaz) ; jet d level is broken, fix the minimum ng variables uy TempMax=rates (i) -highs ‘TempMaxBar=i; , ) return the number of zigzag tops retuzn (i) } 6.2, A fungdo FillZigzagarray /f decla: CArrayObj *ZigzagArray; ie murray global dynamic array The FillzigzagArray function //| search through the values of and fill the array Zigzagarcay e parameter H zigzag is void PillZigzagArray(int Start, int Finish) 4 ZigzagArray=new CArrayOb}; he dynamic array of zig: Iitpsslwiwn.mel5.comiplartcles!2607print= 19159 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: CArzayInt *IndexVertex=new CArrayInt; // cxeate the dynamic array of indexe: CArzayDouble *ValueVertex=new CArrayDouble; // create the dynamic y of values Tzigzag *2igzag: // declare the class for storing t int Hel; int int neZigzag (ll, Start, Finish, IndexVertex, ValueVertex) ; //find if (n>0) ‘ // stoze the tops of the zigzag in the array Zigzaghrray ops of the zigzag + Zigzag=new TZigzag; // create the object storing the found indexes and the z // #111 it and store in the array ZigzagArray Zigzag. IndexVertex=Indexvertes Zigzag. ValueVertex-ValueVertex; 2igzaghrray.Add (Zigzag); jt ) wets 1/ loop of the H of waile (true) { IndexVertex=new CArrayInt; // create a dynamic arra ValueVertexenew CArrayDouble; // create a dynamic array o neZigzag(H, Start, Finish, IndexVertex,ValueVertex); // find the tops of the zigzag if(n>0) ( Zigzag-Zigzaghrray.At (J-1); CArzayInt *PrevindexVertex=Zigzag.IndexVertex; // get the array of indexes of bool b=false; U7 check difference between the current zigzag and the previous for(int 4 ‘ a zigzag in the array Zig Zigzag=new THigza: Zigzag. IndexVertex=IndexVertex; Zigzag. ValueVertex=ValueVertex; ZigzagArray-Add (Zigzag) + jets betruer break; if tb: alse) / otherwise, if there is no difference, release the memory delete IndexVertex; delete ValueVertex; the tops of the zigzag until there is two or less Iitpsslwiwn.mel5.comiplartcles!2607print= //\ The FindPoints function //| Fill the ValuePoints and IndexPoints arrays is + bool FindPoints(int NunPoints,int IndexStart, int IndexFinish,double ValueStart, double 20159 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: V7 #421 ray ZigzagArray for(int isZigzagArray.Total()-1; i>=0;i 4 Taigzag *Zigzag-2igzagArray.At (i); g in the 2 carrayInt *IndexVertex=Zigzag.IndexVertex; // got the array of the indexes of CArrayDouble *ValueVertex=Zigzag.ValueVertex; // get the array of values of the IndexVertex ar: , corresponding to the first point if (IndexVertex.At (j)>=IndexStart) { Indexi=j7 break; ) , If se the index of the IndexVertex array, nding to the last point for(int j=IndexVertex.Total ()-175>=075--) fi Lf (IndexVertex.At (j) <=IndexFinish) ‘ index2: breaks ) , // if the first and last points were found L£((Endexl!=-1) && (Index2!=-1)) 4 n=Index2-Index1+1; // find out how many points were found quired number of junPoints) nts was. or greater) // check that the first and last tops d with the vequired top va if(((ValueStart!=0) 6% (ValueVertex.At (Index?) ! " ((ValueFinish!=0) s@ (ValueVertex.At (Index1+n-1) !=ValueFinish))) continue; W/ £411 the Point Points.NumPoints=n; ArrayResize (Points.ValuePoints, n); ArrayResize (Points.IndexPoints, n); int ke0; Wel ValuePoints and IndexPoints arr for(int j=Indexl; j void NotStartedAndNotFinishedWdaves(TWave *ParentWave, int NunWave, TNode *Node, string Sul 4 int vl,v2,v3,v4,1; ‘Teoints Points; Node *ParentNade, *ChildNode; int IndexNave; string NameWave; TWave *Wave Iitpsslwiwn.mel5.comiplartcles!2607print= 21159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: int i+0,poss0, start=! Put the waves, which we wil string ListNameWave(]; ArrayResize (ListNamelWave, ArrayRange (WaveDeseription,0))? while (pos!=stringlen (Subwaves)-1) ‘ pos=StringFind (Subwaves,",", start); NameWave=StringSubstr (Subwaves, start,pos-start); ListNaneNave (i++]=NameWave; start=postl; ) int Indexstart int IndexFinish double ValueStart double ValueFinis! analyzing to the ListNanel varentWave. IndexVertex (NunWave-1] 7 arentWave. IndexVertex[Numlave] ; ParentWave.ValueVertex(Numiave ~ 1]; ParentWave..ValueVertex|[Numlave) find than two points on the price ch pat then int! i ound, then exit the function if (FindPoints (2, Indexstart, IndexFinish, ValueStart, ValueFinish, Points) // the loop of unbegun and incomplete waves with the formula " vi=0; while (vi<+Bointa.NumBointe-2) ( vaevitli while (v2<=Points.NumPolnts-1) ( int 4-0; waite (3 -1) name of the wave for analysis from NameWave=1istNamewave (j++) find the index of the wave in the ture Wi / the number of its sub-waves and [| (WaveDeseription [Indexwave] .N te the object of T Wave=new Twave; Wave .Name=NameWiave; Wave. Level=Level; Wave. Formula="1<-2-3>" Wave.ValueVertex(0) = 0 Wave.ValueVertex[1] = Points.ValuePoints[v1]; Wave.ValueVertex(2) = Points.ValuePoints[v2]; Wave.ValueVertex [3] Wave.ValueVertex (4) Wave.ValueVertex (3) = Wave. IndexVertex[0) = Indexstart; Wave. IndexVertex[1] = Points. IndexPoints[v1]; Wave. IndexVertex[2] = Points. IndexPoints[v2]; Wave. IndexVertex(3] = IndexFinish; Wave. IndexVertex[4] = 0; Wave. IndexVertex (5) = 0; /] check the w if (WaveRules (Wave} and fill its fie tree arentNode .Add (IntegerTostring if the interval of the chart, corresponding to the first sub-wave,| if (Already (Wave, I, ChildNode, WaveDescript ion [IndexWave] .Subwaves [1] = NotStartedWaves (Wave, T, ChildNode, WaveDescription|TndexWave] .Subwa ets // create the second sub-wave in the waves tree ChildNode-ParentNode -Add (IntegerTostring (=); if the interval of the chart, corresponding to the second sub-wav if (Already (Wave, I, Chi ldNode, RaveDescript ion {IndexWave] . Subwaves [T]) = FinishedWaves (Wave, I, ChildNode, WaveDescription [Indexilave] .Subwave: Iitpsslwiwn.mel5.comiplartcles!2607print= 22169 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: tts create a third sub-wave in the waves tree ChildNode=ParentNode-Add (IntegerTostring(Z)); // if the interval of the chart, corresponding to the third sub-wav Af (Already (Wave, I, Chi ldNode, WaveDescription [ IndexWave] .Subwaves[1]) Not Fini shedWwaves (Wave, I, Chi 1dNode, WaveDescripzion [Indexlave] . Sui. ) else delete Wave; e did pass by the rules, release menory anbegun and un nished waves while (w2<=Points.NumPoints~2) { v3ev2+1; while (v3<=Points .NumPoints-1) name of the wave for AstNamewave[j+4); find the of the wave in the WaveDescription IndexWave=FindWaveInNaveDescription (NameWave) ; if (WaveDescription[IndexWave] .NumWav 4 // create the object Wave=new Taves Wave .Nane-NameWlave; Wave.Tevel=level; Wave .Formula="2<-3-4>"; Wave.ValueVertex (0) = 0; Wave.ValueVertex(1) = 0; Wave.ValueVertex(2] = Points.ValuePoints[v2]; Wave.ValueVertex(3) = Points.ValuePoints [v3]; Wave.ValueVertex(4) = 0; Wave.ValueVertex (5) = 0; Wave. IndexVertex(0) = 0; Wave. IndexVertex[1) = IndexStart; Wave. IndexVertex(2] = Points. IndexPoints[v2]; Wave. IndexVertex(3] = Points. IndexPoints[v3]; alysis from the ListNameWave Wave. IndexVertex(4) = IndexFinish; Wave. IndexVertex (5) = 0; check the wave by the rules if (WaveRules (Nave) ==true) i if the wave passed the check for rules, add it to the waves tree ParentNoce=Node.. Add (NameWave, Wave) 7 1-2) create the second sub-wave in the waves tree ChildNode=ParentNode -Add (integerTostring (=)); if the interval of the chart, corresponding to second sub-wav if (ALready (Wave, I, Chi ldNode, WaveDescript ion (IndexWave] . Subwaves [T]) = NotstartedWaves (Wave, I, ChiidNode, WaveDescription {Indexilave] . Subway Hs create the third sub-wave in th waves t ChildNode=ParentNode Add (integerTostring (=); if the interval of the chart, LE (Already (Wave, 1, ChildNode, WaveDescription|[IndexWave] . Subwaves[I]) Finishedlaves (Nave, I, ChildNode, WaveDescription [IndexWave] .Subwave: responding to the third sub-wave, ret eate the fourth sub-wave in the waves tree ChildNode=ParentNode. Add (IntegerTostring(Z))z if the interval of the sub-wav Iitpsslwiwn.mel5.comiplartcles!2607print= 23159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: Lf (Already (Wave, I, ChildNode, WaveDescript ion[IndexWave] .Subwaves[I]) =4 NotFinishedNaves (Wave, I, ChildNode, WaveDescription[IndexWave] . Subwa he wave did release else delete Wave; and the incomplete waves with the formula "3<-4-5>" while (v3<=Boints.NunPoints-2) { vaev3t1s while (véc=Points.NumPoints-1) while (j<=i-1) ‘ Wx NameWave=ListNamewave (J+); 7 find the i £ tthe number of its IndexWiave~FindWaveInifaveDescript ion (NameWave) + LE (WaveDeseription [IndexWave] .Numilav ‘ name of the wave alysis from the ListNamewave ex of the wave in thi in order to pols and their names create the object of TWa new Twaves Wave.Nane-NameWave; Wave. Level=Level; Wave. Formala="3<-4-5>"} Wave.ValueVertex [0] = 0 Wave .ValueVertex(1) Wave.ValueVertex (2) = 0; Wave.ValueVertex[3] = Points.ValuePoints[v3]; Wave.ValueVertex(4) = Points.ValuePoints[v4]; Wave.ValueVertex [5] = 0; Wave. TndexVertex (0) = 0 Wave. IndexVertex(1)] = 0 Wave. IndexVertex [2] = Indexstart; Wave. IndexVertex(3] = Points. IndexPoints[v3]; Wave. IndexVertex[4] = Points. IndexPoints[v4]; ~ pazameters of Wave. IndexVertex (5) = IndexFinish; heck the wave for the rules if (WaveRules (Nave) ==true) i passed the check by the rules, add it to the waves trd ParentNode=Node . Add (NameWave, Wave: 183; third gub-wave in the waves tree ChildNode=ParentNode. Add (IntegerTostring(Z))z if the interval of the chart, corresponding to the third sub-wave Lf (Already (Wave, I, ChildNode, WaveDescription[IndexWave] . Subwaves(I]) NotStartedWaves (Wave, I, ChiidNode, WaveDescription | Indexiave] .Subwa ret create the fourth sub-wave in the waves tree ChildNode=ParentNode -Add(integerTostring (Z))+ // if the interval of the chart, Lf (Already (Wave, I, ChildNode, WaveDescript ion [IndexWave] . Subwaves [I] ) =» Finishedwaves (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwave: responding te the fourth sub-wav Tet cxeate t! h sub-wave in wat e ChildNode=ParentNode Add (integerrostring (=); if the interval of the chart, corresponding to the fifth wave, ha: if (ALready (Wave, I, Chi ldNode, RaveDescript ion [IndexWave] . Subwaves [1])= NotFinishedWaves (Wave, I, Chi ldNode, WaveDescr iption [IndexWave] . Subw > Iitpsslwiwn.mel5.comiplartcles!2607print= 24159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: , af the w neck by the else delete Wave; , vaav4e2; , v3av3+2; ) // find no less than three points on the price c nd put them in the s str ey were not found, then exit the funct if (PindPoints (3, IndexStart, IndexFinish, ValueStart, ValuePinish, Points)==false) returi // the loop of unbegun and unfinished waved with the formula " while (vl<=Boints.NunPoints-3) { vaevLt1s while (v2<=Points .NumPoints-2) v3ev2+1; while (v3<=Points .NumPoints-1) while Ge-i-1) ( / get the name of the wave for analysis from the ListNamen NameWave-ListNameWave (+417 find the index of the wave in the WaveDescription structure in IndexWave=FindWave InlaveDescription (NameWave} if (WaveDescription [Indextiave] .Numiave i 5) £ TWave c eate an ass and fill its Wave=new TWave; Wave. Name=NameWave; Wave .Level=Level, Wave. Formula="1<-2-3-4>"; Wave.ValueVertex[0] = 0; Wave.ValueVertex[1] = Points.ValuePoints [v1]; Wave.ValueVertex(2] = Points.ValuePoints [v2]; Wave. ValueVertex[3] = Points.ValuePoints [v3]; Wave.ValueVertex[4] = 0; Wave.ValueVertex[5] = 0; Wave. IndexVertex[0] = IndexStart; Points. IndexPoints [v1]; Nave. IndexVertex[2] = Points. IndexPoints [v2]; Wave. IndexVertex[3] = Points. IndexPoints [v3] ; Wave. IndexVertex[4] = IndexFinish; Wave. IndexVertex [5] = 0; check the wave by the rules if (WaveRules (Wave) =-true) ( Wave. IndexVertex 1] if the wave passed the check by t i it to the waves ParentNode=Node . Add (NameWlave, Wave) ¢ I=1; reate the first sub-wave in the tree ChildNode=ParentNode.Add(Integer"0String (I); if the interval of the chart, corresponding © sub-) Lf (Already (Wave, 1, ChildNode, WaveDescription [IndexWave] .Subwaves [I] NotStartedWaves (Wave, I, ChildNode, WaveDescription [IndexWave] . Sul Tet: // create the se: “wave in the waved tree ChildNode-ParentNode.Add (Integer7ostring (I)? Lf the interval of the chart, corresponding to the second sub- if (Already (Wave, I, ChildNode, WaveDescription [IndexWave] . Subwaves [T] FinishedNaves (Wave, I, Chi ldNode, WaveDescription [IndexWave] . Subw. Ist the third sub-wave in the waves arentNode..Add (Integer"oString(1))¢ nterval of the chart, corresponding to the third sub-w if (Already (Nave, I, ChildNode, WaveDescription [Indextave] . Subwaves [I) Iitpsslwiwn.mel5.comiplartcles!2607print= 25159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: FinishedNaves (Wave, I, ChildNode, WaveDescription [IndexWiave] . Subw. the fourth su arentNode .Add (Integer"oString(I))¢ // i the interval of the chart, corresponding to the fourth sub- if (Already (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwaves [I] NotFinisheddaves (Wave, I, ChildNode, WaveDescription [IndexWave] .S , // otherwise, if the wave no} y the rules, release the mem: else delete Nave; > v3ev3423 2424 loop of unbegun and unfinished waves with the formul: 34-59" while (v2<+Bointa.NumBointe-3) ( v3evat1s while (v3" he name of the wave for anal dstNameWave[3++]+ index of the wav ListNaneW. in the WaveDescription structure on order to kn ‘indWaveInliaveDescription (NaneWave) 7 if WaveDescription [IndexWave] .NumWave==5) { Wave=new Twave Wave .Names Wave.Level=Level; Wave.Formula="3<-4>" rameters of thi Wave.ValueVertex(0] = 0 Wave.ValueVertex[1] = 07 Wave.ValueVertex(2] = 0; Wave.ValueVertex(3] = Points.ValuePoints [v3]; Wave.ValueVertex(4] = 0; Wave.ValueVertex(5] = 0; Wave. IndexVertex{0] = 07 Wave. IndexVertex[i] = 0; Wave. IndexVertex(Z] = IndexStart; Wave. IndexVertex[3] = Points. IndexPoints [v3]; Wave. IndexVertex(4] = IndexFinish; Wave. IndexVertex(5] = 07 check the wave by the rule if (WaveRules (Wave) ==true) (i // if th @ passed the check by the rules, add it to the w. ParentNode=Node . Add (NameWlave, Wave) ; the third sub-wave in the waves tree arentNode .Add (IntegerToString(1)); interval of the chart, corresponding to the third sub- h if (Already (Wave, 1, ChildNode, HaveDescription [IndexWave] .Subwaves [1] ==fa NotStartedWaves (Wave, I, ChildNode, WaveDescription|Indexdave] .Subwaves Tet; create the fourth sub-wave in the waves tree arentNode Add (IntegerTostring(T))+ he ii 1 of the chart, corresponding to the fourth sub-wave, if (Already (Wave, 1, ChildNode, WaveDescription|IndexWave] . Subwaves [I] }==fa NotPinishedWaves (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwave: , otherwise, if the wave did not pass by the rules, release the memory else delete Wave; Iitpsslwiwn.mel5.comiplartcles!2607print= 30159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: £ unbegun and unfinished waves with the formula "4<-5>" vae0; while (v4<=Points.NunPoints-1) ‘ int while (j<=i-1) 4 // get the name of the wave for analysis from ListNameWlave NameWave=DistNaneWave(3++] 7 // find the index of the wave in the WaveDescription structure in order to kné ‘indWaveTnWiaveDescription (NaneWave) + if WaveDescription [IndexWave] .NumWave==5) { // create the object of Twave class and fil Wave=new TWave; Wave .Name=NameWave; Wave. Level=Level, Wave.Formula="4<-5>"; Wave.ValueVertex(0] = 07 Wave.ValueVertex [1] = 0; Wave.ValueVertex(2] = 0; Wave.ValueVertex(3] = 0; Wave.ValueVertex[4] = Points.ValuePoints [v4]; Wave.ValueVertex(5] = 0; Wave. IndexVertex [0] = 0; Wave. IndexVertex(1] = 0; Wave. IndexVertex(2] = 0; rameters of thi Wave. IndexVertex[3] = Indexstart; Wave. IndexVertex(4] = Points. IndexPoints [v4]; Wave. IndexVertex(5] = Indexinish; // check the wave by the rules if (WaveRules (Wave) ==true) ( (/ if the wave passed the check by the rules, add he waves tree ParentNode-Node -Add (NameWave, Wave) ; T=4; // create the fourth sub-wave in the waves ChildNode=ParentNode.Add (Integer"oString (I); // if the interval of the chart, >rresponding to the fourth sub-wave, Lf (Alzeady (Wave, I, ChildNode, HaveDescription|[IndexWave] .Subwaves [1])==fa Not StartedNaves (Wave, T,ChildNode, WaveDescription|Indexwave] .Subwaves et: // create the fifth sub-wave in the waves tree ChildNode=ParentNode.Add(Integer7oString (I)? // 4£ the interval of the chart, corresponding to the fifth sub-wave, h if (Already (Wave, 1, ChildNode, WaveDescript ion |[IndexWave] . Subwaves [T]}==f2 NotFinishedWaves (Wave, I, ChildNode, WaveDescript ion [IndexWave] . Subwave: ) // otherwise, if the wave did not pass by the rules, release the memory else delete Nave; void NotStartedWaves (TWave *ParentWave, int NumWave, TNode *Node, string Subwaves, int Lev a Iitpsslwiwn.mel5.comiplartcles!2607print= 31159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: int vl,v2,v3,v4,v5,17 Tpoints Points; TWode *ParentNode, *ChildNode; int IndexWave; string NameWave; TWave *Wave int is0,Pos=0,Start=0; Put the waves, string ListNameNave[ ArrayResize (ListNameWave, ArrayRange (WaveDescription,0)) 7 while (Pos!=StringLen (Subwaves)—1) ( Pos=StringFind(Subwaves,",", Start); NameWave=StrinySubstr(Subwaves, Start, Pos-Start); ListNameWave [i++] =NameNave; Start-Postl; ) int IndexStart=ParentWave. IndexVertex[NunWave-1]; int IndexFinish-Parentliave . IndexVertex [Numiiave] ; double ValueStart = ParentWave.ValueVertex(NunWave - 1]7 double ValueFinish~ ParentWave.ValueVertex(NumWlavel // find no less than two points on the price chart and py which we will be analyzing to the 1 into the struct £ we didn't find any, then exit the function if (PindPoints (2, Indexstart, IndexFinish, ValueStart, ValuePinish, Points)==false) retura; / j@ unbegun waves with the formula "4<-5" v5=Points.NumPoints-1; 5-1) while (v4>=0) while (j<-i-1) ( get the name of the wa NameWave=ListNameWave [j++]? / find che index of the wave in the WaveDescription structure i Indexifave=FindWaveInWaveDescription (NameWave) + if (WaveDescription [IndexWave] .NunWave==5) ‘ for analysis aneWiave create the t of class TWave an fields - parame! Wave=new TNave, Wave. Name=NaneWtav: Wave. Level=Level; Wave. Formula="4<-5", Wave.ValueVertex(0] = 07 Wave.ValueVertex[i] = 0; Wave.ValueVertex(2] = 0; Wave.ValueVertex(3] = 0; Wave.ValueVertex(4] = Points.ValuePoints [v4]; Wave.ValueVertex(5] = Points.ValuePoints[v5]; Wave. IndexVertex(0] = 0; Wave. IndexVertex(1] = 0; Wave. IndexVertex(2] = 0; Wave. IndexVertex(3] = Indexstart; Wave. IndexVertex(4] = Points. IndexPoints[v4]; Wave. IndexVertex[5] = Points. IndexPoints [v5]; check the wave by the rules Lf (WaveRules (Wave) ==true) ( if the wave passed the check by th ict ParentNode=Node. Add (Nameliave, Wave) ; I-4; create the fourth sub-wave in the wave tre ChildNode=ParentNode Add (TntegerToString (I); 1 of the chart, corresponding to the fourth sub-wave, H if (Already (Wave, 1, ChildNode, WaveDescription|IndexWave] .Subwaves [I] }==fa NotStartediaves (Wave, I, ChildNode, WaveDescription | IndexWave] .Subwaves Ts; Sth sub-wave in the waves tree arentNode .Add (IntegerToString(I))s Iitpsslwiwn.mel5.comiplartcles!2607print= 3269 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: if the ii 1 of the chart, corresponding to the fifth sub-wave, hd if (Already (Wave, 1, ChildNode, WaveDescription [IndexWave] .Subwaves [1] ==f2 FinishedNaves (Nave, I, ChildNode, WaveDescription [IndexWave] .Subwaves [T)] } sherwise, if the wave did not pass the check by the rules, release the else delete Wave; unbegun waves with the formula "2<-3 while (v2>=0) { int 0; while (j<=i-1) ( // in turn, from the ListNameWave, draw the name of the wave for analysis NameWiave=ListNameWave [3+]; find the index of the wave in the WaveDescription structure in order to IndexWave=FindWaveIndaveDescription (NamelWave) ; if WaveDescription [IndexWiave] .NumWave==3) { reate the of class Twave and £11 - parameters of thi Wave=new TWave; Wave. lameWave; Wave. Level=Level; Wave. 26-3"; Wave.ValueVertex(0] = 0; Wave.ValueVertex(1] = 0; Wave.ValueVertex[2] = Points.ValuePoints [v2]; Wave.ValueVertex(3] = Points.ValuePoints [v3]; Wave.ValueVertex(4] = 0; Wave.ValueVertex(5] = 0; Wave. IndexVertex(0] = 0; Wave. IndexVertex[1] = Indexstart; Wave. IndexVertex(2] = Points. IndexPoints[v2]; Wave. IndexVertex(3] = Points. IndexPoints[v3]; Wave. IndexVertex [4] = 0; Wave. IndexVertex(5] = 0; check the wave by the rule if (WaveRules (Wave) ( £ the wave passed the check e rules, add it to the waves tree ParentNode=Node . Add (Nameliave, Rave) 1 // create the second sub-wave in the waves tree childNode=ParentNode.Add (IntegerTostring (I)? // <£ he interval of the chart, corresponding to the second sub-wave, } Lf (Alzeady (Wave, I, ChildNode, WaveDescription[IndexWave] .Subwaves [I]) ==f2 NotStartedWaves (Wave, I, ChildNode, WaveDescription [Indexdave] .Subwaves Tes create childNode ‘ Af the inte he chart, cor: 9g to the third sub- Lf (Already (Wave, 1, ChildNode, WaveDescription [IndexWave] .Subwaves [I]} FinishedNaves (Nave, I, ChildNode, WaveDescription [IndexWave] . Subwaves [T]] , herwise, if the wave else delete Nave; not pas: e rules, release the memory less than three points on the price chart and put them into the we didn't find any, then exit the function if (FindPoints (3, Indexstart, IndexFinish, ValueStart, ValueFinish, Points) @ unbegun waves with the alse) returny| Iitpsslwiwn.mel5.comiplartcles!2607print= 33159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: v5=Points.NumPoints- vdave-1; while (v4>=1) 4-13 while (v3>=0) name of the wave AstNamewave [j++] x of the wave in the WaveDescription structure in order to ‘indWaveInWaveDescript ion (NameWave) ; Lf (WaveDescription|[IndexWave] .NumWave==5) ( / create the object Wave=new Taaves nalysis from ListNamelia lass TWave and fill its fields ~ parameters o ivalueVertex [0] Wave.ValueVertex (1) Wave.ValueVertex [2] = 0; Wave .ValueVertex(3) = Points.ValuePoints(v3]; Wave.ValueVertex [4] = Points.ValuePoints[v4]; Wave.ValueVertex[5] = Points.ValuePoints[v5]; Wave. IndexVertex[0) = 0; Wave. IndexVertex {1} = 0; Wave. IndexVertex(2) = IndexStart; Wave. IndexVertex(3] = Points. IndexPoints[v3]; Wave. IndexVertex [4] = Points. IndexPoints[v4]; Wave. IndexVertex[5] = Points. IndexPoints[v5]7 check the wav if (NaveRules (Wave i oF oF Af the wave passed the check by the " © the waves tr ParentNoce=Node . Add (NameWave, Wave) 7 1-3; // create the three sub-waves in the waves tree ChildNode=ParentNode.Add(integerTostring (=); Af the interval of the chart, corres, izd sub-wave,| if (Already (Wave, I, ChildNode, WaveDescription (IndexWave] . Subwaves(T]) NotstartedWaves (Have, I, ChiZdNode, WaveDescription{Indexiave] . Subway ret create the fourth sub-wave in the wal ChildNode=ParentNode Add (IntegerTostring @ fourth sub if (Already (dave, I, ChildNode, RaveDescript ion [IndexWave] .Subwaves [I]) =: Finishedwaves (Wave, T, Chi ldNode, WaveDescription [IndexWave] . Subwave: ret if the interval of the chart, v e fifth gub-wave in the waves tree ChildNode=ParentNode Add (IntegerTostring (Z))z if the interval of the chart, corresponding to the fifth s Lf (Already (Wave, I, ChildNode, WaveDescription|IndexWave] . Subwaves(I]) FinishedWaves (Wave, I, ChildNode, WaveDescription {IndexNave] . Subwave: } otherwise, if the wave did else delete Wave; ) pass by the cules, rele menory ) v3=v3-2; while (v2>=1) Iitpsslwiwn.mel5.comiplartcles!2607print= 24159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: vl=v2-1; while(v1>=0) ( while (j<#i-1) ‘ er name of the wave for analysis from 1éstNameWiave NaneWave=ListNametiave [++] find the ind x of the wave in the WaveDescription structure in order Indextiave=FindWaveInWlaveDescript ion (NameWave) if (WaveDescription|[IndexWave] .Numlave==3) ‘ / create Wave=new Twave; Wave .Name~NameWiave; wave. wave. Wave.ValueVertex [0] = 0; Wave.ValueVertex(1)] = Points.ValuePoints(v1]; Wave.ValueVertex[2] = Points.ValuePoints[v2]; Wave.ValueVertex[3] = Points.ValuePoints[v3]; Wave.ValueVertex[4) = 0; Wave.ValueVertex [5] = 0; Wave. IndexVertex(0) = IndexStart; Wave. IndexVertex[1] = Points.IndexPoints[v1]; Wave. IndexVertex[2] = Points.IndexPoints[v2]; Wave. IndexVertex(3] = Points. IndexPoints[v3]; Wave. IndexVertex[4) = 0 Wave. Indexvertex (5) check the wave by the rules if (WaveRules (Nave) ==true) i object © TWave and fill its fields — if the wave passed the check by the rules, add it to the waves tr ParentNode=Node . Add (NameWave, Wave: Tel; st eub-wave in the waves ChildNode=ParentNode Add (integerTostring(=))+ if the interval of the chart, corresponding to the first sub-wave, if (Al ready (Wave, T, Chi ldNode, WaveDescription | TndexWave] .Subwaves[T]) NotstartedWaves (Wave, I, ChiidNode, WaveDescription{ IndexWvave] . Subway itt ce the second sub-wave in the waves tree ChildNode=ParentNode.Add (integerTostring (Z))+ //if the interval of the chart, corresponding to the second sub-wave} LE (Already (Wave, I, ChildNode, WaveDescript ion [IndexWavel . Subwaves[T]) =" FinishedWaves (Nave, I, ChildNode, Wavebescription [IndexWave] . Subwave: ret cxeate the third sub-wave in the waves arentNode Add (IntegerTostring if the interval of the chart, corresponding to the third sub-wave,| LE (Already (Wave, I, ChildNode, WaveDescript ion [IndexWave] . Subwaves [1]) = FinishedWaves (Wave, I, ChildNode, WaveDescription (Indextiave] . Subwave: ) else delete Wave; e wave did n four the price chart and put them into the find any, then exit the function if (FindPoints (4, Indexstart, IndexFinish, Valuest: ‘the of unbegun ¥ with the formala ints .NumPoints- t,ValueFinish, Points) =false)returnj while (v4>=2) Iitpsslwiwn.mel5.comiplartcles!2607print= 35159 sa10a2019 v3ev4-1; while (v3>=1) vaav3-1) while (v2>=0) -1) un, from the Namevav Indexiav ndex new TWave; -Namo=NameWave; sLevel=Level; :Bormula="2<- ‘ValueVertex [0] Listw: dstNameWave(5++]7 n the WaveDescrips ‘indWave InllaveDescription (NaneWave) ; if (WaveDeseription [IndexWave] .Nuniave 5) 0; MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: ¢ the Wave.ValueVertex[1] = 0; Nave.ValueVertex[2] = Points.ValuePoints [v2]; Wave.ValueVertex[3] = Points.ValuePoints[v3) Wave.ValueVertex[4] = Points.ValuePoints [v4]; Wave.ValueVertex[5] = Points.ValuePoints [v5]; Wave. IndexVertex[0] = 0; Nave. IndexVertex{1] = IndexStart; Wave. IndexVertex[2] = Points. IndexPoints [v2] Wave. IndexVertex[3] = Points. IndexPoints[v3]; Wave. IndexVertex[4] = Points.IndexPoints [v4]; Wave. IndexVertex[5] = Points. IndexPoints [v5] check the wave by the rules if (WaveRules (Wave) ==true) ‘ // 4£ the wave passed the check by rules, add it to the waves ParentNode=Node. Add (NameWave, Wave) ; T=2; // create the second sub-wave in the waves tree ChildNode~ParentNode.Add (Integer7ostring (I)? u interval of the chart, ponding te the second sub- if (Already (Wave, I, ChildNode, WaveDescription [IndexWave] . Subwaves [T] NotStartedWaves (Nave, I, ChildNode, WaveDescription [IndexWave] . Sui st; wears chilawod tring (Z))¢ yi corresponding to the third sub-w Lf (Already (Wave, 1, ChildNode, WaveDescription [IndexWave] .Subwaves [I] FinishedNaves (Wave, I, Chi ldNode, WaveDescription [IndexWave] . Subw. Tet; create the fourth s arentNode .Add (Integer7oString(1))¢ rval of the chart, corresponding b-wave in the waves tree Fr arth Lf (Already (Nave, 1, ChildNode, WaveDeseription |[Indextave] . Subwaves [T) FinishedWaves (Wave, I, Chi idNode, WaveDescription [IndexWiave] . Subw: Ty fifth sub-wave in the arentNode .Add (Integer"oString(1))¢ nterval of the chart, ing to if (Already (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwaves [I] FinishedNaves (Wave, 1, Chi ldNode, WaveDescription [IndexWave] . Subw. ne rrespon he fifth sub-w herwise, if the wave has not passed the release emo: else delete Nave; ? , y2=v2-23 ) hitpslwwnzmel5.comvptlarcles/2607print= 36159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: find no less than five points on the price chart and record it into the structur // if we didn't find any, then exit the function if (FindPoints (5, Indexstart, IndexFinish, ValueStart, ValueFinish, Points)==false) return, the loop of unbegun waves with the formula "1 ° ints .NumPoints- vaev5-1; while (v4>=3) ( va-1i while (v3>=2) ( vaev3-1; while (v2>: 2-13 while (vi>=0) ( while (j" ( Iitpsslwiwn.mel5.comiplartcles!2607print= 38159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: the wave for ana! distNameWave [j++]; ‘index of the wav IndexWave=FindWaveInWaveDescription (Namelave) ; if ((WaveDescript ion [IndexWave] .Numlave: |) (WaveDescription (IndexWave] . Nut rom the ListNamel n the WaveDescription structure in order to knq Wave=new TWave; class and £11 fields - parameters of thi Wave. ValueVertex [0] Wave.ValueVertex(1] Wave .ValueVertex [2] Wave. ValueVertex 3] Wave .ValueVertex(4] Wave. ValueVertex [5] Wave. IndexVertex(0] = Points. IndexPoints[v0]; Wave. IndexVertex(1] = Polnts.IndexPoints[v1]; Wave. IndexVertex(2] = IndexFinish; Wave. IndexVertex(3] = 0; Wave. IndexVertex(4] = 0; Wave. IndexVertex(5] = 07 7 k the wave i Af (WaveRules (Wave) ‘ Points.ValuePoints [v0]; Points.ValuePoints [v1]? 0; 07 0; oF if the wave passed the check by the rules, add it to the waves tree ParentNode=Node. Add (NameWiave, Wave) 7 Tel; / create the first sub-wave in the waves tree ChildNode~ParentNode.Add (IntegerTostring (I)? // 4£ the interval of the chart, corresponding to the first sub-wa if (Already (Wave, 1, ChildNode, WaveDescription|IndexWave] . Subwaves [1])==fa FinishedNaves (Nave, I, ChildNode, WaveDescription [IndexWave] .Subwaves [I] Tet the second sub-wave in the waves t arentNode .Add (IntagerToString(1))s f the interval of the chart, corresponding to the second sub-wa Lf (Already (Wave, 1, ChildNode, HaveDescription [IndexWave] .Subwaves [I]) ==fa NotFinishedWaves (Wave, T, Chi ldNode, WaveDescript ion [Tndexitave] . Submave: , otherwise, if the wave did not pas: © rules, release the memor else delete Wave, ) , vlevi42; ) find no less than three points on the pr nd put it if none were found, then exit the funct: Lf (FindPoints (3, IndexStart, IndexFinish, ValueStart, ValueFinish, Points) u p of unfinished waves with the formula "1-2-3>" OF; while (vl<=Points.NumPoints-2) ‘ v2evit1s while (v2<-Points.NumPolnts-1) name of the wave for analysis from ListNameWave AstNamewave (J+); find the index of the wave in the Wa ption ue in order to Indextave=FindWaveInNaveDescription (NameWave) ; if ((WaveDescription[IndexWave] .NumWave==5) || (WaveDescription[IndexWave] .\ ( create the object of 7 Plaseyand) cla talrieldsltracaseteralee Wave=new Twave; Iitpsslwiwn.mel5.comiplartcles!2607print= 39159 sa10a2019 Iitpsslwiwn.mel5.comiplartcles!2607print= MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: Wave. wave. Wave. wave Wave. wave: wave. wave. wave. Name=NameWiave -Level=Level; Formula="1-2-35"; :ValueVertex[0] = Points.ValuePoints [v0]; -ValueVertex(1] = Points.valuePoints [vi]; -ValueVertex [2] = Points.ValuePoints[v2]; -ValueVertex[3] = 0; ValueVertex(4) = 0; iValueVertex[5] = 0, Wave. IndexVertex (0) Wave. IndexVertex (1) Wave. IndexVertex (2) Points. IndexPoints [v0]; Points. IndexPoints [v1]; Points. IndexPoints [v2]; Wave. IndexVertex(3] = IndexFinish; Wave. IndexVertex[4) = 0 Wave. IndexVertex (3) = 0; check the ¥ the rules if (WaveRules (Nave) ==true) i J Af the way ParentNode=Node . Add (NameWave, Wave: Ie1; passed the check by the r create the sub-wave ChildNode=ParentNode. Add (integerTostring(Z)); // if the inte of the chart, nave, Lf (Already (Wave, I, Chi ldNode, WaveDescription|IndexWave] .Subwaves [T])=" Finishedlaves (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwave: al onding to the first si itt create the second sub-wave in the waves tree ChildNede=ParentNode Add (integerTostring (2); /1 if hart, ding to Lf (Already (Wave, I, ChildNode, WaveDescript ion [IndexWavel . Subwaves [I] ) =» Finishedwaves (Wave, I, ChildNede, WaveDescription [IndexWave] . Subwave: the interval of the resp: sub-wav Hy cxeate the third sub-wave in the waves tree Chi ldNode=ParentNode.Add (7ntegerTostring (z)) if the interval of the chart, of the corresponding third sub-wave,| LE (Already (Wave, I, ChildNode, WaveDeseription [IndexWave] . Subwaves [1]) = NotFinishedNaves (Wave, I, Chi ldNode, WaveDescription [IndexWave] . Subw ) se, the release else delete Wave; find no less t on the price chart and r rd it then tart, hed waves with the were found, exit the funct /IndexFinish, ValueStart, ValueFinish, Points) false) returi Lf (FindPoints (4, Indexs! . OF; while (vl<=Pointa. NumPoints-3) ‘ v2ev1t1s while (v2<-Points .NumPoints-2) oints .NumPoints-1) // get the name of the wave f sis from ListNameWay NameWlave-ListNameWave(3++]7 find the index of the wave in WaveDeseription structure i to Indexitave=FindWaveInWaveDescription (NameWave) + if (WaveDescription [IndexWiave] .Nuniav 5) 40159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: i create the cbject of s and fil fields - parameters Wave=new TWave; Wave. Wave. Wave .Formula="1-2-3-4>"; Wave.ValueVertex[0] = Points.ValuePoints [v0]; Wave.ValueVertex|1] = Points.ValuePoints|v1]; Wave.ValueVertex[2] = Points.ValuePoints[v2]; Wave.ValueVertex[3] = Points.ValuePoints[v3] ; Wave.ValueVertex[4] = 0; Wave. ValueVertex(5] = 0; Wave. IndexVertex[0] = Points. IndexPoints [v0]; Nave. IndexVertex[1] = Points. IndexPoints [v1]; Wave. IndexVertex[2] = Points. IndexPoints [v2] Wave. IndexVertex[3] = Points. IndexPoints [v3]; Wave. IndexVertex[4] = IndexPinish; Wave. IndexVertex[5] = 0; // check the w: Lf (WaveRules (Wave) ==true) i if the wave passed the check ) add it to the wave ParentNodesNode. Add (NameWlave, Wave) ; 1 create the first sub-wave in the waves tree ChildNode~ParentNode Add (Integer"oString (I)? Lf the interval of the chart, corresponding to the first sub-wd if (Already (Wave, 1, ChildNode, WaveDescription [IndexWave] . Subwaves [I] FinishedNaves (Wave, I, ChildNode, WaveDescription [IndexWave] . Subw: et; reate the secon e waves arentNode .Add (Integer"oString(1))¢ of the chart, corresponding to the second sub-y Lf (Alzeady (Wave, I, ChildNode, WaveDeseription [IndexWave] .Subwaves [I] FinishedNaves (Wave, T, Ch‘ ldNode, WaveDescription[TndexWave] . Subw. et // create the third sub-wave in the wi tree ChildNode=ParentNode.Add (Integer"ostring (I)? Af the interval of the chart, corzesponding to the third aub-wd if (Al ready (Wave, T, Chi ldNode, WaveDescr ipt ion | Tndextave] . Subwaves [T)] FinishedNaves (Wave, I, Chi ldNode, WaveDescription|[IndexWave] . Subw: the fourth sub-wave in the waves tree arentNode .Add (Integer"oString (1))¢ // if the interval of the chart, corresponding to the fourth sub- if (Already (Wave, I, ChildNode, WaveDescription [IndexWave] .Subwaves [I] NotPLalshediiaves (Wave, I, ChildNode, WaveDeseription [IndexWave] .5| erwise, if the wave didn't pass by the 8, release the memo else delete Nave; / on the price chart and put them into the cure none were found, exit the function if (FindPoints (5, IndexStart, IndexFinish, ValueStart, ValueFinish, Points) ==false) returnj // the loop of unfinished waves with the formula "1-2-3-4-5>" while (vicePoints.NumPoints~4) ‘ 141s while (v2<=Points.NumPoints-3) ( Iitpsslwiwn.mel5.comiplartcles!2607print= 41159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: v3ev2+1, ‘oints .NumPoints-2) while (v4<=Points .NumPoints-1) ( ine j=0; wile (j<9i-1) ‘ get the name of the wave for analysis from ListNamewave NameWave=ListNametiave (j+#)7 the in If €kn x of the wav the Wi crip: ructure in ord IndexWave=FindWaveInWaveDescription (Namevave) 7 if (WaveDescription[IndexWave] .NumWlave==5) ( cre £ TWave class and fill its wave: wave. wave. Wave .Formula="1-2-3-4-5>"; Wave.ValueVertex[0] = Points.ValuePoints(v01; Wave.ValueVertex[1] = Points.ValuePoints[v1]; Wave.ValueVertex(2) = Points.ValuePoints[v2]; Wave.ValueVertex[3] = Points.ValuePoints[v3]; Wave.ValueVertex(4) = Points.ValuePoints(v4]? Wave.ValueVertex(5) = 0; Wave. IndexVertex [0] = Points.IndexPoints [v0]; Wave. IndexVertex[1] = Points. IndexPoints[v1]; Wave. IndexVertex[2] = Points.IndexPoints[v2]; Wave. IndexVertex(3) = Points. IndexPoints(v3]; Wave. IndexVertex[4] = Points.IndexPoints(v4]; Wave. IndexVertex(3] = IndexFinish; check the wave by the rules if (WaveRules (Wave) ==true) ‘ if the wave passed the check by the 8, add it to the wav ParentNode=Node . Add (NameWave, Wave) ; T-1; cxeate the first sub-wave in the waves ChildNode=ParentNode.Add (IntegerTostring(I))s if the inte the first su LE (Already (Wave, 1, ChildNode, WaveDeseription[IndexWave] . Subwave: FinishedWaves (Wave, I, ChildNode, WaveDescript ion [IndexWave] . tts // create the second sub-wave in the waves tree ChildNode=ParentNode Add (integerTostring(I))+ if the interval of the chart, corresponding to the second s if (Already (Wave, I, ChildNode, WaveDescription (IndexWave] . Subwave: Pinishedlaves (Wave, I, ChildNode, HaveDescript ion [IndexWave] . +t: ate the thi © in the ChildNode=ParentNode .Add (integesTostring (Z))7 // 3 the interval of the chart, corresponding to the third su if (Already (Wave, I, ChildNode, RaveDescription|[IndexWave] . Subwave: FinishedWaves (ave, I, ChildNode, WaveDescription [IndexWave] .5 ets reate the fourth sub-wave in the waves tre Chi ldNede-ParentNode Add (IntegerTostring (2) if the interv: responding to the f Lf (Already (wave, 1, Chi laNode, wavedescriptien Indextiavel =07i--) { ‘TNodeInfo *NodeInfo-NodeInfoArray.At (1); // if the required section has alre: Lf (NodeInfo.Subwaves==Subwaves 66 (NodeInfo.Valuestart=-Valuestart) 66 (NodeInfo.ValueFinish=-ValueFinish) && (NodeInfo. Indexstar (NodeInfo. IndexPinish==IndexFinish)) ( nave oz the group of waves been marked-up TWodeInfo *NodeInfo=new TNodeInfo; NodeInfo. IndexStart=IndexStart; NodeInfo. IndexFinish=IndexFinish; NodeInfo.ValueStart=ValueStart; NodeInfo.ValueFinish=ValueFinish; NodeInfo. Subwaves=Subwaves; NodeInfo.Node=Node; NodeInfoarray.Add (NodeInfo) + return (false); the search of the mazked~ Indexstart) && // add the child nodes of the found node into the child nodes of the new node for(int }=0; j0) ‘ Str=Short ToString (StringGetCharacter (Formula, Pos1-1)); FixedVertex[StringTornteger (Str) ]=1; FixedVertex[StringTolnteger (Str) -1]=0; Posi=StringTointeger (Str) +1; ) else Posl=0; int Pos2=StringFind(Formula,">"); if (P0s2>0) 1 Str=Short Tostring (StringGetCharacter (Formula, Pos2-1))+ FixedVertex[stringToInteger (Str) ]=0; Pos2=StringToInteger (Str) -17 ) else 1 Pos2=StringLen (Formula); Str=ShortTostring (StringGetCharacter (Formula, Pos2-1)); Pos2=StringToInteger (Str); ) for(int isPosli<=Pos2;i++) PixedVertex {i double High(],tow(1; ArrayResize (High, ArrayRange (rates, 0)); ArrayResize (Low, ArrayRange (rates, 0))j find the maximums and minimums for(int is: pers) ‘ Maximum[i]=rates [IndexVertex{i]]-high; Minimum[i]=rates [IndexVertex[i-1]].low; for(int j=IndexVertex{i-1];j<@IndexVertex(i] ( if (rates [j] -high>Maximum[i])Maximum[i]=rates (4) .highy if(zates(j] .low=0 && VertexAAboveVertexB (2,0, true)>=0 6 VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, true) >=0 66 VertexARhoveVertexB (3,1, false)>=0 && VertexAAboveVertexB(4,1,true)>=0 && VertexAAboveVertexB (3, 4,false)>=0 4& VertexAAboveVertexB (5,4, true) >=0 66 (WaveaMoreWiaves (3,1)>=0 || WaveaMoretaves (3,5)>=0)) Result=true; ates [IndexVertex(0]].low) || rates [IndexVertex(1]]-high) || rates [IndexVertex{2]].low) || ates [IndexVertex(3]]-high) || ates [IndexVertex(4]].1ow) | ates [IndexVertex(5]] -high)) ) else if (Wave.Nane: { ‘Leading Diagonal") Iitpsslwiwn.mel5.comiplartcles!2607print= 47859 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: if (VertexARboveVertexB (1,0, true)>=0 && VertexAAboveVertexB (2,0, true)>=0 66 VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, true) >=0 66 VertexAAboveVertexB(3,1,false)>=0 && VertexAAboveVertexB (4,2, crue) >=0 66 VertexAAboveVertexB(1,4,false)>=0 && VertexAaboveVertexB (3,4, false)>=0 4& VertexAAboveVertexB (5,4, true) (WaveaMoreWaveR (3,1}>=0 || WaveAMorelaveR (3,5)>=0)) Result=true; ) else if (Wave.Nam { Lf (VertexARboveVertexB (1,0, true)>=0 && VertexhAboveVertexB(2,0,true)>=0 && VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, true) VertexAAboveVertexB(3,1,false)>=0 a& VertexAAboveVertexB (4,2, crue) VertexAaboveVertexB (3,4, false)>=0 && VertexhAboveVertexB (5,4, crue) (WaveaMoreWaves (3,1)>=0 || WaveAMoretaves (3,5)>=0)) Result=true; Diagonal") ) else if (Wave.Nam { Lf (VertexARboveVertexB (1,0,true)>=0 && VertexAAboveVertexB(2,0,truc)>=0 6 VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, true) >=0 && VertexAAboveVertexB (3,1, false) > Result=true; Zigzag") ) else if (Wave.Nam ‘ Lf (VertexaRboveVertex3 (1,0, false)>=0 £6 VertexAAboveVertexB(1,2,faise)>=0 && VertexAAboveVertexB (3,2, true) Result=true; Flat") ) else if (Wave.Nane: 1 if (VertexaaboveVertexB(1,0,true)>=0 &% VertexAAboveVertexB (2,0, truc)>=0 &6 VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, true) >=0 66 VertexAaboveVertexB (3, 1, false) > Result=true; ‘Double Zigzag”) ) else if (Wave.Nam { Lf (VertexARboveVertexB (1,0,true)>=0 6% VertexAAboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, false) >=0) Result=true; ‘Double Three") ) else if (Wave.Nam { Lf (VertexARboveVertexB (1,0, true)>=0 && VertexAAboveVertexB (2,0, true)>=0 && VertexAaboveVertexB(1,2,false)>=0 && VertexAAboveVertexB (3,2, truc)>=0 66 VertexARhoveVertexB (3, 1, false)>=0 && VertexAAboveVertexB (5,3, false) && VertexhAboveVertexB(3,4,false)>=0 && VertexAAboveVertexB (5,4, true) >=0) Result=true; Teiple Zigzag") ) else if (Wave.Nane: 1 Lf (VertexABboveVertex8 (1,0, true)>=0 && VertexaaboveVertexB(1,2,false)>=0 4& VertexAAboveVertexB (3,2, false) VertexAAboveVertexB(3,4,false)>=0 && VertexAAboveVertexB (5,4, false) >=0) Result=true; ‘Triple Three") es ) else if (Wave.Nam { Lf (VertexARboveVertexB (1,0, false)>=0 && VertexAAboveVertexB(1,2,false)>=0 && Vert VertexhAboveVertexB(3,4,false)>=0 && VertexAAboveVertexB (5,4, false) >=0 6& WaveaMoreWaveB (2, 3 Ss WaveRMoreWaveB (3,4)>=0 ba WaveAVoreWaveR (4, 5)>=0) Result=true; ‘Contracting Triangle") ) else if (Wave.Nane ( Lf (VertexARhoveVertexB (1,0, false)>=0 && VertexAAboveVertexB(1,2,false)>=0 && Vert VertexAAboveVertexB(3,4,false)>=0 && VertexAAboveVertexB (5,4, false)>=0 65 ‘Expanding Triangle") hitpslwwnzmel5.comvptlarcles/2607print= 48/59 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: WaveaMoreWaveB(3,2)>=0 $& WaveAMoreHaveB (3, 2)>=0) return (Result) ; } po » 6.11. A funcdo VertexAAboveVertexB: Ms i/| The £ui //\ transferred as the parameters of the tion Vertex rtexB checks wheth ven function //| this check can be pe only if the tops A and B / is not £ and prime, while the t u" is fixed, while the top B ~ 4 i is not fixed and prime, and t int VertexAAboveVertexB (int A,int B,bool InternalPoints) ( double VA=0, VB=0, VC=0; int IA=0, 1 int Result=0; if (>=B) ‘ IA = A; IB = B; ) else if (Ac) 1 IA = B; IB = A; ) // if the internal points of the wave must be taken into consideration if (Internal Point: ‘ L£( (Trend 4 VAsMinimum [ZA]; IASTA-IA82; , else if( (Tren rue) "Up") €& ((TA82==0) || ((TA-IB: ) 6a (1882 m9) Down") && ( (IRE: imum [IA] 5 A-IAS27 else if( (Tren 4 VAsMaximum [A]; A (1-TA82)7 Up") Ge ((TAR2 Down") && (TAS2==1) || ((ZA-IB==1) && (IB82==1))) VA = ValueVertex(IAl; VB = ValueVertex(18]; ) if (ps) ‘ As Ar B= IB; ) else if (AB) Iitpsslwiwn.mel5.comiplartcles!2607print= 49159 1910372019, MALS Site/A Implementacdo da Andlse Aulomatica das Ondas de Eliott om MALS - Arigos MALS: 1B; TA; vA; VA = vB; VB = vc; ) if (((FixedVertex{A] ((PixedVertex [A] ((FixedVertex [A] ((PixedVertex [A] 1 if (( (Trends Result=1; else Result=. ) 65 (PixedVertex(B]==2)) I 0) (A & 2 == 0) G& (FixedVertex[B] 1) && (Fixedvertex(B] == 0) 6% (B 42 0) & (A 82 == 0) G& (FixedVertex(3] == 0) Ge (B s 2s) Up") && (VAD=VB)) || ((Trend=="Down") && (VAC=VB))) ) return (Result) ; ) St 6.12. A fungéo WaveAMoreWaveB: //| The function WaveAMoreWaveB ecks whether or not the wave A is larger than the wa //| transfered as the parameters of the given function 1 //| this check can be performed only if wave A - is compl //| and wave B - is incomplete or incomplete and unbeg WaveaMoreWaveB (int A, int B) int Result=0; double LengthWavel if (FixedVertex[R ‘ LengthWaveA=Mathabs (ValueVertex [A] -ValueVertex[A-1]) 7 if (FixedVertex(B]==1 && FixedVertex(B-1]==1) LengthWaveB=Mathabs (valueVertex [8] ~ else if(FixedVertex[B]=-1 &@ FixedVertex[B-1]==0) ( if (Trend= LengthWaveB=0; 46 FixedVertex[A-1] 1 && (FixedVertex[B]==1 || Fixedvertex(B-1 Up") LengthWaveB=NathAbs (ValueVertex[B]-Minimam(B]) else LengthWaves="athabs (ValueVertex [B]-Maxinum[3]); ' else if(FixedVertex[B]=-0 66 FixedVertex[B-1 ( ) if (Trend ‘Up") LengthWaveB=MathAbs (ValueVertex(B-1] -Minimum[B-1]) ; else LengthWaves=2athAbs (ValueVertex [B-1]-Maximum[3-1]) 7 : if (LengthWaveA>LengthWaveB) Result=1; else Result=-1; ) return (Result) ; } 6.13. A fungao ClearTree: 1s he fu ction of clearing the waves tree with the t i+ void Clearfree(INode *Node) 4 if (Check?ointer (Node) !=POINTER_INVALID) ‘ for(int is0; icNode.Child.Total ();i++) ClearTree (Node.child.at (i)) + delete Node.Child; Lf (CheckPainter (Node.Wave) !=POINTER INVALID) delete Node.Wave? delete Node; Iitpsslwwn.mel5.comiplartcles/2607print= 5059 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Eliott em MALS - Argos MLS: void ClearNodetnfoarray() 4 for(int isNedeInfearray. Total ()-1; 1>- ‘ ‘NodeInfo *NodeInfo=NodeInfoArray.At (1); Lf (CheckPointer (NodeInfo.Node) !=POINTER_TNVALTD) delete NodeInfo.Node; delete NodeInfo; ) NodeInfoArray.Clear() + } 6.15, A fungao ClearZigzagArray: ction of clearing the Zigzagarray ary 1s void Clearzigzagarray () 4 for(int i: 1 Taigzag *Zigzag~ZigzagArray.At (i); delete Zigzag. Indexvertex; delete Zigzag.ValueVertex; delete Zigzag; ) ZigzagArray.Clear(); } 0) ‘ Node *ChildNode=Node.child.Aat (0); // obvain the structure, in which the in ‘wave *Wave=ChildNede.Wave; string Texts // if there is a first Lf (Wave. ValueVertex[1]>0) 4 ‘ormation sbout he wave is stored // mazk the top according to the wave if Wave.Name=="Tmpulse" || Wave.Name=="Leading Diagonal" || Wave.Name=="Diagor Text: else if(Wave.Name=="Ziczag" || Wave.Name=="Flat" || Wave.Name expanding Tri ‘contracting Triangle" text: else if(Wave.Name=="Double Zigzag" || Wave.Name=="Double Three" || "Triple Zigzag" || Wave.Name=="Triple Three") Text: / obtain the ray of the Array0bj tops, which have the index Wave. In CarzayOb} *ArzayObj-Labelarray [Wave.IndexVertex[1]1; Iitpsslwiwn.mel5.comiplartcles!2607print= 51159 sa10a2019 Iitpsslwiwn.mel5.comiplartcles!2607print= MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: if (CheckPointer (ArrayObj)==POINTER_INVALID) ‘ ArrayObj=new CArrayOb}; LabelArray (Wave. IndexVertex(1)] ) // put the information abo ‘Thabel *Label=new TLabel; Label. Text=Text; Label. Level=Wave.Level; if (Wave. Level >LevelMax) LevelMax=Wave Level; Label. ValuesWave.ValueVertex{1]? ArrayObj .Add (Label) ; , LE (Wave. ValueVertex[2]>0) ( if Wave.Name=="Impulse" || Wave.Name: erayObs ; the index Wave. Indexv x{1] into "Leading Diagonal" || Wave.Name=="Diago: else if (Wave.Nam Zigzag" || Wave.Name=="Fiat" || Wave.Namé Expanding Tri: Wave Name=="Contracting Tziangle" "3" else if(Wave.Name=="Double Zigzag" || Wave-Name=="Double Three" || Wave . Name Text="x"7 CArzayOb} *hrzay0bj-LabelArray (Wave. IndexVertex [21]; if (CheckPointer (ArrayObj)==POINTER_INVALID) ‘ ArrayObj=new CArrayOb}; LabelArray (Wave. IndexVertex(2)] ) Thabel *Label=new TLabel; Label. Text=Tex! Label. Level=Wave. Level; if (Wave , Level>Leve1Max) LevelMax-HWave. Level; Label. Value=Wave. ValueVertex [2] ArrayObj .Add (abel); , LE (Wave. Valuevertex[3]>0) Triple Zigzag" || Wave.Name=="Triple Three" rray0l "Impulse" || Wave-Name=="Leading Diagonal" || Wave.Name=="Diago! Zigzag" || Wave.Name=="Flat" || expanding Triangle} else if (Wave.Nam Wave .Name Text="¥"; cArzayOb) *ArrayObj=LabelAarray (Wave. IndexVertex[3]]i if (CheckPointer (Array0bj)==POINTER_INVALID) ‘ ArrayObj=new CArrayOb}; LabelArray (Wave. IndexVertex [3] ]"ArrayObj ) Thabel *Label=new Thabel; Label. Text=Tex! Label .Level=Wave. Level; if (Wave. Leve1>Leve1Max) LevelMax-HWave Level; Label. Value=Wave..ValueVertex [317 Array0bj .Add (Label) ; , Lf (Wave Valuevertex[4]>0) ( Double Zigzag” || Wave.Name Triple Zigzag" || Wave.Nani if (Wave.Name=="Inpulse" || Wave-Name=="Leading Diagonal" || Wave.Name=="Diago! Text="i"7 else if (Wave.Name=="Expanding Triangle" || Wave.Name=="Contracting Triangle") Text="0"; else if(Wave.Name=="Triple zigzag" || Wave.Name=="Triple Three") Text="XX" 5 cArrayObj *ArrayObj=LabelAarray (Wave. IndexVertex[4]]; if (CheckPointer (ArrayObj)==POINTER_INVALID) 52159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: ‘ ArrayObj=new CArray0bj; LabelArray[Wave. IndexVertex (411 ) Thabel *Label=new TLabel; Label. Text=Text; Label .Level=Wave. Level; if (Wave. Level>LeveIMax) Leve lMax-HWave Level; Label. Value=Wave.ValueVertex [4] ArrayObj .Add (Label); , A (Wave.ValueVertex[5]>0) if (Wave.Name=="Impulse" || Wave Nam " Text: else if (Wave.Name=="Expanding Triangle" || Wave.Name=="Contracting Triangle") Text: else if(Wave.Name=="Triple Zigzag" || Wave.Name=="Triple Three") Text: CArrayObj *ArrayObj=LabelAarray (Wave. IndexVertex[5]]i if (CheckPointer (Array0bj)==POINTER_INVALID) { ArrayObj=new CArrayOb}; LabelArray (Wave. IndexVertex(5)] ) TLabel *Label-new TLabel; Label. Text=Text; Label. Level=Wave. Level; Lf (Wave. Level>LevelMax) LevelMax-HWave. Level; Label .Value=wave.ValueVertex (5] Array0bj Add (Label) ; .rrayOb: ceed the child nodes of the c for(int j=0;} Iitpsslwiwn.mel5.comiplartcles!2607print= 53159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: color Color; int Siz! if ((Level/3)8: i if(Text=="1") Text="i"; else if (Text == "2") Text else if (Text == "3") Text else if (Text == "4") Text else if (Text == "5") Text else if (Text == "A") Text else if (Text == "B") Text else if (Text == "C") Text else if (Text == "D") Text else if (Text == "E") Text else if (Text == "N") Text else if(Text=="X") Text="x"7 else if (Text == "XX") Text else if (Text == "Y") Text else if (Text == "2") Text : if (Level$3--2) ( color. Texts , ) if (Level$3-=0) Coler=Red; int Anchor; if (value ( for(int k-ArrayObj.Total ()~j-1;k>-07k--) Value=Value+15*PriceInPixels; Anchor=ANCHOR_UPPER; } else if (Value: 4 for(int. Valu Ancho: } CChartObjectText *0njText=new CChartObjectText; Obj Text Create (0, "wave"+integertostring(n) ,0, rates [1] .time, Value) ¢ ObjText Description (Text); Objfext .Color (Color); ObjText . Set Integer (OBJPROP_ANCHOR, Anchor) ; ObjText .FontSize (8); Obj Text. Selectable (true); ObjTextArray Add (ObjText) z ates [1] .high) ates[i] low) rrayObj.Total ()~J-1;% jalue-15*PriceInPixels; NCHOR_LOWER; , ) chartRedraw()+ , 6.18, A funcao CorrectLabel: ectLabel function void CorrectLabel (} ( double PriceMax=chartGetDouble (0,CHART PRICE MAX, 0); Iitpsslwiwn.mel5.comiplartcles!2607print= 1910372019, Maus la /A Implementagao da Anélse Aulomatica das Ondas de Eliott om MALS - Arigos MALS double PriceMin = ChartGetDoubie (0, CHART_PRICE_MIN) + int WindowHeight=ChartGetiInteger (0,CHART HEIGHT IN PIXELS); double CurrentPriceInPixels=(PriceMax-PriceMin) /Windowieight; loop all of the text objects (wave tops) and change their pril for(int i=0;i=PriceValue) ( offset InPixels=(rates [4] .low-PriceValue) /PriceInPixels; objText .Price (0, rates [3] . low-OffsetInPixels*Current2riceInPixels); , else if(rates[j] -high<=Pricevalue) ( offset InPixels=(PriceValue-rates 4) high) /PriceInPixel: ObjText . Price (0, rates[3] -nightOZfsetInPixels*CurrentPriceInPixels); } ) PriceInPixels=CurrentPriceInPixels; , 7. A fungao de inicializacao, de provisionamento e processamento de eventos Na fungao Oninit, os botdes de controle do analisador das Ondas de Elliott automatico sao criados. Os seguintes botdes sao criados: 41. "Comecar Anélise” - uma analise automatica das ondas ocorre 2. "Mostrar resultados” - a exibicao das marcas de onda no grafico ocorre, 3. "Limpar grafico” - uma limpeza da meméria e a excluséo das marcas de onda a partir do grafico ocorre, 4. “Corrigir as marcas” - corrige as marcas das ondas no grafico. © processamento de pressionamento desses botdes tem lugar na funcéo de processamento de eventos OnChartEvent. Na funcao OnDeinit, todos os objetos graficos so removidos a partir do grafico, incluindo os botdes de controle. Hinclude finclude #include finclude Hinclude finclude finclude Finclude finclude include CChartobjectButton *ButtonStart, *ButtonShow, *ButtonClear, *ButtonCorrect; int State; ontrol buttons hitpslwwnzmel5.comvptlarcles/2607print= 58159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: ButtonStartenew CChartObjectButton; ButtonStart.create(0,"Begin analysis", 0, 0,0, 150,20); ButtonStart .Description("Begin analysis" ButtonShow=new CChartobjectButton; ButtonShow.Create(0,"Show results", 0,150/0, 150,20) ¢ ButtonShow.Description ("Show results"); ButtonClear=new CChartObjectButton; ButtonClear.Create(0, "Clear chart", 0,300,0,150,20)¢ ButtonClear.Description("Clear chart"); ButtonCorrect=new CChartobjectButton; ButtonCorrect .Create(0, "Correct the marks", 0,450, 0,150, 20 ButtonCorrect .Description("Correct the marks"); ChartRedraw()7 return (0); void OnDeinit (const int reason) ( Cleartree (Fir clear NodeInfoArray CleazNodeInfoarzay (); ClearZigzagarray (); //clear Labelar for(int i=0;ichrrayRange (LabelArray, 0) 7i++) { cArrayObj *ArrayObj=LabelArray (ils if (CheckPointex (ArrayOb}) !=POINTER_INVALID) ( for(int j=0;j=0/i { CchartobjectText *ObjText=objTextArray.At (i); delete ObjText; ) ObjTextArzay.Clear(); delete Buttonstart; delete Buttenshow; delete ButtonClear; delete ButtonCorrect; ChartRedraw()+ , MglRates rates(]; aphical elements from the chart int id, long élparam, double édparam, string &sparam) ( if (id==CHARTEVENT_OBJECT_CLICK && spara MessageBox ("First press the button \" if (id-=CHARTEVENT OBJECT CLICK && sparam=="Show results" && State!=1) MessageBox("First press the button \"Begin analysis\""); if (ide=CHARTEVENT OBJECT CLICK && sparame="Clear chart" €& State!=2) "Begin analysis" 6& State ‘ear char\""); Iitpsslwiwn.mel5.comiplartcles!2607print= sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: MessageBox ("First press the button \" if (id==CHARTEVENT OBJECT _CLICK && spara MessageBox ("First press the button \" show results\""); "Correct the mark" && State how results\""); /if the "Begin analysis" is pressed if (id==CHARTEVENT_OBJECT_CLICK && sparam=="Begin analysis" && Stat ‘ fill the rates array CopyRates (NULL, 0,0,Bars (_Symbol, Period), rates); /fill the array 2igzagArray FillzigzagArray (0, Sars (_Symbol, _Period)-1)7 reate the first node Twave *Wave=new Twave; Wave. IndexVertex(0] = 0; Wave. IndexVertex[1] = Sars( symbol, Period)-1; Wave.ValueVertex(0] = 0; Wave.ValueVertex(1] = 07 FirstNode=new TNode; FirstNode.Child-new CArrayobj; FirstNode.Wav FirstNode.Text="First node"; string NameWaves="Inpulse, Leading Diagonal, Diagonal, Zigzag, Flat, Double Zigzag, Tr: Double Three, Triple Three,Contracting Triangle, =xpanding tri: h for unbeg NotStartedAndNot FinishedWaves (Wave, 1, FirstNode, NameWaves, 0) ; MessageBox ("Analysis is complete") States1; ButtonStart.state (false); ChartRedraw() 5 ean eres n and incomplete waves function show results" is if (ide=CHARTEVENT OBJECT CLICK && sparam=="Show results" @& State==1) 1 ArrayResize (LabelArray, ArrayRange (rates, 0))7 /fill the labelArray array FillLabelArray (FirstNode) ; /show the mark-up of the waves on the chart Createbabels(); State=2; Buttonshow. State (false); ChartRedraw(); if "Clear cl sedi CHARTEVENT_OBJECT_CLICK 6 sparat "Clear chart" 6& State the waves tree ClearTree (FirstNode) ; clear the NodeInfoArray array CleazNodeInfoarray (); /cleaz the Z CleargigzagArray(); /eleaz LabelArra for(int i=0;i=074 ( Iitpsslwiwn.mel5.comiplartcles!2607print= 57189 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: CChartobjectText *ObjText=ObjTextArray.At (i); objText Delete (); , objfextArray.Clear (); Stat ButtonClear. State (false); ChartRedraw() 7 "Correct the marks" 6& State Lf (id-=CHARTEVENT OBJECT CLICK 6& sparal CorrectLabel (); ButtonCorrect..State (false); ChartRedraw() ) Revimos todas as fungdes do analisador automatico das Ondas de Elliott. 8. Formas de melhorar o programa 0 mark-up automatico do programa de Ondas Elliott, escrito em MQL5, tem varias deficiéncias: 1. Um sistema imperfeito para verificar as regras de marcagao. Por exemplo, ao verificar as regras, as relacoes de Fibonacci entre as ondas nao sao levadas em conta, de acordo com ambos, tempo e preco. 2. Apresenca de seces nao particionadas no grafico (falhas na marcacao). Isto significa que uma onda correta nao pode ser construida com base nos pontos tomados a partir do intervalo de tempo determinado. A saida desta situacao ¢ aumentar o niimero de pontos a fim de identificar uma onda particular. Por exemplo, para encontrar 0 impulso, procure por 8 ou mais pontos, ao invés de 6 pontos. 3. 0 resultados da marcacao nao exibem qualquer informacao adicional, por exemplo, os canais nao sa0 construidos automaticamente, as metas nao sao avaliadas, etc 4, A implementacao do trabalho com a arvore de ondas nao é fornecida neste artigo (vocé nao pode selecionar uma versao especifica do markup), para isso, 0 grafico mostra apenas uma das muitas op¢des para um markup (a primeira verséo do markup). 5. Independentemente do fato de que o grafico mostre uma tinica variante das ondas, todas as outras opcées sao armazenadas na meméria e ocupam seu espaco. 6. 0 programa foca no mark-up de graficos Mensais para Diarios, como a operacao é muito lenta, quando ha um grande numero de barras (pode levar horas para fazer um mark-up em um grafico de hora em hora). Um exemplo de um mark-up de um grafico mensal de EURUSD ¢ mostrado na Figura 18. hitps:iwwnzmel5.comvptlarcles/2607print= 58159 sa10a2019 MALS Sita/A implementagao da Anélse Automatica das Ondas de Elio em MALS - Argos MALS: Begin analysis ‘Show results (Clear chat Correct the marks: Joven 8] 1.66360 1.50300 134400 126410 i if me gl \ 6 ‘| il : 120880 My ” jl i Py tl ‘ fi 88 ee = PRT Ne TMD ora AB As Ondas de Ello, identiendas pelo araisadorautematcoem MGS Conclusao Este artigo analisou um algoritmo de anélise automatica das Ondas de Elliott. Este algoritmo fot implementado na linguagem MQLS. O programa tem uma série de deficiéncias, discutidas acima, e dé razao para sua posterior eliminagao. Espero que esta questao interesse aos fas das Ondas de Elliott e, em breve, aparecam muitos programas com a andlise automatica das ondas. hitpslwwnzmel5.convptlarcles!2607print= 59159

Você também pode gostar