限制同轮补仓重复释放槽位
This commit is contained in:
@@ -8125,7 +8125,6 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
let mut intraday_attempted_buys = BTreeSet::<String>::new();
|
let mut intraday_attempted_buys = BTreeSet::<String>::new();
|
||||||
let mut same_bar_buy_symbols = BTreeSet::<String>::new();
|
let mut same_bar_buy_symbols = BTreeSet::<String>::new();
|
||||||
let mut delayed_sold_symbols = BTreeSet::<String>::new();
|
let mut delayed_sold_symbols = BTreeSet::<String>::new();
|
||||||
let mut delayed_exit_slot_blocking_symbols = BTreeSet::<String>::new();
|
|
||||||
let mut unresolved_stop_loss_symbols = BTreeSet::<String>::new();
|
let mut unresolved_stop_loss_symbols = BTreeSet::<String>::new();
|
||||||
let mut pending_risk_level_forced_exit_symbols = BTreeSet::<String>::new();
|
let mut pending_risk_level_forced_exit_symbols = BTreeSet::<String>::new();
|
||||||
let delayed_limit_exit_time = self
|
let delayed_limit_exit_time = self
|
||||||
@@ -8229,7 +8228,6 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
end_time: Some(delayed_limit_exit_time),
|
end_time: Some(delayed_limit_exit_time),
|
||||||
reason: "delayed_limit_open_sell".to_string(),
|
reason: "delayed_limit_open_sell".to_string(),
|
||||||
});
|
});
|
||||||
delayed_exit_slot_blocking_symbols.insert(symbol.clone());
|
|
||||||
self.forget_position_entry_date(&symbol);
|
self.forget_position_entry_date(&symbol);
|
||||||
let projected_sold = if ctx
|
let projected_sold = if ctx
|
||||||
.data
|
.data
|
||||||
@@ -8334,7 +8332,7 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
let daily_top_up_target_budget = aiquant_total_value * trading_ratio;
|
let daily_top_up_target_budget = aiquant_total_value * trading_ratio;
|
||||||
let mut daily_top_up_pending_buy_value = 0.0_f64;
|
let mut daily_top_up_pending_buy_value = 0.0_f64;
|
||||||
let mut pending_full_close_symbols = BTreeSet::<String>::new();
|
let mut pending_full_close_symbols = BTreeSet::<String>::new();
|
||||||
let mut slot_blocking_symbols = delayed_exit_slot_blocking_symbols.clone();
|
let mut slot_blocking_symbols = BTreeSet::<String>::new();
|
||||||
let mut interleaved_pending_full_close_symbols = BTreeSet::<String>::new();
|
let mut interleaved_pending_full_close_symbols = BTreeSet::<String>::new();
|
||||||
let risk_level_forced_exit_time = self.risk_level_forced_exit_time();
|
let risk_level_forced_exit_time = self.risk_level_forced_exit_time();
|
||||||
self.pending_full_close_symbols.retain(|symbol| {
|
self.pending_full_close_symbols.retain(|symbol| {
|
||||||
@@ -8667,6 +8665,9 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
target_value: 0.0,
|
target_value: 0.0,
|
||||||
reason: "pending_full_close_exit".to_string(),
|
reason: "pending_full_close_exit".to_string(),
|
||||||
});
|
});
|
||||||
|
if daily_top_up_pending_buy_value > 0.0 {
|
||||||
|
slot_blocking_symbols.insert(position.symbol.clone());
|
||||||
|
}
|
||||||
self.forget_position_entry_date(&position.symbol);
|
self.forget_position_entry_date(&position.symbol);
|
||||||
let can_sell = defer_execution_risk
|
let can_sell = defer_execution_risk
|
||||||
|| self.can_sell_position(ctx, execution_date, &position.symbol);
|
|| self.can_sell_position(ctx, execution_date, &position.symbol);
|
||||||
@@ -8757,6 +8758,9 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
target_value: 0.0,
|
target_value: 0.0,
|
||||||
reason: "stop_loss_exit".to_string(),
|
reason: "stop_loss_exit".to_string(),
|
||||||
});
|
});
|
||||||
|
if daily_top_up_pending_buy_value > 0.0 {
|
||||||
|
slot_blocking_symbols.insert(position.symbol.clone());
|
||||||
|
}
|
||||||
self.forget_position_entry_date(&position.symbol);
|
self.forget_position_entry_date(&position.symbol);
|
||||||
slot_working_symbols.remove(&position.symbol);
|
slot_working_symbols.remove(&position.symbol);
|
||||||
if can_sell {
|
if can_sell {
|
||||||
@@ -8825,6 +8829,9 @@ impl Strategy for PlatformExprStrategy {
|
|||||||
target_value: 0.0,
|
target_value: 0.0,
|
||||||
reason: "take_profit_exit".to_string(),
|
reason: "take_profit_exit".to_string(),
|
||||||
});
|
});
|
||||||
|
if daily_top_up_pending_buy_value > 0.0 {
|
||||||
|
slot_blocking_symbols.insert(position.symbol.clone());
|
||||||
|
}
|
||||||
self.forget_position_entry_date(&position.symbol);
|
self.forget_position_entry_date(&position.symbol);
|
||||||
slot_working_symbols.remove(&position.symbol);
|
slot_working_symbols.remove(&position.symbol);
|
||||||
if can_sell {
|
if can_sell {
|
||||||
|
|||||||
Reference in New Issue
Block a user