Watchlists
alpaca-trade::Client::watchlists() exposes the full adopted watchlist resource family.
Implemented Methods
listcreateget_by_idupdate_by_iddelete_by_idadd_asset_by_iddelete_symbol_by_idget_by_nameupdate_by_nameadd_asset_by_namedelete_by_name
All 11 canonical Watchlist operations are closed against both Paper and the standalone mock HTTP service.
Typical Request
use alpaca_trade::{Client, watchlists};
let client = Client::from_env()?;
let watchlist = client
.watchlists()
.create(watchlists::CreateRequest {
name: "core-tech".into(),
symbols: Some(vec!["AAPL".into(), "MSFT".into()]),
})
.await?;
# let _ = watchlist;
# Ok::<(), alpaca_trade::Error>(())
Notes
- both id-based and name-based official routes are supported
- this crate keeps the official route split instead of collapsing it into a custom abstraction
- create accepts an omitted or empty symbol list
- update is partial: it accepts name-only or symbols-only changes, and an empty symbol list clears the watchlist
- Paper rejects a
nullsymbol item even though the canonical array item is nullable, so the Rust request usesVec<String>rather thanVec<Option<String>> - returned
assetsremains optional because it is not required by the canonical schema; successful Paper/mock lifecycle responses include an array - the mock keeps per-account ordered state, unique names, ID/name lookup, and deletion behavior over the same HTTP routes