Align board-specific stock order sizing
This commit is contained in:
@@ -20,6 +20,21 @@ impl Instrument {
|
||||
self.round_lot.max(1)
|
||||
}
|
||||
|
||||
pub fn minimum_order_quantity(&self) -> u32 {
|
||||
match self.board.trim().to_ascii_uppercase().as_str() {
|
||||
"KSH" => 200,
|
||||
"BJS" | "BJ" | "BJSE" => 100,
|
||||
_ => self.effective_round_lot(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn order_step_size(&self) -> u32 {
|
||||
match self.board.trim().to_ascii_uppercase().as_str() {
|
||||
"KSH" | "BJS" | "BJ" | "BJSE" => 1,
|
||||
_ => self.effective_round_lot(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_delisted_before(&self, date: NaiveDate) -> bool {
|
||||
self.delisted_at
|
||||
.is_some_and(|delisted_at| delisted_at < date)
|
||||
|
||||
Reference in New Issue
Block a user