ScheduleMarkdownService

Service for generating and saving scheduled signals markdown reports.

Features:

  • Listens to scheduled and cancelled signal events via signalLiveEmitter
  • Accumulates all events (scheduled, cancelled) per strategy
  • Generates markdown tables with detailed event information
  • Provides statistics (cancellation rate, average wait time)
  • Saves reports to disk in logs/schedule/{strategyName}.md
constructor();
loggerService: any

Logger service for debug output

getStorage: any

Memoized function to get or create ReportStorage for a symbol-strategy pair. Each symbol-strategy combination gets its own isolated storage instance.

tick: any

Processes tick events and accumulates scheduled/cancelled events. Should be called from signalLiveEmitter subscription.

Processes only scheduled and cancelled event types.

getData: (symbol: string, strategyName: string) => Promise<ScheduleStatistics>

Gets statistical data from all scheduled signal events for a symbol-strategy pair. Delegates to ReportStorage.getData().

getReport: (symbol: string, strategyName: string) => Promise<string>

Generates markdown report with all scheduled events for a symbol-strategy pair. Delegates to ReportStorage.getReport().

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

Saves symbol-strategy report to disk. Creates directory if it doesn't exist. Delegates to ReportStorage.dump().

clear: (ctx?: { symbol: string; strategyName: string; }) => Promise<void>

Clears accumulated event data from storage. If ctx is provided, clears only that specific symbol-strategy pair's data. If nothing is provided, clears all data.

init: (() => Promise<void>) & ISingleshotClearable

Initializes the service by subscribing to live signal events. Uses singleshot to ensure initialization happens only once. Automatically called on first use.