|
1 | 1 | with Ada.text_io; use Ada.Text_IO;
|
2 | 2 |
|
3 | 3 | with ib_ada;
|
4 |
| -with ib_ada.conn; |
| 4 | +with ib_ada.connection; |
5 | 5 | with ib_ada.communication;
|
6 | 6 |
|
7 | 7 |
|
8 | 8 | procedure test is
|
| 9 | + resp : ib_ada.communication.resp_type; |
| 10 | + use ib_ada; |
| 11 | +begin |
9 | 12 |
|
10 |
| - request_id : integer; |
| 13 | + ib_ada.connection.client.setup(ib_ada.IB_PAPER); |
11 | 14 |
|
12 |
| -begin |
| 15 | + resp := ib_ada.communication.handshake; |
| 16 | + put_line(+resp.message); |
13 | 17 |
|
14 |
| - ib_ada.conn.client.setup(ib_ada.IB_PAPER); |
| 18 | + resp := ib_ada.communication.start_api; |
| 19 | + put_line(+resp.message); |
15 | 20 |
|
16 |
| - ib_ada.communication.handshake; |
17 |
| - ib_ada.communication.start_api; |
| 21 | + resp := ib_ada.communication.accounts_summary (ib_ada.BUYING_POWER); |
| 22 | + put_line(+resp.message); |
18 | 23 |
|
19 |
| - -- ib_ada.communication.pnl ("DU3689337", 265598); -- AAPL |
20 |
| - -- ib_ada.communication.account_summary (ib_ada.BUYING_POWER); |
21 |
| - -- ib_ada.communication.positions; |
22 |
| - -- |
23 |
| - -- request_id := ib_ada.communication.buy_order ("QS", 10, ib_ada.MIDPRICE); |
24 |
| - -- |
25 |
| - ib_ada.communication.open_orders; |
| 24 | + resp := ib_ada.communication.positions; |
| 25 | + put_line(+resp.message); |
26 | 26 |
|
27 |
| - --ib_ada.communication.cancel_order (278); |
28 |
| - --ib_ada.communication.cancel_order (275); |
29 |
| - --ib_ada.communication.cancel_order (284); |
| 27 | + resp := ib_ada.communication.profits_and_losses; |
| 28 | + put_line(+resp.message); |
30 | 29 |
|
31 |
| - --ib_ada.communication.cancel_order (request_id); |
| 30 | +-- resp := ib_ada.communication.place_order (side => BUY, |
| 31 | +-- symbol => "IBM", |
| 32 | +-- quantity => 10, |
| 33 | +-- at_price_type => MKT); |
| 34 | +-- put_line(+resp.message); |
32 | 35 |
|
| 36 | +-- resp := ib_ada.communication.cancel_order (resp.req_number); |
| 37 | +-- put_line(+resp.message); |
| 38 | +-- |
| 39 | +-- resp := ib_ada.communication.open_orders; |
| 40 | +-- put_line(+resp.message); |
33 | 41 |
|
34 |
| - --ib_ada.comminucation.sell ("AAPL", 10, ib_ada.MKT); |
| 42 | +-- resp := ib_ada.communication.place_order (side => SELL, |
| 43 | +-- symbol => "IBM", |
| 44 | +-- quantity => 10, |
| 45 | +-- at_price_type => MKT); |
| 46 | +-- put_line(+resp.message); |
35 | 47 |
|
36 |
| - ib_ada.conn.client.disconnect; |
| 48 | + ib_ada.connection.client.disconnect; |
37 | 49 |
|
38 | 50 | end test;
|
0 commit comments