continuation
This commit is contained in:
parent
32e43c9243
commit
879e9b4228
42 changed files with 2607 additions and 1306 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import type { BacktestRunResult } from '@stock-bot/types';
|
||||
import { browserLog } from '@/utils/browserLog';
|
||||
import type { BacktestMetrics, Position, Trade } from '../types/backtest.types';
|
||||
|
||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:2003';
|
||||
|
||||
|
|
@ -46,39 +46,7 @@ export interface CreateRunRequest {
|
|||
speedMultiplier?: number | null;
|
||||
}
|
||||
|
||||
export interface RunResult {
|
||||
runId: string;
|
||||
backtestId: string;
|
||||
status: 'completed';
|
||||
completedAt: string;
|
||||
config: {
|
||||
name: string;
|
||||
strategy: string;
|
||||
symbols: string[];
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
initialCapital: number;
|
||||
commission: number;
|
||||
slippage: number;
|
||||
dataFrequency: string;
|
||||
};
|
||||
metrics: BacktestMetrics;
|
||||
equity: { date: string; value: number }[];
|
||||
ohlcData: Record<
|
||||
string,
|
||||
{ timestamp: number; open: number; high: number; low: number; close: number; volume?: number }[]
|
||||
>;
|
||||
trades: Trade[];
|
||||
positions: Position[] | Record<string, Omit<Position, 'symbol'>>;
|
||||
analytics: {
|
||||
exposureTime?: number;
|
||||
drawdownSeries?: { timestamp: number; value: number }[];
|
||||
dailyReturns?: number[];
|
||||
monthlyReturns?: Record<string, number>;
|
||||
riskMetrics?: Record<string, number>;
|
||||
};
|
||||
executionTime: number;
|
||||
}
|
||||
export type RunResult = BacktestRunResult;
|
||||
|
||||
export const backtestApiV2 = {
|
||||
// Backtest operations
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue