stock-trek 0.8.15

Stock Trek time-series analysis
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::cex::{asset_id::AssetId, cex_id::CexId, order_tag::OrderTag};

pub type Portfolio = Box<dyn PortfolioTrait>;

pub trait PortfolioTrait {
    fn has_account_in_cex(&self, cex_id: &CexId) -> bool;
    fn owns_asset(&self, asset_id: &AssetId) -> bool;
    fn owns_asset_in_cex(&self, asset_id: &AssetId, cex_id: &CexId) -> bool;
    fn asset_total(&self, asset_id: &AssetId) -> f64;
    fn asset_in_cex(&self, asset_id: &AssetId, cex_id: &CexId) -> f64;
    fn active_orders(&self) -> f64;
    fn active_orders_with_tag(&self, order_tag: &OrderTag) -> f64;
    fn active_orders_in_cex(&self, cex_id: &CexId) -> f64;
    fn active_orders_in_cex_with_tag(&self, cex_id: &CexId, order_tag: &OrderTag) -> f64;
}