补充策略规格解析能力

This commit is contained in:
boris
2026-04-28 19:40:09 +08:00
parent 52a8bced13
commit 236ec62e44
3 changed files with 1048 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ pub mod futures;
pub mod instrument;
pub mod metrics;
pub mod platform_expr_strategy;
pub mod platform_strategy_spec;
pub mod portfolio;
pub mod rules;
pub mod scheduler;
@@ -49,6 +50,15 @@ pub use platform_expr_strategy::{
PlatformRebalanceSchedule, PlatformScheduleFrequency, PlatformTradeAction,
PlatformUniverseActionKind,
};
pub use platform_strategy_spec::{
DynamicRangeConfig, IndexThrottleConfig, MovingAverageFilterConfig, SkipWindowConfig,
StrategyBenchmarkSpec, StrategyEngineConfig, StrategyExecutionSpec,
StrategyExpressionActionConfig, StrategyExpressionAllocationConfig,
StrategyExpressionOrderingConfig, StrategyExpressionRiskConfig,
StrategyExpressionScheduleConfig, StrategyExpressionSelectionConfig,
StrategyExpressionTradingConfig, StrategyRuntimeEnvironment, StrategyRuntimeExpressions,
StrategyRuntimeSpec, platform_expr_config_from_spec, platform_expr_config_from_value,
};
pub use portfolio::{CashReceivable, HoldingSummary, PendingCashFlow, PortfolioState, Position};
pub use rules::{ChinaEquityRuleHooks, EquityRuleHooks, RuleCheck};
pub use scheduler::{

File diff suppressed because it is too large Load Diff

View File

@@ -1675,6 +1675,7 @@ impl OmniMicroCapStrategy {
.max(1)
}
#[allow(dead_code)]
fn projected_buy_quantity(&self, cash: f64, sizing_price: f64, execution_price: f64) -> u32 {
if cash <= 0.0 || sizing_price <= 0.0 || execution_price <= 0.0 {
return 0;
@@ -1856,6 +1857,7 @@ impl OmniMicroCapStrategy {
Some(fill.quantity)
}
#[allow(dead_code)]
fn projected_market_fillable_quantity(
&self,
ctx: &StrategyContext<'_>,