This document covers the signal generation and validation system, which is responsible for determining when to create new trading signals and when to close existing ones. The system implements automated validation rules based on technical analysis indicators, price movements, and timing constraints to ensure safe and profitable trading decisions.
For information about signal execution and management after validation, see Signal Logic and Management. For details on the automated job processing that triggers signal validation, see Automated Job Processing.
The signal validation system acts as the decision-making engine that determines whether trading signals should be executed or resolved. It analyzes market conditions, existing positions, and technical indicators to make data-driven trading decisions while implementing risk management rules to prevent losses.
The system works with standardized signal data structures that define the properties and state of trading signals:
Property | Type | Description |
---|---|---|
symbol |
string | Trading pair (e.g., "BTCUSDT") |
quantity |
number | Amount to trade |
buyPrice |
number | Entry price for the position |
sellPrice |
number | Target exit price |
stopLossPrice |
number | Stop loss price (optional) |
possibilityPercent |
number | Confidence percentage (optional) |
resolved |
boolean | Whether signal is closed |
ignore |
boolean | Whether to ignore this signal |
date |
Date | Signal creation timestamp |
comment |
string | Additional information |
The validateExecute
method determines whether a new trading signal should be created. It implements multiple validation layers:
The validation process includes:
The system analyzes EMA (Exponential Moving Average) signals to determine market sentiment:
The validateShouldExecute
function implements these rules:
The validateResolve
method determines when to close existing positions:
The resolution logic:
CC_LADDER_TRADE_REVENUE
)The validation system uses several configuration parameters to control trading behavior:
Parameter | Purpose | Effect |
---|---|---|
CC_LADDER_FAIL_HOURS |
Price fall timeout | Prevents rapid reentry after price drops |
CC_LADDER_GROWTH_HOURS |
Price growth timeout | Prevents rapid reentry after price rises |
CC_LADDER_STEP_PERCENT |
Price range buffer | Prevents overlapping signal ranges |
CC_LADDER_TRADE_REVENUE |
Minimum profit threshold | Defines when to close profitable positions |
These parameters implement a "ladder" trading strategy that spaces out entries and ensures minimum profit margins.
The validation system integrates with several other components:
ShortRangeMathService
for EMA signal analysisBinanceService
for real-time price and exchange informationSignalDbService
roundTicks
utility for proper price precisionThis system forms the core decision-making engine that determines when and how trading signals are executed and resolved within the broader trading platform.