Exchange configuration object
Exchange schema registered via addExchange(). Defines candle data source and formatting logic.
Optionalcallbacks?: Partial<IExchangeCallbacks>Optional lifecycle event callbacks (onCandleData)
Unique exchange identifier for registration
Format price according to exchange precision rules.
Format quantity according to exchange precision rules.
Fetch candles from data source (API or database).
Optionalnote?: stringOptional developer note for documentation
addExchange({
exchangeName: "binance",
getCandles: async (symbol, interval, since, limit) => {
// Fetch from Binance API or database
return [{
timestamp: Date.now(),
open: 50000,
high: 51000,
low: 49000,
close: 50500,
volume: 1000,
}];
},
formatPrice: async (symbol, price) => price.toFixed(2),
formatQuantity: async (symbol, quantity) => quantity.toFixed(8),
});
Registers an exchange data source in the framework.
The exchange provides: