π¦ npm Installation Guide¶
Difficulty: ββ Medium
Time: 10 minutes
β Prerequisites¶
- Node.js 18+ (Get Node.js)
- npm (comes with Node.js)
- API Keys (Twelve Data, Alpha Vantage)
π Quick Start¶
1. Verify Node.js Version¶
2. Install from npm¶
3. Verify Installation¶
βοΈ Configuration¶
1. Create Configuration Directory¶
2. Download Configuration Files¶
# Download .env template
curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/.env.example
cp .env.example .env
# Download watchlist template
curl -O https://raw.githubusercontent.com/XuXuClassMate/trading-assistant/main/watchlist.txt.example
cp watchlist.txt.example watchlist.txt
3. Edit Configuration¶
Required API Keys:
TWELVE_DATA_API_KEY=your_key_here
ALPHA_VANTAGE_API_KEY=your_key_here
LANGUAGE=en # or 'zh' for Chinese
π― Usage¶
Interactive Mode¶
Direct Commands¶
# Trading signals
ta sig
# Support/Resistance
ta sr
# Position calculator
ta pos --symbol NVDA --price 175 --capital 10000
# All analysis
ta all
π Command Reference¶
| Command | Shortcut | Description |
|---|---|---|
ta |
- | Start interactive mode |
ta sig |
ta signals |
Generate trading signals |
ta sr |
ta support-resistance |
Analyze support/resistance |
ta pos |
ta position |
Calculate position size |
ta alerts |
ta alert |
Manage price alerts |
ta all |
ta analyze |
Run all analysis |
ta v |
ta version |
Show version |
ta h |
ta help |
Show help |
π§ Advanced Usage¶
Use in Node.js Projects¶
const { TradingAssistant } = require('@xuxuclassmate/openclaw-trading-assistant');
const ta = new TradingAssistant({
twelveDataKey: 'your_key',
alphaVantageKey: 'your_key'
});
// Get trading signals
const signals = await ta.getSignals('NVDA');
console.log(signals);
// Calculate position
const position = await ta.calculatePosition({
symbol: 'NVDA',
price: 175.64,
capital: 10000,
risk: 1
});
console.log(position);
Use in TypeScript¶
import { TradingAssistant, Signal } from '@xuxuclassmate/openclaw-trading-assistant';
const ta = new TradingAssistant({
twelveDataKey: process.env.TWELVE_DATA_API_KEY,
alphaVantageKey: process.env.ALPHA_VANTAGE_API_KEY
});
const signals: Signal[] = await ta.getSignals('NVDA');
π Update¶
# Check for updates
npm outdated @xuxuclassmate/openclaw-trading-assistant
# Update to latest version
npm update -g @xuxuclassmate/openclaw-trading-assistant
# Verify update
ta --version
ποΈ Uninstall¶
β Troubleshooting¶
Permission Denied (Linux/macOS)¶
# Fix npm permissions
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Then install
npm install -g @xuxuclassmate/openclaw-trading-assistant
Command Not Found¶
# Find npm global bin directory
npm bin -g
# Add to PATH if not already there
export PATH=$(npm bin -g):$PATH
Node Version Too Old¶
# Check Node version
node --version
# Update Node.js
# macOS: brew upgrade node
# Ubuntu: curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# Windows: Download from nodejs.org
π¦ Package Info¶
- Package Name:
@xuxuclassmate/openclaw-trading-assistant - Registry: GitHub Packages
- Version: 1.1.3
- License: MIT
π Related Links¶
π Next Steps¶
- CLI Documentation - Learn all commands
- JavaScript API - Use in Node.js projects
- Configuration Guide - Advanced settings