修复回测撮合与AiQuant兼容语义

This commit is contained in:
boris
2026-05-18 23:06:47 +08:00
parent 3f383c1a88
commit 6e54471e57
4 changed files with 793 additions and 95 deletions

View File

@@ -2388,11 +2388,6 @@ impl OmniMicroCapStrategy {
{
return Ok(Some("upper_limit".to_string()));
}
if market.is_at_lower_limit_price(market.day_open)
|| market.is_at_lower_limit_price(market.sell_price(PriceField::Last))
{
return Ok(Some("lower_limit".to_string()));
}
if market.day_open <= 1.0 {
return Ok(Some("one_yuan".to_string()));
}
@@ -2744,8 +2739,7 @@ impl Strategy for OmniMicroCapStrategy {
let stop_hit = current_price
<= position.average_cost * self.config.stop_loss_ratio
+ self.stop_loss_tolerance(market);
let profit_hit = !market.is_at_upper_limit_price(current_price)
&& current_price / position.average_cost > self.config.take_profit_ratio;
let profit_hit = current_price / position.average_cost > self.config.take_profit_ratio;
let can_sell = self.can_sell_position(ctx, date, &position.symbol);
if stop_hit || profit_hit {
let sell_reason = if stop_hit {