่ทณ่ฝฌ่‡ณ

๐Ÿ“ฆ 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

node --version
# Should be v18 or higher

2. Install from npm

npm install -g @xuxuclassmate/openclaw-trading-assistant

3. Verify Installation

ta --version
# Output: OpenClaw Trading Assistant CLI v1.3.0

โš™๏ธ Configuration

1. Create Configuration Directory

mkdir -p ta-config && cd ta-config

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

# Edit .env with your API keys
nano .env

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

ta

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

npm uninstall -g @xuxuclassmate/openclaw-trading-assistant

โ“ 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


๐Ÿ“š Next Steps