parent
a7079454a2
commit
1ae5eb25db
@ -1,3 +1,5 @@ |
|||||||
/target |
/target |
||||||
/Cargo.lock |
/Cargo.lock |
||||||
to-do.txt |
to-do.txt |
||||||
|
*.png |
||||||
|
*.pdf |
||||||
@ -0,0 +1,47 @@ |
|||||||
|
use crate::data::AssetDataObject; |
||||||
|
|
||||||
|
|
||||||
|
pub enum Direction { |
||||||
|
Buy, |
||||||
|
Sell |
||||||
|
} |
||||||
|
impl ToString for Direction { |
||||||
|
fn to_string(&self) -> String { |
||||||
|
match &self { |
||||||
|
Self::Buy => "Buy".to_string(), |
||||||
|
Self::Sell => "Sell".to_string() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
pub enum OrderType { |
||||||
|
Market, |
||||||
|
Limit, |
||||||
|
Stop, |
||||||
|
TrailingStop |
||||||
|
}
|
||||||
|
impl ToString for OrderType { |
||||||
|
fn to_string(&self) -> String { |
||||||
|
match &self { |
||||||
|
Self::Market => "Market".to_string(), |
||||||
|
Self::Limit => "Limit".to_string(), |
||||||
|
Self::Stop => "Stop".to_string(), |
||||||
|
Self::TrailingStop => "TrailingStop".to_string() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
pub struct SimpleOrder { |
||||||
|
pub asset: AssetDataObject, |
||||||
|
pub price_to_pay: f64, |
||||||
|
pub direction: Direction, |
||||||
|
pub order_type: OrderType, |
||||||
|
pub good_until: i64, |
||||||
|
pub approved: bool |
||||||
|
} |
||||||
|
|
||||||
|
pub struct CompoundOrder { |
||||||
|
pub orders: Vec<SimpleOrder>, |
||||||
|
pub approved: bool |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue