Subversion Repositories Integrator Subversion

Rev

Rev 770 | Rev 776 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 770 Rev 773
Line 42... Line 42...
42
            // só interessa padrão completo até G3
42
            // só interessa padrão completo até G3
43
            if (ref == null || g2 == null || g3 == null) {
43
            if (ref == null || g2 == null || g3 == null) {
44
                continue;
44
                continue;
45
            }
45
            }
46
46
47
            if (ref.isCandleComprador()) {
-
 
48
                // GR comprador -> operação VENDIDA
-
 
-
 
47
            if (g3.isCandleVendedor()) {
-
 
48
                // G3 vendedor -> operação VENDIDA
49
                SinalTradeGatilho3 sinal = montarSinalVenda(ref, g1, g2, g3, p);
49
                SinalTradeGatilho3 sinal = montarSinalVenda(ref, g1, g2, g3, p);
50
                if (sinal != null) {
50
                if (sinal != null) {
51
                    sinais.add(sinal);
51
                    sinais.add(sinal);
52
                }
52
                }
53
            } else if (ref.isCandleVendedor()) {
-
 
54
                // GR vendedor -> operação COMPRADA
-
 
-
 
53
            } else if (g3.isCandleComprador()) {
-
 
54
                // G3 comprador -> operação COMPRADA
55
                SinalTradeGatilho3 sinal = montarSinalCompra(ref, g1, g2, g3, p);
55
                SinalTradeGatilho3 sinal = montarSinalCompra(ref, g1, g2, g3, p);
56
                if (sinal != null) {
56
                if (sinal != null) {
57
                    sinais.add(sinal);
57
                    sinais.add(sinal);
58
                }
58
                }
59
            }
59
            }
Line 81... Line 81...
81
        BigDecimal base0   = topoG3;
81
        BigDecimal base0   = topoG3;
82
        BigDecimal base100 = fundoG2;
82
        BigDecimal base100 = fundoG2;
83
83
84
        BigDecimal entrada1 = nivelFibo(base0, base100, 50.0);    // 50%
84
        BigDecimal entrada1 = nivelFibo(base0, base100, 50.0);    // 50%
85
        BigDecimal entrada2 = nivelFibo(base0, base100, 25.0);    // 25%
85
        BigDecimal entrada2 = nivelFibo(base0, base100, 25.0);    // 25%
86
        BigDecimal alvo1    = nivelFibo(base0, base100, 123.6);   // 123,6%
-
 
87
        BigDecimal alvo2    = nivelFibo(base0, base100, 300.0);   // 300%
-
 
-
 
86
        BigDecimal alvo1    = nivelFibo(base0, base100, 100.0);   // 100%
-
 
87
        BigDecimal alvo2    = nivelFibo(base0, base100, 123.6);   // 123,6%
88
        BigDecimal stopFib  = nivelFibo(base0, base100, -100.0);  // -100%
88
        BigDecimal stopFib  = nivelFibo(base0, base100, -100.0);  // -100%
89
89
90
        // Stop alternativo: 25% acima do último fundo relevante (aqui uso fundo de G2)
90
        // Stop alternativo: 25% acima do último fundo relevante (aqui uso fundo de G2)
91
        BigDecimal stopAlt = fundoG2.add(
91
        BigDecimal stopAlt = fundoG2.add(
92
                topoG3.subtract(fundoG2).multiply(BigDecimal.valueOf(0.25))
92
                topoG3.subtract(fundoG2).multiply(BigDecimal.valueOf(0.25))
Line 132... Line 132...
132
        BigDecimal base0   = fundoG3;
132
        BigDecimal base0   = fundoG3;
133
        BigDecimal base100 = topoG2;
133
        BigDecimal base100 = topoG2;
134
134
135
        BigDecimal entrada1 = nivelFibo(base0, base100, 50.0);    // 50%
135
        BigDecimal entrada1 = nivelFibo(base0, base100, 50.0);    // 50%
136
        BigDecimal entrada2 = nivelFibo(base0, base100, 25.0);    // 25%
136
        BigDecimal entrada2 = nivelFibo(base0, base100, 25.0);    // 25%
137
        BigDecimal alvo1    = nivelFibo(base0, base100, 123.6);   // 123,6%
-
 
138
        BigDecimal alvo2    = nivelFibo(base0, base100, 300.0);   // 300%
-
 
-
 
137
        BigDecimal alvo1    = nivelFibo(base0, base100, 100.0);   // 100%
-
 
138
        BigDecimal alvo2    = nivelFibo(base0, base100, 123.6);   // 123,6%
139
        BigDecimal stopFib  = nivelFibo(base0, base100, -100.0);  // -100%
139
        BigDecimal stopFib  = nivelFibo(base0, base100, -100.0);  // -100%
140
140
141
        // Stop alternativo: 25% abaixo do último topo relevante (aqui uso topo de G2)
141
        // Stop alternativo: 25% abaixo do último topo relevante (aqui uso topo de G2)
142
        BigDecimal stopAlt = topoG2.subtract(
142
        BigDecimal stopAlt = topoG2.subtract(
143
                topoG2.subtract(fundoG3).multiply(BigDecimal.valueOf(0.25))
143
                topoG2.subtract(fundoG3).multiply(BigDecimal.valueOf(0.25))