Subversion Repositories Integrator Subversion

Rev

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

Rev 795 Rev 796
Line 9... Line 9...
9
public class IbkrMapper {
9
public class IbkrMapper {
10
10
11
    /**
11
    /**
12
     * Exemplo para AÇÃO negociada na B3.
12
     * Exemplo para AÇÃO negociada na B3.
13
     */
13
     */
14
        public static Contract contratoAcaoBrasil(String symbol) {
-
 
-
 
14
        public static Contract contratoAcaoBrasil2(String symbol) {
15
            Contract c = new Contract();
15
            Contract c = new Contract();
16
            c.symbol(symbol);          // "PETR4", "VALE3", etc.
16
            c.symbol(symbol);          // "PETR4", "VALE3", etc.
17
            c.secType("STK");
17
            c.secType("STK");
18
            c.currency("BRL");
18
            c.currency("BRL");
19
19
Line 21... Line 21...
21
            c.exchange("SMART");       // roteamento inteligente
21
            c.exchange("SMART");       // roteamento inteligente
22
            c.primaryExch("BVMF");     // B3
22
            c.primaryExch("BVMF");     // B3
23
23
24
            return c;
24
            return c;
25
        }
25
        }
-
 
26
       
-
 
27
        public static Contract contratoAcaoBrasil(String symbol) {
-
 
28
            Contract c = new Contract();
-
 
29
            c.symbol(symbol);
-
 
30
            c.secType("STK");
-
 
31
            c.currency("BRL");
-
 
32
            c.exchange("B3");      // teste direto BVMF
-
 
33
            // c.primaryExch("BVMF"); // teste com e sem
-
 
34
            return c;
-
 
35
        }
-
 
36
26
37
27
    /**
38
    /**
28
     * Exemplo para FUTURO de índice (mini índice, etc.).
39
     * Exemplo para FUTURO de índice (mini índice, etc.).
29
     * Ajuste localSymbol/lastTradeDateOrContractMonth conforme a IBKR.
40
     * Ajuste localSymbol/lastTradeDateOrContractMonth conforme a IBKR.
30
     */
41
     */
31
    public static Contract contratoFuturoIndice(String localSymbol) {
42
    public static Contract contratoFuturoIndice(String localSymbol) {
32
        Contract c = new Contract();
43
        Contract c = new Contract();
33
        c.localSymbol(localSymbol); // ex: "WINZ25" (ajustar ao formato usado pela IBKR)
44
        c.localSymbol(localSymbol); // ex: "WINZ25" (ajustar ao formato usado pela IBKR)
34
        c.secType("FUT");
45
        c.secType("FUT");
35
        c.currency("BRL");
46
        c.currency("BRL");
36
        c.exchange("BMFBOVESPA");
-
 
-
 
47
        c.exchange("B3");
-
 
48
//        c.exchange("BMFBOVESPA");
37
        return c;
49
        return c;
38
    }
50
    }
39
   
51
   
40
    public static Contract contratoAcaoUSA(String symbol) {
52
    public static Contract contratoAcaoUSA(String symbol) {
41
        Contract c = new Contract();
53
        Contract c = new Contract();