Skip to main content

brokapi_finam/map/
mod.rs

1//! Translation between Finam protobuf messages and `brokapi-core` types.
2//!
3//! Pure functions, no network. Decimals arrive as strings and become exact `Decimal` numbers (an absent or unparseable
4//! value becomes 0 or `None`, as each function says). Times arrive as protobuf timestamps and become
5//! Unix nanoseconds.
6//!
7//! | Module | Maps |
8//! |---|---|
9//! | [`instrument`] | directory entries, trading parameters, schedules |
10//! | [`market`] | order book rows, quotes, trades, bars |
11//! | [`m10`] | 10-minute candles built from 5-minute ones |
12//! | [`order`] | plain orders: statuses, requests |
13//! | [`stop`] | stop orders: `STOP`, `STOP_LIMIT`, SL/TP |
14//! | [`portfolio`] | account state, own trades |
15//!
16//! # Examples
17//!
18//! ```
19//! use brokapi_finam::map::instrument::kind_from_type;
20//! use brokapi_core::InstrumentKind;
21//!
22//! // Finam's instrument types are not enumerated in its docs: they are matched by substring.
23//! assert_eq!(kind_from_type("EQUITIES"), InstrumentKind::Stock);
24//! assert_eq!(kind_from_type("BONDS"), InstrumentKind::Bond);
25//! ```
26
27pub mod instrument;
28pub mod m10;
29pub mod market;
30pub mod order;
31pub mod portfolio;
32pub mod stop;