ClientOptimizer

Implements IOptimizer

Client implementation for optimizer operations.

Features:

  • Data collection from multiple sources with pagination
  • LLM conversation history building
  • Strategy code generation with templates
  • File export with callbacks

Used by OptimizerConnectionService to create optimizer instances.

constructor(params: IOptimizerParams, onProgress: (progress: ProgressOptimizerContract) => void);
params: IOptimizerParams
onProgress: (progress: ProgressOptimizerContract) => void
getData: (symbol: string) => Promise<IOptimizerStrategy[]>

Fetches data from all sources and generates strategy metadata. Processes each training range and builds LLM conversation history.

getCode: (symbol: string) => Promise<string>

Generates complete executable strategy code. Includes imports, helpers, strategies, walker, and launcher.

dump: (symbol: string, path?: string) => Promise<void>

Generates and saves strategy code to file. Creates directory if needed, writes .mjs file.