1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
use crate::lowercase_enum_display;
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
pub enum Status {
New,
/// The order has changed.
Replaced,
/// The order has been partially filled.
PartiallyFilled,
/// The order has been filled, and no further updates will occur for
/// the order.
Filled,
/// The order is done executing for the day, and will not receive
/// further updates until the next trading day.
DoneForDay,
/// The order has been canceled.
Canceled,
/// The order has expired, and no further updates will occur for the
/// order.
Expired,
/// The order has been received by the financial platform, but hasn't yet been routed
/// to the execution venue.
Accepted,
/// The order has been received by financial platform, and routed to the
/// exchanges, but has not yet been accepted for execution.
PendingNew,
/// The order has been received by exchanges, and is evaluated for
/// pricing.
AcceptedForBidding,
/// The order is waiting to be canceled.
PendingCancel,
/// The order is awaiting replacement.
PendingReplace,
/// The order has been stopped, and a trade is guaranteed for the
/// order, usually at a stated price or better, but has not yet
/// occurred
Stopped,
/// The order has been rejected, and no further updates will occur for
/// the order.
Rejected,
/// The order has been suspended, and is not eligible for trading.
Suspended,
/// The order has been completed for the day (either filled or done
/// for day), but remaining settlement calculations are still pending.
Calculated,
/// The order is still being held. This may be the case for legs of
/// bracket-style orders that are not active yet because the primary
/// order has not filled yet.
Held,
#[default]
Unknown,
}
lowercase_enum_display!(Status);
#[cfg(test)]
mod test {
use crate::platform::order::status::Status;
#[test]
fn display() {
let status_str = Status::New.to_string();
assert_eq!(status_str, "new")
}
#[test]
fn default() {
let status: Status = Default::default();
assert_eq!(status, Status::Unknown)
}
}