Phase 5 plan replay backtest
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
alter table if exists backtest_runs
|
||||
add column if not exists subject_type text,
|
||||
add column if not exists trading_plan_id bigint references trading_plans(id),
|
||||
add column if not exists candidate_model_code text;
|
||||
|
||||
update backtest_runs
|
||||
set subject_type = coalesce(subject_type, 'signal');
|
||||
|
||||
create index if not exists idx_backtest_runs_subject_started_desc
|
||||
on backtest_runs (subject_type, started_ts desc);
|
||||
|
||||
create index if not exists idx_backtest_runs_plan_started_desc
|
||||
on backtest_runs (trading_plan_id, started_ts desc);
|
||||
|
||||
alter table if exists backtest_results
|
||||
add column if not exists trading_plan_id bigint references trading_plans(id),
|
||||
add column if not exists candidate_id bigint references trade_plan_candidates(id),
|
||||
add column if not exists candidate_model_code text;
|
||||
|
||||
create index if not exists idx_backtest_results_plan_id
|
||||
on backtest_results (trading_plan_id, id desc);
|
||||
|
||||
create index if not exists idx_backtest_results_candidate_id
|
||||
on backtest_results (candidate_id, id desc);
|
||||
Reference in New Issue
Block a user