Rev 796 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 796 | Rev 797 | ||
|---|---|---|---|
| Line 57... | Line 57... | ||
| 57 | 57 | ||
| 58 | writer.write("data;hora;open;high;low;close;volume;wap;count"); |
58 | writer.write("data;hora;open;high;low;close;volume;wap;count"); |
| 59 | writer.newLine(); |
59 | writer.newLine(); |
| 60 | 60 | ||
| 61 | CompletableFuture<List<Bar>> fut = ibkr.prepararFutureHistorico(reqId); |
61 | CompletableFuture<List<Bar>> fut = ibkr.prepararFutureHistorico(reqId); |
| 62 | - | ||
| - | 62 | /*
|
|
| 63 | ibkr.getClient().reqHistoricalData( |
63 | ibkr.getClient().reqHistoricalData(
|
| 64 | reqId, |
64 | reqId,
|
| 65 | contract, |
65 | contract,
|
| 66 | endDateTime, |
66 | endDateTime,
|
| 67 | durationStr, |
67 | durationStr,
|
| Line 70... | Line 70... | ||
| 70 | 1,
|
70 | 1,
|
| 71 | 2,
|
71 | 2,
|
| 72 | false,
|
72 | false,
|
| 73 | (List<TagValue>) null |
73 | (List<TagValue>) null
|
| 74 | ); |
74 | );
|
| - | 75 | */
|
|
| - | 76 | ||
| - | 77 | ibkr.getClient().reqHistoricalData( |
|
| - | 78 | reqId, |
|
| - | 79 | contract, |
|
| - | 80 | endDateTime, |
|
| - | 81 | durationStr, |
|
| - | 82 | barSizeSetting, |
|
| - | 83 | "MIDPOINT", // <-- para FX |
|
| - | 84 | 1,
|
|
| - | 85 | 2,
|
|
| - | 86 | false,
|
|
| - | 87 | null
|
|
| - | 88 | ); |
|
| - | 89 | ||
| - | 90 | ||
| 75 | 91 | ||
| 76 | List<Bar> bars = fut.get(60, TimeUnit.SECONDS); |
92 | List<Bar> bars = fut.get(60, TimeUnit.SECONDS); |
| 77 | 93 | ||
| 78 | ZoneId zoneId = ZoneId.of("America/Maceio"); |
94 | ZoneId zoneId = ZoneId.of("America/Maceio"); |
| 79 | DateTimeFormatter FMT_DATA = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
95 | DateTimeFormatter FMT_DATA = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |