mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
feat: shareholder movements from the Stockbit session (ownership movements)
`idx ownership movements [SYMBOL]` and the MCP tool
`get_shareholder_movements` list reported changes in insiders' and major
holders' stakes, newest first, from Stockbit's
/insider/company/majorholder: IDX insider disclosures (any size, with the
trade price) and KSEI changes of holders at 5% and above (Stockbit's
estimated price). Stockbit filters by date range, holder id, action and
source; each page is 50 rows and one request, up to 10 pages, cached an
hour per page under every filter.
Rows keep exact signed share counts and the stake in basis points as
Stockbit rounds it; unknown action labels are kept as `other` rather than
dropped. JSON is {movements, more}; JSONL is one movement per line. The
command lives under `ownership` but needs no import, and `ownership`
commands now take --offline / --no-cache for it.
The per-symbol summary score is the next PR; docs/STOCKBIT.md records the
endpoint's parameters and action types as checked on 2026-11-03.
Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
parent
1b72c3ed6b
commit
ae0ca0c109
43 changed files with 3050 additions and 29 deletions
|
|
@ -89,6 +89,17 @@ pub trait CorporateActionProvider {
|
|||
) -> Result<Vec<crate::corporate::types::CorporateAction>, IdxError>;
|
||||
}
|
||||
|
||||
/// Shareholder movements: needs the user's Stockbit session.
|
||||
pub trait ShareholderMovementProvider {
|
||||
/// Page `page` (from 1) of `query`, whose `symbol` is resolved
|
||||
/// (`BBCA.JK`) or `None` for the market.
|
||||
fn shareholder_movements(
|
||||
&self,
|
||||
query: &crate::movements::types::MovementQuery,
|
||||
page: u32,
|
||||
) -> Result<crate::movements::types::MovementPage, IdxError>;
|
||||
}
|
||||
|
||||
pub trait FundamentalsProvider {
|
||||
fn fundamentals(&self, symbol: &str) -> Result<Fundamentals, IdxError>;
|
||||
}
|
||||
|
|
@ -364,6 +375,14 @@ pub fn corporate_action_provider() -> Box<dyn CorporateActionProvider> {
|
|||
Box::new(stockbit::StockbitProvider::new())
|
||||
}
|
||||
|
||||
pub fn shareholder_movement_provider() -> Box<dyn ShareholderMovementProvider> {
|
||||
#[cfg(feature = "testing")]
|
||||
if mock::enabled() {
|
||||
return Box::new(mock::MockStockbitProvider);
|
||||
}
|
||||
Box::new(stockbit::StockbitProvider::new())
|
||||
}
|
||||
|
||||
/// Today in WIB, the date IDX trades on.
|
||||
pub(crate) fn today_wib() -> chrono::NaiveDate {
|
||||
#[cfg(feature = "testing")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue