Package Exports
- @neural-trader/features
- @neural-trader/features/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@neural-trader/features) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@neural-trader/features
150+ technical indicators for Neural Trader including SMA, RSI, MACD, Bollinger Bands, and advanced indicators powered by Rust.
Features
- 150+ Indicators: Comprehensive technical analysis library
- Moving Averages: SMA, EMA, WMA, VWMA
- Momentum: RSI, Stochastic, Williams %R
- Trend: MACD, ADX, Parabolic SAR
- Volatility: Bollinger Bands, ATR, Keltner Channels
- Volume: OBV, VWAP, MFI
- Rust Performance: Calculate thousands of indicators per second
Installation
npm install @neural-trader/features @neural-trader/coreQuick Start
import { calculateSma, calculateRsi, calculateIndicator } from '@neural-trader/features';
// Calculate Simple Moving Average
const prices = [150, 152, 151, 153, 155, 154, 156];
const sma = calculateSma(prices, 5);
console.log('SMA(5):', sma);
// Calculate RSI
const rsi = calculateRsi(prices, 14);
console.log('RSI(14):', rsi);
// Calculate any indicator using generic function
const bars = [
{ symbol: 'AAPL', timestamp: '2024-01-01', open: '150', high: '152', low: '149', close: '151', volume: '1000000' },
// ... more bars
];
const macd = await calculateIndicator(bars, 'MACD', JSON.stringify({
fast_period: 12,
slow_period: 26,
signal_period: 9
}));
console.log('MACD:', macd);Available Indicators
Trend
- SMA, EMA, WMA, VWMA, DEMA, TEMA
- MACD, MACD Histogram, MACD Signal
- ADX, +DI, -DI
- Parabolic SAR
- Aroon, Aroon Oscillator
Momentum
- RSI, Stochastic RSI
- Stochastic Oscillator (%K, %D)
- Williams %R
- CCI (Commodity Channel Index)
- ROC (Rate of Change)
- Momentum
Volatility
- Bollinger Bands
- ATR (Average True Range)
- Keltner Channels
- Donchian Channels
- Standard Deviation
Volume
- OBV (On-Balance Volume)
- VWAP
- MFI (Money Flow Index)
- Accumulation/Distribution
- Chaikin Money Flow
API Reference
function calculateSma(prices: number[], period: number): number[];
function calculateRsi(prices: number[], period: number): number[];
function calculateIndicator(bars: JsBar[], indicator: string, params: string): Promise<any>;License
MIT OR Apache-2.0