Align board-specific stock order sizing

This commit is contained in:
boris
2026-04-22 23:12:23 -07:00
parent 7a67e815d7
commit d4f4af6221
3 changed files with 242 additions and 38 deletions

View File

@@ -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)