How Signals Work
Entry Point
npx @tradejs/cli signals
Main script:
@tradejs/cli
Real Strategy Config Source
Signal runtime loads active strategy configs from Redis keys like:
users:<user>:strategies:TrendLine:config
And resolves creators dynamically:
const strategyCreator = await getStrategyCreator(strategyName);
const strategy = await strategyCreator({
userName: flags.user,
connector,
symbol,
data: [...cachedData],
btcData: [...btcCachedData],
btcBinanceData: [...btcBinanceData],
btcCoinbaseData: [...btcCoinbaseData],
config: {
...strategyConfig,
ENV: 'CRON',
INTERVAL: interval,
MAKE_ORDERS: flags.makeOrders,
},
});
Pipeline
- Resolve connector and ticker universe.
- Optionally warm market cache with
update. - Load active strategy configs from Redis.
- Run project-level
beforeSignalshooks fromtradejs.config.ts. - Run strategy runtime for each symbol.
- Save produced signals to Redis.
- Run project-level
afterSignalshooks fromtradejs.config.ts. - Optionally send screenshots and Telegram notifications.
beforeSignals and afterSignals are batch hooks for the whole signals run. They are not strategy manifest hooks and do not execute per candle.
Typical use cases:
- one-shot global risk checks before scanning symbols
- cross-strategy close-all logic that should run once per signals cycle
- run-level logging, metrics, or notifications after signals finish
beforeSignals may abort the ticker evaluation phase by returning:
{
abort: true,
reason: 'SOME_REASON',
}
When active strategy runtime calls strategyApi.getMarketData() in ENV='CRON', TradeJS reuses the warmed candle cache for the current run instead of forcing another live kline fetch for every strategy symbol.
Order Execution
- Enable with
--makeOrders. - Runtime can still skip orders due to AI/ML policy.
- Signal can be stored with
orderStatus = skippedwhen gate blocks execution. - Signals stored as
skippedorcanceledare not forwarded to Telegram notifications.
Telegram Notifications
npx @tradejs/cli signals --notify
When AI analysis is present, Telegram receives a follow-up analysis message.
TradeJS also provides npx @tradejs/cli signals-summary for a daily Telegram digest over recent runtime signal and trade activity.
The same Telegram report delivery helper is used by runtime-parity --notify
for runtime/backtest parity summaries.
See full setup: