mirror of
https://github.com/0xrsydn/idx-cli.git
synced 2026-11-07 09:45:36 +00:00
Merge branch 'feat/stockbit-corpaction' into feat/stockbit-movements
Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
commit
5a6b5d1e2e
26 changed files with 430 additions and 81 deletions
|
|
@ -198,6 +198,7 @@ What the login adds:
|
|||
| --- | --- | --- |
|
||||
| `--provider stockbit` quotes | public page, delayed | Stockbit's API, live |
|
||||
| Bid and offer in quotes | best price, while open | best price, while open |
|
||||
| `market_status` in quotes | `open` or `close` | `open` or `close` |
|
||||
| `stocks orderbook` | `AUTHERROR` | every level with lots and queued orders, OHLC, value, trades; foreign buy/sell/net once Stockbit marks them current |
|
||||
| `stocks history` under `--provider stockbit` | Yahoo | Stockbit's daily candles for `5d` to `1y`; Yahoo for other windows |
|
||||
| `stocks intraday` | public page | public page |
|
||||
|
|
@ -211,7 +212,14 @@ the previous session's, so idx leaves them out (`stocks flow` has foreign
|
|||
flow session by session). Sizes are lots in the
|
||||
table and shares in JSON. `--history-provider stockbit` asks for Stockbit's
|
||||
candles explicitly; windows it charts only weekly or hourly (`2y`, `5y`,
|
||||
`1wk`) answer `UNSUPPORTED`.
|
||||
`1wk`) answer `UNSUPPORTED`. If Stockbit refuses a stored session, `auto`
|
||||
history falls back to Yahoo with a warning; an explicit
|
||||
`--history-provider stockbit` fails with `AUTHERROR`.
|
||||
|
||||
`market_status` in quotes is `open` while the regular market trades and
|
||||
`close` otherwise, including the lunch break and auctions, with or without a
|
||||
login. `stocks orderbook` keeps Stockbit's state verbatim
|
||||
(`STATE_NAME_SESSION_2`, `STATE_NAME_BREAK`, ...).
|
||||
|
||||
## Terms
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@ idx -o json stocks intraday BBCA | jq '.points[-1]'
|
|||
`intraday` shows today's session from Stockbit's public page, without a
|
||||
login: the quote, the best bid and offer while the market is open, a
|
||||
sparkline and the last five minutes. JSON gives every minute in `points`. It
|
||||
is delayed at least 10 minutes. See [Stockbit](/cli/stockbit/) for what it
|
||||
is delayed at least 10 minutes. A chart from before the latest session is
|
||||
noted under the header and sets `quote.behind_session`, as with quotes. See [Stockbit](/cli/stockbit/) for what it
|
||||
covers and the terms it comes with.
|
||||
|
||||
## Order book (Stockbit login)
|
||||
|
|
@ -61,7 +62,10 @@ exposes and tender offers (`--kind ipo` adds its IPO). `calendar` lists them
|
|||
across the market between `--from` and `--to` (at most 366 days), including
|
||||
what is announced ahead. An action's date is its cum date for dividends,
|
||||
bonuses, rights and splits: buy by then to be entitled. For the others it is
|
||||
the event's first day. Dividends per share keep their decimals (`Rp 3.8`).
|
||||
the event's first day. When Stockbit gives no cum date, the action sits on
|
||||
its ex date, marked `(ex)` in the table, and JSON leaves `cum_date` out.
|
||||
Dividends per share keep their decimals (`Rp 3.8`); one not paid in Rupiah
|
||||
carries `currency` (e.g. `USD`). JSON's `kind` is the name `--kind` takes.
|
||||
|
||||
Both need your Stockbit session and answer `AUTHERROR` without one. Stockbit
|
||||
serves one kind per request, 1 s apart, so a first call with every kind takes
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ Company data for one IDX ticker: profile, financial statements, earnings, analys
|
|||
|
||||
## `get_corporate_actions`
|
||||
|
||||
Corporate actions of one IDX stock from the user's own Stockbit session, newest first: `kind` (dividend, stock-dividend, bonus, rights, warrant, split, reverse-split, meeting, expose, ipo, tender), `date` (the cum date for dividends, bonuses, rights and splits, i.e. the last day to buy and be entitled; else the event's first day), `ex_date`, `record_date`, `pay_date`, and per kind `cash_per_share` (IDR, may have decimals), `ratio` {old, new} (1:5 split = 1 share becomes 5; 655:104 rights = 104 rights per 655 held), `factor` (price adjustment), `price` (rights, warrant exercise, tender or IPO price, IDR), `period` and `exercise` {start, end}, `shares`, `percentage_bps`, `time`, `venue`. Absent fields are omitted. One Stockbit request per kind (about 1 s each on a cold cache, then cached 6 hours). AUTHERROR means there is no session: call stockbit_status, then stockbit_login.
|
||||
Corporate actions of one IDX stock from the user's own Stockbit session, newest first: `kind` (dividend, stock-dividend, bonus, rights, warrant, split, reverse-split, meeting, expose, ipo, tender), `date` (the cum date for dividends, bonuses, rights and splits, i.e. the last day to buy and be entitled, or the ex date when `cum_date` is absent; else the event's first day), `ex_date`, `record_date`, `pay_date`, and per kind `cash_per_share` (IDR, may have decimals; in `currency`, an ISO code, when that is present), `ratio` {old, new} (1:5 split = 1 share becomes 5; 655:104 rights = 104 rights per 655 held), `factor` (price adjustment), `price` (rights, warrant exercise, tender or IPO price, IDR), `period` and `exercise` {start, end}, `shares`, `percentage_bps`, `time`, `venue`. Absent fields are omitted. One Stockbit request per kind (about 1 s each on a cold cache, then cached 6 hours). AUTHERROR means there is no session: call stockbit_status, then stockbit_login.
|
||||
|
||||
| Input | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
|
|
@ -96,7 +96,7 @@ Foreign investors' buying and selling of one IDX ticker, session by session (old
|
|||
|
||||
## `get_intraday`
|
||||
|
||||
Today's session of one IDX stock or index from Stockbit's public page (no login), whichever provider the server uses: `quote` (price, change, volume, `market_status`, `bid`/`offer` only while the market is open, `session_note`) and `points`, the price per minute in WIB, oldest first. Delayed at least 10 minutes; no per-minute volume. Empty `points` means the stock did not trade this session (see `session_note`), not an error. UPSTREAMBLOCKED means stockbit.com refused this machine (HTTP 403): do not retry at once.
|
||||
Today's session of one IDX stock or index from Stockbit's public page (no login), whichever provider the server uses: `quote` (price, change, volume, `market_status`, `bid`/`offer` only while the market is open, `session_note`) and `points`, the price per minute in WIB, oldest first. Delayed at least 10 minutes; no per-minute volume. Empty `points` means the stock did not trade this session (see `session_note`), not an error. `quote.behind_session` is true when the chart is from before the latest IDX session (a holiday, or Stockbit lagging), as in get_quotes. UPSTREAMBLOCKED means stockbit.com refused this machine (HTTP 403): do not retry at once.
|
||||
|
||||
| Input | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
|
|
@ -144,7 +144,7 @@ OHLCV price history for one IDX ticker.
|
|||
|
||||
## `get_quotes`
|
||||
|
||||
Latest quotes (price, change, volume, 52-week range, market cap) for one or more IDX tickers. `as_of` is the last trade in WIB; `behind_session` is true when that is before the latest IDX session, so the price is not that session's close: the provider lags, the stock did not trade, or the day was an exchange holiday. When the server runs with the stockbit provider, quotes also carry `market_status` (Stockbit's, e.g. "open", "close"), `bid`/`offer` (best price, only while the market is open) and `session_note` (suspended, delisted, no trades); Stockbit data is delayed at least 10 minutes.
|
||||
Latest quotes (price, change, volume, 52-week range, market cap) for one or more IDX tickers. `as_of` is the last trade in WIB; `behind_session` is true when that is before the latest IDX session, so the price is not that session's close: the provider lags, the stock did not trade, or the day was an exchange holiday. When the server runs with the stockbit provider, quotes also carry `market_status` ("open" while the regular market trades, else "close", with or without a login), `bid`/`offer` (best price, only while the market is open) and `session_note` (suspended, delisted, no trades); Stockbit data is delayed at least 10 minutes.
|
||||
|
||||
| Input | Type | Required | Description |
|
||||
| --- | --- | --- | --- |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue