Expand description
§Neural Trader - Node.js FFI Bindings
This crate provides high-performance Node.js bindings using napi-rs for the Neural Trader Rust core. It exposes async APIs that map directly to JavaScript Promises.
§Architecture
JavaScript (Node.js)
↓
napi-rs (auto-generated)
↓
This crate (manual wrappers)
↓
Rust core (nt-core, nt-strategies, etc.)§Features
- Zero-copy buffer operations for large datasets
- Async/await with automatic Promise conversion
- Type-safe error marshaling
- Resource management with Arc for shared state
- Thread-safe concurrent operations
§Modules
broker- Broker integrations (Alpaca, IBKR, CCXT, Oanda, Questrade, Lime)strategy- Trading strategy implementationsneural- Neural network models for forecastingrisk- Risk management (VaR, Kelly, drawdown)backtest- Backtesting enginemarket_data- Market data streaming and indicatorsportfolio- Portfolio management
Modules§
- backtest
- Backtesting engine bindings for Node.js
- broker
- Broker integration bindings for Node.js
- market_
data - Market data streaming and fetching bindings for Node.js
- neural
- Neural model bindings for Node.js
- portfolio
- Portfolio management bindings for Node.js
- risk
- Risk management bindings for Node.js
- strategy
- Strategy bindings for Node.js
Structs§
- JsBar
- JavaScript-compatible bar data
- JsConfig
- JavaScript-compatible configuration
- JsOrder
- JavaScript-compatible order data
- JsPosition
- JavaScript-compatible position data
- JsSignal
- JavaScript-compatible signal data
- Neural
Trader - Main Neural Trader system instance
- Version
Info - Get version information
Functions§
- calculate_
indicator - Calculate technical indicators
- decode_
bars_ from_ buffer - Decode bars from MessagePack buffer
- encode_
bars_ to_ buffer - Encode bars to MessagePack buffer for efficient transfer
- fetch_
market_ data - Fetch historical market data
- get_
version_ info - init_
runtime - Initialize tokio runtime with custom thread count