futucli/cmd/proto_json/
trd_commands.rs1use anyhow::Result;
6
7use crate::output::OutputFormat;
8
9use super::contract::parse_c2s;
10use super::transport::{ensure_success, print_proto_response, send_proto};
11
12qot_proto_json_command!(
13 run_preview_order_impact,
14 "preview-order-impact",
15 futu_core::proto_id::TRD_PREVIEW_ORDER_IMPACT,
16 trd_preview_order_impact
17);
18qot_proto_json_command!(
19 run_asset_trend,
20 "get-asset-trend",
21 futu_core::proto_id::TRD_GET_ASSET_TREND,
22 trd_get_asset_trend
23);
24qot_proto_json_command!(
25 run_yield_trend,
26 "get-yield-trend",
27 futu_core::proto_id::TRD_GET_YIELD_TREND,
28 trd_get_yield_trend
29);
30qot_proto_json_command!(
31 run_return_calendar,
32 "get-return-calendar",
33 futu_core::proto_id::TRD_GET_RETURN_CALENDAR,
34 trd_get_return_calendar
35);
36qot_proto_json_command!(
37 run_order_relations,
38 "get-order-relations",
39 futu_core::proto_id::TRD_GET_ORDER_RELATIONS,
40 trd_get_order_relations
41);
42qot_proto_json_command!(
43 run_position_corporate_actions,
44 "get-position-corporate-actions",
45 futu_core::proto_id::TRD_GET_POSITION_CORPORATE_ACTIONS,
46 trd_get_position_corporate_actions
47);
48qot_proto_json_command!(
49 run_place_order_group,
50 "place-order-group",
51 futu_core::proto_id::TRD_PLACE_ORDER_GROUP,
52 trd_place_order_group
53);
54qot_proto_json_command!(
55 run_modify_order_group,
56 "modify-order-group",
57 futu_core::proto_id::TRD_MODIFY_ORDER_GROUP,
58 trd_modify_order_group
59);
60qot_proto_json_command!(
61 run_cancel_order_group,
62 "cancel-order-group",
63 futu_core::proto_id::TRD_CANCEL_ORDER_GROUP,
64 trd_cancel_order_group
65);
66qot_proto_json_command!(
67 run_delete_order_group,
68 "delete-order-group",
69 futu_core::proto_id::TRD_DELETE_ORDER_GROUP,
70 trd_delete_order_group
71);
72qot_proto_json_command!(
73 run_place_algo_order,
74 "place-algo-order",
75 futu_core::proto_id::TRD_PLACE_ALGO_ORDER,
76 trd_place_algo_order
77);
78qot_proto_json_command!(
79 run_modify_algo_order,
80 "modify-algo-order",
81 futu_core::proto_id::TRD_MODIFY_ALGO_ORDER,
82 trd_modify_algo_order
83);
84qot_proto_json_command!(
85 run_algo_order_logs,
86 "algo-order-logs",
87 futu_core::proto_id::TRD_GET_ALGO_ORDER_LOGS,
88 trd_get_algo_order_logs
89);
90qot_proto_json_command!(
91 run_reverse_position,
92 "reverse-position",
93 futu_core::proto_id::TRD_REVERSE_POSITION,
94 trd_reverse_position
95);
96qot_proto_json_command!(
97 run_roll_position,
98 "roll-position",
99 futu_core::proto_id::TRD_ROLL_POSITION,
100 trd_roll_position
101);
102qot_proto_json_command!(
103 run_clear_futures_positions,
104 "clear-futures-positions",
105 futu_core::proto_id::TRD_CLEAR_FUTURES_POSITIONS,
106 trd_clear_futures_positions
107);
108qot_proto_json_command!(
109 run_batch_close_positions,
110 "batch-close-positions",
111 futu_core::proto_id::TRD_BATCH_CLOSE_POSITIONS,
112 trd_batch_close_positions
113);