Skip to content

Commit a80ccb0

Browse files
author
olivier.henley
committed
update test
1 parent 05f50a0 commit a80ccb0

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

tests/test.adb

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,50 @@
11
with Ada.text_io; use Ada.Text_IO;
22

33
with ib_ada;
4-
with ib_ada.conn;
4+
with ib_ada.connection;
55
with ib_ada.communication;
66

77

88
procedure test is
9+
resp : ib_ada.communication.resp_type;
10+
use ib_ada;
11+
begin
912

10-
request_id : integer;
13+
ib_ada.connection.client.setup(ib_ada.IB_PAPER);
1114

12-
begin
15+
resp := ib_ada.communication.handshake;
16+
put_line(+resp.message);
1317

14-
ib_ada.conn.client.setup(ib_ada.IB_PAPER);
18+
resp := ib_ada.communication.start_api;
19+
put_line(+resp.message);
1520

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);
1823

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);
2626

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);
3029

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);
3235

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);
3341

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);
3547

36-
ib_ada.conn.client.disconnect;
48+
ib_ada.connection.client.disconnect;
3749

3850
end test;

0 commit comments

Comments
 (0)