Implements TPartial
Global service for partial profit/loss tracking.
Thin delegation layer that forwards operations to PartialConnectionService. Provides centralized logging for all partial operations at the global level.
Architecture:
Purpose:
constructor();
loggerService: any
Logger service injected from DI container. Used for logging operations at global service level.
partialConnectionService: any
Connection service injected from DI container. Handles actual ClientPartial instance creation and management.
strategyValidationService: any
Strategy validation service for validating strategy existence.
strategySchemaService: any
Strategy schema service for retrieving strategy configuration.
riskValidationService: any
Risk validation service for validating risk existence.
exchangeValidationService: any
Exchange validation service for validating exchange existence.
frameValidationService: any
Frame validation service for validating frame existence.
validate: any
Validates strategy and associated risk configuration. Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
profit: (symbol: string, data: IPublicSignalRow, currentPrice: number, revenuePercent: number, backtest: boolean, when: Date) => Promise<void>
Processes profit state and emits events for newly reached profit levels.
Logs operation at global service level, then delegates to PartialConnectionService.
loss: (symbol: string, data: IPublicSignalRow, currentPrice: number, lossPercent: number, backtest: boolean, when: Date) => Promise<void>
Processes loss state and emits events for newly reached loss levels.
Logs operation at global service level, then delegates to PartialConnectionService.
clear: (symbol: string, data: IPublicSignalRow, priceClose: number, backtest: boolean) => Promise<void>
Clears partial profit/loss state when signal closes.
Logs operation at global service level, then delegates to PartialConnectionService.