diff --git a/crates/idx-cli/src/output/table.rs b/crates/idx-cli/src/output/table.rs index c79ec5f..641d9c6 100644 --- a/crates/idx-cli/src/output/table.rs +++ b/crates/idx-cli/src/output/table.rs @@ -1254,8 +1254,9 @@ pub fn print_foreign_flow(flow: &ForeignFlow) -> Result<(), IdxError> { } println!("{summary}."); println!( - "Volumes are shares. Net value is estimated at each session's average price; \ -NON-REG is the share of value traded outside the regular board (negotiated and cash)." + "Volume, value and foreign figures are the regular board, volumes in shares. Net value \ +is estimated at each session's average price; NON-REG is the share of all value traded \ +outside the regular board (negotiated and cash)." ); Ok(()) } diff --git a/crates/idx-cli/tests/golden/stocks-flow-latest.json.golden b/crates/idx-cli/tests/golden/stocks-flow-latest.json.golden index 850c9af..9711422 100644 --- a/crates/idx-cli/tests/golden/stocks-flow-latest.json.golden +++ b/crates/idx-cli/tests/golden/stocks-flow-latest.json.golden @@ -1,4 +1,4 @@ exit: 0 --- stdout -{"symbol":"TLKM.JK","from":"2026-10-14","to":"2026-10-16","days":[{"date":"2026-10-14","close":2250,"change_bps":45,"volume":87159900,"value":197725738000,"foreign_buy":63030200,"foreign_sell":60811200,"foreign_net":2219000,"foreign_net_value":5033890729,"non_regular_bps":1085},{"date":"2026-10-15","close":2230,"change_bps":-89,"volume":150485300,"value":333287991000,"foreign_buy":97385100,"foreign_sell":105521800,"foreign_net":-8136700,"foreign_net_value":-18020792704,"non_regular_bps":78},{"date":"2026-10-16","close":1900,"change_bps":-1480,"volume":963614200,"value":1855341292500,"foreign_buy":679004400,"foreign_sell":727289800,"foreign_net":-48285400,"foreign_net_value":-92968634589,"non_regular_bps":1744}],"foreign_net":-54203100,"foreign_net_value":-105955536564,"foreign_share_bps":7213} +{"symbol":"TLKM.JK","from":"2026-10-14","to":"2026-10-16","days":[{"date":"2026-10-14","close":2250,"change_bps":45,"volume":87159900,"value":197725738000,"foreign_buy":63030200,"foreign_sell":60811200,"foreign_net":2219000,"foreign_net_value":5033890729,"non_regular_bps":979},{"date":"2026-10-15","close":2230,"change_bps":-89,"volume":150485300,"value":333287991000,"foreign_buy":97385100,"foreign_sell":105521800,"foreign_net":-8136700,"foreign_net_value":-18020792704,"non_regular_bps":78},{"date":"2026-10-16","close":1900,"change_bps":-1480,"volume":963614200,"value":1855341292500,"foreign_buy":679004400,"foreign_sell":727289800,"foreign_net":-48285400,"foreign_net_value":-92968634589,"non_regular_bps":1485}],"foreign_net":-54203100,"foreign_net_value":-105955536564,"foreign_share_bps":7213} --- stderr diff --git a/crates/idx-cli/tests/golden/stocks-flow-latest.table.golden b/crates/idx-cli/tests/golden/stocks-flow-latest.table.golden index d931858..d9e7bf6 100644 --- a/crates/idx-cli/tests/golden/stocks-flow-latest.table.golden +++ b/crates/idx-cli/tests/golden/stocks-flow-latest.table.golden @@ -4,12 +4,12 @@ Foreign flow for TLKM.JK, 2026-10-14 to 2026-10-16 (3 sessions) ┌────────────┬───────┬────────┬────────┬─────────────┬──────────────┬─────────────┬───────────┬─────────┐ │ DATE ┆ CLOSE ┆ CHG% ┆ VALUE ┆ FOREIGN BUY ┆ FOREIGN SELL ┆ FOREIGN NET ┆ NET VALUE ┆ NON-REG │ ╞════════════╪═══════╪════════╪════════╪═════════════╪══════════════╪═════════════╪═══════════╪═════════╡ -│ 2026-10-14 ┆ 2,250 ┆ +0.5% ┆ 197.7B ┆ 63.0M ┆ 60.8M ┆ +2.2M ┆ +5.0B ┆ 10.8% │ +│ 2026-10-14 ┆ 2,250 ┆ +0.5% ┆ 197.7B ┆ 63.0M ┆ 60.8M ┆ +2.2M ┆ +5.0B ┆ 9.8% │ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ 2026-10-15 ┆ 2,230 ┆ -0.9% ┆ 333.3B ┆ 97.4M ┆ 105.5M ┆ -8.1M ┆ -18.0B ┆ 0.8% │ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ -│ 2026-10-16 ┆ 1,900 ┆ -14.8% ┆ 1.9T ┆ 679.0M ┆ 727.3M ┆ -48.3M ┆ -93.0B ┆ 17.4% │ +│ 2026-10-16 ┆ 1,900 ┆ -14.8% ┆ 1.9T ┆ 679.0M ┆ 727.3M ┆ -48.3M ┆ -93.0B ┆ 14.8% │ └────────────┴───────┴────────┴────────┴─────────────┴──────────────┴─────────────┴───────────┴─────────┘ Net foreign: -54.2M shares, about -106.0B IDR; foreign investors made up 72.1% of trading. -Volumes are shares. Net value is estimated at each session's average price; NON-REG is the share of value traded outside the regular board (negotiated and cash). +Volume, value and foreign figures are the regular board, volumes in shares. Net value is estimated at each session's average price; NON-REG is the share of all value traded outside the regular board (negotiated and cash). --- stderr diff --git a/crates/idx-cli/tests/golden/stocks-flow.json.golden b/crates/idx-cli/tests/golden/stocks-flow.json.golden index 7714bb2..3a4105e 100644 --- a/crates/idx-cli/tests/golden/stocks-flow.json.golden +++ b/crates/idx-cli/tests/golden/stocks-flow.json.golden @@ -1,4 +1,4 @@ exit: 0 --- stdout -{"symbol":"BBCA.JK","from":"2026-10-12","to":"2026-10-16","days":[{"date":"2026-10-12","close":5950,"change_bps":-165,"volume":97965100,"value":586491892500,"foreign_buy":51499200,"foreign_sell":60883100,"foreign_net":-9383900,"foreign_net_value":-56178999154,"non_regular_bps":14},{"date":"2026-10-13","close":5950,"change_bps":0,"volume":122716900,"value":726575115000,"foreign_buy":88772100,"foreign_sell":83738900,"foreign_net":5033200,"foreign_net_value":29800279088,"non_regular_bps":162},{"date":"2026-10-14","close":6125,"change_bps":294,"volume":136303100,"value":828862772500,"foreign_buy":119876900,"foreign_sell":84298000,"foreign_net":35578900,"foreign_net_value":216356236186,"non_regular_bps":3178},{"date":"2026-10-15","close":6075,"change_bps":-82,"volume":134763200,"value":816554920000,"foreign_buy":120850000,"foreign_sell":73638900,"foreign_net":47211100,"foreign_net_value":286060704877,"non_regular_bps":1168},{"date":"2026-10-16","close":5175,"change_bps":-1481,"volume":1241098200,"value":6474934315000,"foreign_buy":309392800,"foreign_sell":757227900,"foreign_net":-447835100,"foreign_net_value":-2336400823441,"non_regular_bps":155}],"foreign_net":-369395800,"foreign_net_value":-1860362602444,"foreign_share_bps":5050} +{"symbol":"BBCA.JK","from":"2026-10-12","to":"2026-10-16","days":[{"date":"2026-10-12","close":5950,"change_bps":-165,"volume":97965100,"value":586491892500,"foreign_buy":51499200,"foreign_sell":60883100,"foreign_net":-9383900,"foreign_net_value":-56178999154,"non_regular_bps":14},{"date":"2026-10-13","close":5950,"change_bps":0,"volume":122716900,"value":726575115000,"foreign_buy":88772100,"foreign_sell":83738900,"foreign_net":5033200,"foreign_net_value":29800279088,"non_regular_bps":159},{"date":"2026-10-14","close":6125,"change_bps":294,"volume":136303100,"value":828862772500,"foreign_buy":119876900,"foreign_sell":84298000,"foreign_net":35578900,"foreign_net_value":216356236186,"non_regular_bps":2412},{"date":"2026-10-15","close":6075,"change_bps":-82,"volume":134763200,"value":816554920000,"foreign_buy":120850000,"foreign_sell":73638900,"foreign_net":47211100,"foreign_net_value":286060704877,"non_regular_bps":1046},{"date":"2026-10-16","close":5175,"change_bps":-1481,"volume":1241098200,"value":6474934315000,"foreign_buy":309392800,"foreign_sell":757227900,"foreign_net":-447835100,"foreign_net_value":-2336400823441,"non_regular_bps":152}],"foreign_net":-369395800,"foreign_net_value":-1860362602444,"foreign_share_bps":5050} --- stderr diff --git a/crates/idx-cli/tests/golden/stocks-flow.jsonl.golden b/crates/idx-cli/tests/golden/stocks-flow.jsonl.golden index 7714bb2..3a4105e 100644 --- a/crates/idx-cli/tests/golden/stocks-flow.jsonl.golden +++ b/crates/idx-cli/tests/golden/stocks-flow.jsonl.golden @@ -1,4 +1,4 @@ exit: 0 --- stdout -{"symbol":"BBCA.JK","from":"2026-10-12","to":"2026-10-16","days":[{"date":"2026-10-12","close":5950,"change_bps":-165,"volume":97965100,"value":586491892500,"foreign_buy":51499200,"foreign_sell":60883100,"foreign_net":-9383900,"foreign_net_value":-56178999154,"non_regular_bps":14},{"date":"2026-10-13","close":5950,"change_bps":0,"volume":122716900,"value":726575115000,"foreign_buy":88772100,"foreign_sell":83738900,"foreign_net":5033200,"foreign_net_value":29800279088,"non_regular_bps":162},{"date":"2026-10-14","close":6125,"change_bps":294,"volume":136303100,"value":828862772500,"foreign_buy":119876900,"foreign_sell":84298000,"foreign_net":35578900,"foreign_net_value":216356236186,"non_regular_bps":3178},{"date":"2026-10-15","close":6075,"change_bps":-82,"volume":134763200,"value":816554920000,"foreign_buy":120850000,"foreign_sell":73638900,"foreign_net":47211100,"foreign_net_value":286060704877,"non_regular_bps":1168},{"date":"2026-10-16","close":5175,"change_bps":-1481,"volume":1241098200,"value":6474934315000,"foreign_buy":309392800,"foreign_sell":757227900,"foreign_net":-447835100,"foreign_net_value":-2336400823441,"non_regular_bps":155}],"foreign_net":-369395800,"foreign_net_value":-1860362602444,"foreign_share_bps":5050} +{"symbol":"BBCA.JK","from":"2026-10-12","to":"2026-10-16","days":[{"date":"2026-10-12","close":5950,"change_bps":-165,"volume":97965100,"value":586491892500,"foreign_buy":51499200,"foreign_sell":60883100,"foreign_net":-9383900,"foreign_net_value":-56178999154,"non_regular_bps":14},{"date":"2026-10-13","close":5950,"change_bps":0,"volume":122716900,"value":726575115000,"foreign_buy":88772100,"foreign_sell":83738900,"foreign_net":5033200,"foreign_net_value":29800279088,"non_regular_bps":159},{"date":"2026-10-14","close":6125,"change_bps":294,"volume":136303100,"value":828862772500,"foreign_buy":119876900,"foreign_sell":84298000,"foreign_net":35578900,"foreign_net_value":216356236186,"non_regular_bps":2412},{"date":"2026-10-15","close":6075,"change_bps":-82,"volume":134763200,"value":816554920000,"foreign_buy":120850000,"foreign_sell":73638900,"foreign_net":47211100,"foreign_net_value":286060704877,"non_regular_bps":1046},{"date":"2026-10-16","close":5175,"change_bps":-1481,"volume":1241098200,"value":6474934315000,"foreign_buy":309392800,"foreign_sell":757227900,"foreign_net":-447835100,"foreign_net_value":-2336400823441,"non_regular_bps":152}],"foreign_net":-369395800,"foreign_net_value":-1860362602444,"foreign_share_bps":5050} --- stderr diff --git a/crates/idx-cli/tests/golden/stocks-flow.table.golden b/crates/idx-cli/tests/golden/stocks-flow.table.golden index 55bed56..0736ef1 100644 --- a/crates/idx-cli/tests/golden/stocks-flow.table.golden +++ b/crates/idx-cli/tests/golden/stocks-flow.table.golden @@ -8,12 +8,12 @@ Foreign flow for BBCA.JK, 2026-10-12 to 2026-10-16 (5 sessions) ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ │ 2026-10-13 ┆ 5,950 ┆ +0.0% ┆ 726.6B ┆ 88.8M ┆ 83.7M ┆ +5.0M ┆ +29.8B ┆ 1.6% │ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ -│ 2026-10-14 ┆ 6,125 ┆ +2.9% ┆ 828.9B ┆ 119.9M ┆ 84.3M ┆ +35.6M ┆ +216.4B ┆ 31.8% │ +│ 2026-10-14 ┆ 6,125 ┆ +2.9% ┆ 828.9B ┆ 119.9M ┆ 84.3M ┆ +35.6M ┆ +216.4B ┆ 24.1% │ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ -│ 2026-10-15 ┆ 6,075 ┆ -0.8% ┆ 816.6B ┆ 120.8M ┆ 73.6M ┆ +47.2M ┆ +286.1B ┆ 11.7% │ +│ 2026-10-15 ┆ 6,075 ┆ -0.8% ┆ 816.6B ┆ 120.8M ┆ 73.6M ┆ +47.2M ┆ +286.1B ┆ 10.5% │ ├╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤ -│ 2026-10-16 ┆ 5,175 ┆ -14.8% ┆ 6.5T ┆ 309.4M ┆ 757.2M ┆ -447.8M ┆ -2.3T ┆ 1.6% │ +│ 2026-10-16 ┆ 5,175 ┆ -14.8% ┆ 6.5T ┆ 309.4M ┆ 757.2M ┆ -447.8M ┆ -2.3T ┆ 1.5% │ └────────────┴───────┴────────┴────────┴─────────────┴──────────────┴─────────────┴───────────┴─────────┘ Net foreign: -369.4M shares, about -1.9T IDR; foreign investors made up 50.5% of trading. -Volumes are shares. Net value is estimated at each session's average price; NON-REG is the share of value traded outside the regular board (negotiated and cash). +Volume, value and foreign figures are the regular board, volumes in shares. Net value is estimated at each session's average price; NON-REG is the share of all value traded outside the regular board (negotiated and cash). --- stderr diff --git a/crates/idx-core/src/flow/mod.rs b/crates/idx-core/src/flow/mod.rs index dfb9dc5..cbfc52e 100644 --- a/crates/idx-core/src/flow/mod.rs +++ b/crates/idx-core/src/flow/mod.rs @@ -184,10 +184,11 @@ fn flow_day(row: &StockDay) -> ForeignFlowDay { foreign_sell: row.foreign_sell, foreign_net, foreign_net_value, + // `value` is the regular board only; the share is of all trading. non_regular_bps: row .non_regular_value .zip(row.value) - .and_then(|(part, whole)| bps(part, whole)), + .and_then(|(part, regular)| bps(part, part.checked_add(regular)?)), } } @@ -255,7 +256,8 @@ mod tests { ); // 400 shares at 1,100 (value over volume). assert_eq!(first.foreign_net_value, Some(440_000)); - assert_eq!(first.non_regular_bps, Some(1000)); + // 110,000 of 1,100,000 regular plus 110,000 non-regular. + assert_eq!(first.non_regular_bps, Some(909)); assert_eq!(flow.days[1].change_bps, Some(-500)); assert_eq!( (flow.foreign_net, flow.foreign_net_value), @@ -278,6 +280,17 @@ mod tests { assert!(foreign_flow("TEST.JK", &[]).is_none()); } + #[test] + fn test_non_regular_share_is_of_all_trading() { + let raw = include_str!("../../tests/fixtures/idx_stocksummary_20261014.json"); + let date = NaiveDate::from_ymd_opt(2026, 10, 14).unwrap(); + let rows = crate::api::idx::parse_stock_summary(raw, date).unwrap(); + let bbri: Vec = rows.into_iter().filter(|row| row.code == "BBRI").collect(); + let flow = foreign_flow("BBRI.JK", &bbri).unwrap(); + // 172.3B non-regular against 338.5B regular: 33.74%, not 50.91%. + assert_eq!(flow.days[0].non_regular_bps, Some(3374)); + } + #[test] fn test_check_range_bounds() { let day = |d| NaiveDate::from_ymd_opt(2026, 10, d).unwrap(); diff --git a/crates/idx-core/src/flow/types.rs b/crates/idx-core/src/flow/types.rs index 376d0dc..1e01423 100644 --- a/crates/idx-core/src/flow/types.rs +++ b/crates/idx-core/src/flow/types.rs @@ -10,7 +10,10 @@ use crate::error::IdxError; pub const DEFAULT_SESSIONS: usize = 10; /// One stock's trading summary for one session, as IDX publishes it. -/// Prices are whole IDR, volumes are shares. +/// Prices are whole IDR, volumes are shares. Volume, value and the foreign +/// figures cover the regular board only (across a week of every stock, no +/// foreign figure exceeded regular volume, even where non-regular volume was +/// more than twice it); the non-regular figures cover the rest. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct StockDay { /// Bare IDX code, e.g. `BBCA`. @@ -21,7 +24,7 @@ pub struct StockDay { pub low: Option, pub close: Option, pub volume: Option, - /// Value traded, whole IDR, all boards. + /// Value traded on the regular board, whole IDR. pub value: Option, pub frequency: Option, /// Shares bought by foreign investors. @@ -80,11 +83,11 @@ pub struct ForeignFlowDay { pub close: Option, /// Close against the previous close, basis points. pub change_bps: Option, - /// Shares traded. + /// Shares traded on the regular board. pub volume: Option, - /// Value traded, whole IDR. + /// Value traded on the regular board, whole IDR. pub value: Option, - /// Shares foreign investors bought. + /// Shares foreign investors bought (regular board). pub foreign_buy: Option, /// Shares foreign investors sold. pub foreign_sell: Option, @@ -94,7 +97,7 @@ pub struct ForeignFlowDay { /// whole IDR: an estimate. pub foreign_net_value: Option, /// Value traded outside the regular board (negotiated and cash), basis - /// points of the session's value. + /// points of all value traded (regular plus non-regular). pub non_regular_bps: Option, } @@ -112,6 +115,6 @@ pub struct ForeignFlow { /// Sum of the sessions' estimated net values, whole IDR. pub foreign_net_value: Option, /// Foreign buys and sells over twice the volume: foreign investors' - /// share of trading, basis points. + /// share of regular-board trading, basis points. pub foreign_share_bps: Option, } diff --git a/crates/idx-mcp/src/server.rs b/crates/idx-mcp/src/server.rs index 0d52312..493e63a 100644 --- a/crates/idx-mcp/src/server.rs +++ b/crates/idx-mcp/src/server.rs @@ -244,8 +244,9 @@ gross figures overstate their direction. `method` names the rules applied. `inve description = "Foreign investors' buying and selling of one IDX ticker, session by \ session (oldest first), from IDX's daily trading summary: foreign buy, sell and net volume in \ shares, `foreign_net_value` (net shares at the session's average price, an estimate, IDR), \ -`change_bps`, and `non_regular_bps` (share of value traded outside the regular board). Totals \ -cover the whole range; `foreign_share_bps` is foreign investors' share of trading. End of day." +`change_bps`, and `non_regular_bps` (share of all value traded outside the regular board). \ +Volume, value and foreign figures are the regular board. Totals cover the whole range; \ +`foreign_share_bps` is foreign investors' share of regular-board trading. End of day." )] async fn get_foreign_flow(&self, params: Parameters) -> ToolResult { let FlowParams { diff --git a/crates/idx-mcp/tests/golden/tools.json b/crates/idx-mcp/tests/golden/tools.json index 176c6e8..65be648 100644 --- a/crates/idx-mcp/tests/golden/tools.json +++ b/crates/idx-mcp/tests/golden/tools.json @@ -236,7 +236,7 @@ "name": "get_company" }, { - "description": "Foreign investors' buying and selling of one IDX ticker, session by session (oldest first), from IDX's daily trading summary: foreign buy, sell and net volume in shares, `foreign_net_value` (net shares at the session's average price, an estimate, IDR), `change_bps`, and `non_regular_bps` (share of value traded outside the regular board). Totals cover the whole range; `foreign_share_bps` is foreign investors' share of trading. End of day.", + "description": "Foreign investors' buying and selling of one IDX ticker, session by session (oldest first), from IDX's daily trading summary: foreign buy, sell and net volume in shares, `foreign_net_value` (net shares at the session's average price, an estimate, IDR), `change_bps`, and `non_regular_bps` (share of all value traded outside the regular board). Volume, value and foreign figures are the regular board. Totals cover the whole range; `foreign_share_bps` is foreign investors' share of regular-board trading. End of day.", "inputSchema": { "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index c1948f7..43d9435 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -115,7 +115,11 @@ WIB as the fallback. - `GET https://www.idx.co.id/primary/TradingSummary/GetStockSummary` `?length=9999&start=0&date=YYYYMMDD` answers one JSON row per stock for the session: prices, volume, value, `ForeignBuy`/`ForeignSell` (shares) and - non-regular volume and value. A day without trading has no rows; rows dated + non-regular volume and value. `Volume`, `Value` and the foreign figures are + the regular board only: IPOT's regular-board total for BBCA on 2026-10-16 + matches `Value`, and in a week of every stock no foreign figure exceeded + regular volume. `non_regular_bps` is therefore over regular plus + non-regular value. A day without trading has no rows; rows dated another day are dropped. `api/idx/parse.rs` parses it purely. - Cloudflare rejects most TLS fingerprints (in October 2026 only `curl_safari184` passed), so the request uses curl-impersonate's profile diff --git a/web/src/content/docs/cli/stocks.md b/web/src/content/docs/cli/stocks.md index 03828c5..e5fab6a 100644 --- a/web/src/content/docs/cli/stocks.md +++ b/web/src/content/docs/cli/stocks.md @@ -57,7 +57,8 @@ idx stocks flow BBCA --from 2026-10-01 --to 2026-10-16 What foreign investors bought and sold, session by session: buy, sell and net volume in shares, the net value at each session's average price (an -estimate), and the share of value traded outside the regular board. The +estimate), and the share of all value traded outside the regular board. +Volume, value and the foreign figures are IDX's regular-board figures. The footer gives the net over the range and foreign investors' share of trading. Without dates it shows the latest 10 sessions (`--days`, at most 60). diff --git a/web/src/content/docs/mcp/tools.md b/web/src/content/docs/mcp/tools.md index 215939b..110371a 100644 --- a/web/src/content/docs/mcp/tools.md +++ b/web/src/content/docs/mcp/tools.md @@ -65,7 +65,7 @@ Company data for one IDX ticker: profile, financial statements, earnings, analys ## `get_foreign_flow` -Foreign investors' buying and selling of one IDX ticker, session by session (oldest first), from IDX's daily trading summary: foreign buy, sell and net volume in shares, `foreign_net_value` (net shares at the session's average price, an estimate, IDR), `change_bps`, and `non_regular_bps` (share of value traded outside the regular board). Totals cover the whole range; `foreign_share_bps` is foreign investors' share of trading. End of day. +Foreign investors' buying and selling of one IDX ticker, session by session (oldest first), from IDX's daily trading summary: foreign buy, sell and net volume in shares, `foreign_net_value` (net shares at the session's average price, an estimate, IDR), `change_bps`, and `non_regular_bps` (share of all value traded outside the regular board). Volume, value and foreign figures are the regular board. Totals cover the whole range; `foreign_share_bps` is foreign investors' share of regular-board trading. End of day. | Input | Type | Required | Description | | --- | --- | --- | --- |