1use clap::Args;
4
5#[derive(Args)]
6pub struct ProtoJsonArgs {
7 #[arg(long = "c2s-json", value_name = "JSON")]
13 pub(crate) c2s_json: String,
14}
15
16#[derive(Args)]
17pub struct StockNoteArgs {
18 #[arg(long = "c2s-json", value_name = "JSON")]
19 pub(crate) c2s_json: String,
20 #[arg(long, env = "FUTU_REST_URL")]
21 pub(crate) rest_url: Option<String>,
22 #[arg(long, conflicts_with = "rest_url")]
23 pub(crate) rest_port: Option<u16>,
24 #[arg(long, env = "FUTU_API_KEY")]
25 pub(crate) api_key: Option<String>,
26}
27
28#[derive(Args)]
29pub struct IndicatorListArgs {
30 #[arg(long = "c2s-json", value_name = "JSON")]
36 pub(crate) c2s_json: String,
37}
38
39#[derive(Args)]
40pub struct IndicatorCalcArgs {
41 #[arg(long = "c2s-json", value_name = "JSON")]
43 pub(crate) c2s_json: String,
44
45 #[arg(long = "timeout-secs", default_value_t = 10)]
47 pub(crate) timeout_secs: u64,
48}
49
50#[derive(Args)]
51pub struct QuoteArgs {
52 #[arg(required = true)]
54 pub(crate) symbols: Vec<String>,
55}
56
57#[derive(Args)]
58pub struct SnapshotArgs {
59 #[arg(required = true)]
61 pub(crate) symbols: Vec<String>,
62}
63
64#[derive(Args)]
65pub struct SubArgs {
66 #[arg(required = true)]
68 pub(crate) symbols: Vec<String>,
69
70 #[arg(
78 short = 't',
79 long,
80 visible_aliases = ["sub-type", "sub-types", "stype"],
81 default_value = "basic"
82 )]
83 pub(crate) r#type: String,
84
85 #[arg(long = "extended-time")]
87 pub(crate) extended_time: bool,
88
89 #[arg(long)]
91 pub(crate) session: Option<String>,
92
93 #[arg(long = "orderbook-detail")]
95 pub(crate) orderbook_detail: bool,
96}
97
98#[derive(Args)]
99pub struct KlineArgs {
100 #[arg(index = 1, value_name = "SYMBOL")]
102 pub(crate) symbol_positional: Option<String>,
103
104 #[arg(
106 long = "symbol",
107 visible_aliases = ["code", "stock"],
108 conflicts_with = "symbol_positional",
109 value_name = "SYMBOL"
110 )]
111 pub(crate) symbol_arg: Option<String>,
112
113 #[arg(
118 short = 't',
119 long,
120 visible_aliases = ["ktype", "kltype", "kl-type"],
121 default_value = "day"
122 )]
123 pub(crate) r#type: String,
124
125 #[arg(
129 short = 'n',
130 long,
131 visible_aliases = ["num", "max-count", "req-count"]
132 )]
133 pub(crate) count: Option<i32>,
134
135 #[arg(long = "rehab-type", default_value = "none")]
137 pub(crate) rehab_type: String,
138
139 #[arg(long = "page-size", visible_alias = "max-ack-kl-num")]
141 pub(crate) page_size: Option<i32>,
142
143 #[arg(long = "next-req-key", visible_alias = "nextReqKey")]
145 pub(crate) next_req_key: Option<String>,
146
147 #[arg(long = "need-kl-fields-flag", visible_alias = "needKLFieldsFlag")]
149 pub(crate) need_kl_fields_flag: Option<i64>,
150
151 #[arg(long = "extended-time")]
153 pub(crate) extended_time: bool,
154
155 #[arg(long)]
157 pub(crate) session: Option<String>,
158
159 #[arg(long, visible_aliases = ["begin-time", "from"])]
163 pub(crate) begin: Option<String>,
164
165 #[arg(long, visible_aliases = ["end-time", "to"])]
169 pub(crate) end: Option<String>,
170}
171
172#[derive(Args)]
173pub struct OrderbookArgs {
174 #[arg(index = 1, value_name = "SYMBOL")]
176 pub(crate) symbol_positional: Option<String>,
177
178 #[arg(
180 long = "symbol",
181 visible_aliases = ["code", "stock"],
182 conflicts_with = "symbol_positional",
183 value_name = "SYMBOL"
184 )]
185 pub(crate) symbol_arg: Option<String>,
186
187 #[arg(
191 short = 'n',
192 long,
193 visible_aliases = ["num", "count"],
194 default_value_t = 10
195 )]
196 pub(crate) depth: i32,
197
198 #[arg(long = "odd-lot", visible_alias = "odd")]
200 pub(crate) odd_lot: bool,
201}
202
203#[derive(Args)]
204pub struct TickerArgs {
205 #[arg(index = 1, value_name = "SYMBOL")]
207 pub(crate) symbol_positional: Option<String>,
208
209 #[arg(
211 long = "symbol",
212 visible_aliases = ["code", "stock"],
213 conflicts_with = "symbol_positional",
214 value_name = "SYMBOL"
215 )]
216 pub(crate) symbol_arg: Option<String>,
217
218 #[arg(
222 short = 'n',
223 long,
224 visible_aliases = ["num", "max-count"],
225 default_value_t = 100
226 )]
227 pub(crate) count: i32,
228}
229
230#[derive(Args)]
231pub struct RtArgs {
232 #[arg(index = 1, value_name = "SYMBOL")]
234 pub(crate) symbol_positional: Option<String>,
235
236 #[arg(
238 long = "symbol",
239 visible_aliases = ["code", "stock"],
240 conflicts_with = "symbol_positional",
241 value_name = "SYMBOL"
242 )]
243 pub(crate) symbol_arg: Option<String>,
244}
245
246#[derive(Args)]
247pub struct StaticArgs {
248 #[arg(required = true)]
250 pub(crate) symbols: Vec<String>,
251}
252
253#[derive(Args)]
254pub struct BrokerArgs {
255 #[arg(index = 1, value_name = "SYMBOL")]
257 pub(crate) symbol_positional: Option<String>,
258
259 #[arg(
261 long = "symbol",
262 visible_aliases = ["code", "stock"],
263 conflicts_with = "symbol_positional",
264 value_name = "SYMBOL"
265 )]
266 pub(crate) symbol_arg: Option<String>,
267}
268
269#[derive(Args)]
270pub struct PlateListArgs {
271 #[arg(short, long)]
273 pub(crate) market: String,
274
275 #[arg(short = 's', long, visible_alias = "plate-type", default_value = "all")]
278 pub(crate) set: String,
279}
280
281#[derive(Args)]
282pub struct PlateStocksArgs {
283 #[arg(index = 1, value_name = "PLATE")]
285 pub(crate) plate: Option<String>,
286
287 #[arg(long = "plate", conflicts_with = "plate")]
289 pub(crate) plate_arg: Option<String>,
290}
291
292#[derive(Args)]
293pub struct ReferenceArgs {
294 #[arg(index = 1, value_name = "SYMBOL")]
296 pub(crate) symbol_positional: Option<String>,
297
298 #[arg(
300 long = "symbol",
301 visible_aliases = ["code", "stock"],
302 conflicts_with = "symbol_positional",
303 value_name = "SYMBOL"
304 )]
305 pub(crate) symbol_arg: Option<String>,
306
307 #[arg(
309 long = "reference-type",
310 visible_alias = "type",
311 default_value = "warrant"
312 )]
313 pub(crate) reference_type: String,
314}
315
316#[derive(Args)]
317pub struct CapitalFlowArgs {
318 pub(crate) symbol: String,
320 #[arg(long, default_value_t = 1)]
322 pub(crate) period_type: i32,
323 #[arg(long)]
325 pub(crate) begin: Option<String>,
326 #[arg(long)]
328 pub(crate) end: Option<String>,
329}
330
331#[derive(Args)]
332pub struct CompanyProfileArgs {
333 pub(crate) symbol: String,
335}
336
337#[derive(Args)]
338pub struct CompanyExecutivesArgs {
339 pub(crate) symbol: String,
341}
342
343#[derive(Args)]
344pub struct CompanyExecutiveBackgroundArgs {
345 pub(crate) symbol: String,
347 pub(crate) leader_name: String,
349}
350
351#[derive(Args)]
352pub struct CompanyOperationalEfficiencyArgs {
353 pub(crate) symbol: String,
355 #[arg(long, allow_hyphen_values = true)]
357 pub(crate) next_key: Option<String>,
358 #[arg(long)]
360 pub(crate) num: Option<i32>,
361 #[arg(long)]
363 pub(crate) currency_code: Option<String>,
364 #[arg(long)]
366 pub(crate) financial_type: Option<i32>,
367}
368
369#[derive(Args)]
370pub struct FinancialsEarningsPriceMoveArgs {
371 pub(crate) symbol: String,
373 #[arg(long)]
375 pub(crate) period_count: Option<i32>,
376}
377
378#[derive(Args)]
379pub struct FinancialsEarningsPriceHistoryArgs {
380 pub(crate) symbol: String,
382}
383
384#[derive(Args)]
385pub struct FinancialCalendarArgs {
386 #[arg(long)]
388 pub(crate) begin_date: String,
389 #[arg(long)]
391 pub(crate) end_date: String,
392 #[arg(long = "market", visible_alias = "market-list", value_delimiter = ',')]
394 pub(crate) markets: Vec<String>,
395 #[arg(
397 long = "pub-type",
398 visible_alias = "pub-type-list",
399 value_delimiter = ','
400 )]
401 pub(crate) pub_types: Vec<String>,
402 #[arg(
404 long = "stock-type",
405 visible_alias = "stock-type-list",
406 value_delimiter = ','
407 )]
408 pub(crate) stock_types: Vec<String>,
409 #[arg(long)]
411 pub(crate) watchlist_only: bool,
412 #[arg(long)]
414 pub(crate) positions_only: bool,
415 #[arg(long, default_value_t = 6)]
417 pub(crate) count: i32,
418 #[arg(long)]
420 pub(crate) ranking_type: Option<i32>,
421 #[arg(long = "custom-filter", value_name = "TYPE[:MIN[:MAX]]")]
423 pub(crate) custom_filters: Vec<String>,
424 #[arg(
426 long = "estimate-type",
427 visible_alias = "estimate-type-list",
428 value_delimiter = ','
429 )]
430 pub(crate) estimate_types: Vec<String>,
431 #[arg(long = "watchlist-stock-id")]
433 pub(crate) watchlist_stock_ids: Vec<u64>,
434 #[arg(long = "holding-stock-id")]
436 pub(crate) holding_stock_ids: Vec<u64>,
437}
438
439#[derive(Args)]
440pub struct FinancialCalendarTargetArgs {
441 #[arg(long = "stock-id", required = true)]
443 pub(crate) stock_ids: Vec<u64>,
444 #[arg(long = "market", visible_alias = "market-list", value_delimiter = ',')]
446 pub(crate) markets: Vec<String>,
447 #[arg(long, default_value_t = 20)]
449 pub(crate) size: i32,
450 #[arg(long)]
452 pub(crate) start: Option<i32>,
453}
454
455#[derive(Args)]
456pub struct IpoCalendarArgs {
457 #[arg(long)]
459 pub(crate) market: String,
460 #[arg(long = "event", visible_alias = "event-type", value_delimiter = ',')]
462 pub(crate) events: Vec<String>,
463 #[arg(long)]
465 pub(crate) begin_date: Option<String>,
466 #[arg(long)]
468 pub(crate) end_date: Option<String>,
469}
470
471#[derive(Args)]
472pub struct FinancialsStatementsArgs {
473 pub(crate) symbol: String,
475 #[arg(long)]
477 pub(crate) statement_type: Option<i32>,
478 #[arg(long)]
480 pub(crate) financial_type: Option<i32>,
481 #[arg(long)]
483 pub(crate) currency_code: Option<String>,
484 #[arg(long, allow_hyphen_values = true)]
486 pub(crate) next_key: Option<String>,
487 #[arg(long)]
489 pub(crate) num: Option<i32>,
490}
491
492#[derive(Args)]
493pub struct FinancialsRevenueBreakdownArgs {
494 pub(crate) symbol: String,
496 #[arg(long)]
498 pub(crate) date: Option<u32>,
499 #[arg(long)]
501 pub(crate) financial_type: Option<i32>,
502 #[arg(long)]
504 pub(crate) currency_code: Option<String>,
505}
506
507#[derive(Args)]
508pub struct ResearchAnalystConsensusArgs {
509 pub(crate) symbol: String,
511}
512
513#[derive(Args)]
514pub struct ResearchRatingSummaryArgs {
515 pub(crate) symbol: String,
517 #[arg(long)]
519 pub(crate) rating_dimension_type: Option<i32>,
520 #[arg(long)]
522 pub(crate) uid: Option<String>,
523 #[arg(long, allow_hyphen_values = true)]
525 pub(crate) next_key: Option<String>,
526 #[arg(long)]
528 pub(crate) num: Option<i32>,
529}
530
531#[derive(Args)]
532pub struct ResearchMorningstarReportArgs {
533 pub(crate) symbol: String,
535}
536
537#[derive(Args)]
538pub struct ValuationDetailArgs {
539 pub(crate) symbol: String,
541 #[arg(long)]
543 pub(crate) valuation_type: Option<i32>,
544 #[arg(long)]
546 pub(crate) interval_type: Option<i32>,
547}
548
549#[derive(Args)]
550pub struct ValuationPlateStockListArgs {
551 pub(crate) symbol: String,
553 #[arg(long)]
555 pub(crate) valuation_type: Option<i32>,
556 #[arg(long, allow_hyphen_values = true)]
558 pub(crate) next_key: Option<String>,
559 #[arg(long)]
561 pub(crate) num: Option<i32>,
562 #[arg(long)]
564 pub(crate) sort_type: Option<i32>,
565 #[arg(long)]
567 pub(crate) sort_id: Option<i32>,
568 #[arg(long)]
570 pub(crate) filter_security: Option<String>,
571}
572
573#[derive(Args)]
574pub struct StockScreenArgs {
575 #[arg(long = "c2s-json")]
577 pub(crate) c2s_json: String,
578}
579
580#[derive(Args)]
581pub struct OptionScreenArgs {
582 #[arg(long = "c2s-json")]
584 pub(crate) c2s_json: String,
585}
586
587#[derive(Args)]
588pub struct WarrantScreenArgs {
589 #[arg(long = "c2s-json")]
591 pub(crate) c2s_json: String,
592}
593
594#[derive(Args)]
595pub struct TechnicalUnusualArgs {
596 pub(crate) stock_symbol: String,
598 #[arg(long)]
600 pub(crate) time_range: Option<i32>,
601 #[arg(long = "indicator-filter")]
603 pub(crate) indicator_filters: Vec<String>,
604 #[arg(long)]
606 pub(crate) language_id: Option<i32>,
607}
608
609#[derive(Args)]
610pub struct FinancialUnusualArgs {
611 pub(crate) stock_symbol: String,
613 #[arg(long)]
615 pub(crate) time_range: Option<i32>,
616 #[arg(long = "analysis-dimension")]
618 pub(crate) analysis_dimensions: Vec<String>,
619 #[arg(long)]
621 pub(crate) language_id: Option<i32>,
622}
623
624#[derive(Args)]
625pub struct DerivativeUnusualArgs {
626 pub(crate) stock_symbol: String,
628 #[arg(long)]
630 pub(crate) time_range: Option<i32>,
631 #[arg(long = "analysis-dimension")]
633 pub(crate) analysis_dimensions: Vec<String>,
634 #[arg(long)]
636 pub(crate) language_id: Option<i32>,
637}
638
639#[derive(Args)]
640pub struct CorporateActionsDividendsArgs {
641 pub(crate) symbol: String,
643}
644
645#[derive(Args)]
646pub struct CorporateActionsBuybacksArgs {
647 pub(crate) symbol: String,
649 #[arg(long, allow_hyphen_values = true)]
651 pub(crate) next_key: Option<String>,
652 #[arg(long)]
654 pub(crate) num: Option<i32>,
655}
656
657#[derive(Args)]
658pub struct CorporateActionsStockSplitsArgs {
659 pub(crate) symbol: String,
661 #[arg(long, allow_hyphen_values = true)]
663 pub(crate) next_key: Option<String>,
664 #[arg(long)]
666 pub(crate) num: Option<i32>,
667}
668
669#[derive(Args)]
670pub struct DailyShortVolumeArgs {
671 pub(crate) symbol: String,
673 #[arg(long, allow_hyphen_values = true)]
675 pub(crate) next_key: Option<String>,
676 #[arg(long)]
678 pub(crate) num: Option<i32>,
679}
680
681#[derive(Args)]
682pub struct ShortInterestArgs {
683 pub(crate) symbol: String,
685 #[arg(long, allow_hyphen_values = true)]
687 pub(crate) next_key: Option<String>,
688 #[arg(long)]
690 pub(crate) num: Option<i32>,
691}
692
693#[derive(Args)]
694pub struct TopTenBuySellBrokersArgs {
695 pub(crate) symbol: String,
697 #[arg(long)]
699 pub(crate) days_before: Option<i32>,
700}
701
702#[derive(Args)]
703pub struct ShareholdersOverviewArgs {
704 pub(crate) symbol: String,
706 #[arg(long)]
708 pub(crate) period_id: Option<i32>,
709}
710
711#[derive(Args)]
712pub struct ShareholdersHoldingChangesArgs {
713 pub(crate) symbol: String,
715 #[arg(long, allow_hyphen_values = true)]
717 pub(crate) next_key: Option<String>,
718 #[arg(long)]
720 pub(crate) num: Option<i32>,
721 #[arg(long)]
723 pub(crate) sort_type: Option<i32>,
724 #[arg(long)]
726 pub(crate) sort_column: Option<i32>,
727 #[arg(long)]
729 pub(crate) filter_type: Option<i32>,
730}
731
732#[derive(Args)]
733pub struct ShareholdersHolderDetailArgs {
734 pub(crate) symbol: String,
736 #[arg(long)]
738 pub(crate) request_type: Option<i32>,
739 #[arg(long, allow_hyphen_values = true)]
741 pub(crate) next_key: Option<String>,
742 #[arg(long)]
744 pub(crate) num: Option<i32>,
745 #[arg(long)]
747 pub(crate) sort_column: Option<i32>,
748 #[arg(long)]
750 pub(crate) sort_type: Option<i32>,
751 #[arg(long)]
753 pub(crate) period_id: Option<i32>,
754 #[arg(long)]
756 pub(crate) holder_id: Option<i32>,
757}
758
759#[derive(Args)]
760pub struct ShareholdersInstitutionalArgs {
761 pub(crate) symbol: String,
763 #[arg(long, allow_hyphen_values = true)]
765 pub(crate) next_key: Option<String>,
766 #[arg(long)]
768 pub(crate) num: Option<i32>,
769}
770
771#[derive(Args)]
772pub struct InsiderHolderListArgs {
773 pub(crate) symbol: String,
775 #[arg(long, allow_hyphen_values = true)]
777 pub(crate) next_key: Option<String>,
778 #[arg(long)]
780 pub(crate) num: Option<i32>,
781}
782
783#[derive(Args)]
784pub struct InsiderTradeListArgs {
785 pub(crate) symbol: String,
787 #[arg(long)]
789 pub(crate) holder_id: Option<i64>,
790 #[arg(long, allow_hyphen_values = true)]
792 pub(crate) next_key: Option<String>,
793 #[arg(long)]
795 pub(crate) num: Option<i32>,
796}
797
798#[derive(Args)]
799pub struct OptionVolatilityArgs {
800 pub(crate) symbol: String,
802 #[arg(long)]
804 pub(crate) query_time_period: Option<i32>,
805 #[arg(long)]
807 pub(crate) hv_time_period: Option<i32>,
808}
809
810#[derive(Args)]
811pub struct OptionExerciseProbabilityArgs {
812 pub(crate) symbol: String,
814}