Files
ai-exchange/migrations/018_create_backtest_results.sql
2026-04-24 13:39:01 +08:00

21 lines
680 B
SQL

create table if not exists backtest_results (
id bigserial primary key,
backtest_run_id bigint not null references backtest_runs(id),
signal_id bigint references trade_signals(id),
outcome text not null,
mfe numeric(20,10),
mae numeric(20,10),
tp1_hit boolean,
tp2_hit boolean,
invalidated_before_entry boolean,
error_tags jsonb not null default '[]'::jsonb,
meta jsonb not null default '{}'::jsonb,
created_at timestamptz not null default now()
);
create index if not exists idx_backtest_results_run_id
on backtest_results (backtest_run_id);
create index if not exists idx_backtest_results_outcome
on backtest_results (outcome);