Allow jq sells when snapshot last stays above limit
This commit is contained in:
@@ -53,7 +53,11 @@ impl ChinaEquityRuleHooks {
|
||||
}
|
||||
|
||||
fn at_lower_limit(snapshot: &DailyMarketSnapshot, price_field: PriceField) -> bool {
|
||||
snapshot.is_at_lower_limit_price(snapshot.sell_price(price_field))
|
||||
let check_price = match price_field {
|
||||
PriceField::Last => snapshot.price(PriceField::Last),
|
||||
_ => snapshot.sell_price(price_field),
|
||||
};
|
||||
snapshot.is_at_lower_limit_price(check_price)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1050,10 +1050,11 @@ impl JqMicroCapStrategy {
|
||||
let Ok(candidate) = ctx.data.require_candidate(date, symbol) else {
|
||||
return false;
|
||||
};
|
||||
let lower_limit_check_price = market.price(PriceField::Last);
|
||||
!(market.paused
|
||||
|| candidate.is_paused
|
||||
|| !candidate.allow_sell
|
||||
|| market.is_at_lower_limit_price(market.sell_price(PriceField::Last)))
|
||||
|| market.is_at_lower_limit_price(lower_limit_check_price))
|
||||
}
|
||||
|
||||
fn buy_rejection_reason(
|
||||
|
||||
Reference in New Issue
Block a user