This project is an experimental project using Cursor and Claude. I am just promting and reviewing, but I let AI do whatever it wants.
The TradingBot
class in src/bots/TradingBot.ts
is the original AI-powered trading system in this application, operating in parallel to the newly-implemented SMC (Smart Money Concept) system. It combines traditional technical analysis with AI-driven decision making.
The TradingBot integrates several key services and capabilities:
- Market Data Collection
- Uses the BinanceService to fetch real-time market data
- Retrieves candle data (OHLCV) from Binance API
- Collects additional market metrics like volume, market cap, and dominance
- AI-Powered Analysis
- Leverages OpenAI to analyze market data through
OpenAIService
- Generates trading plans based on pattern recognition and technical indicators
- Uses prompts from the
PromptFactory
to structure the AI analysis
- Leverages OpenAI to analyze market data through
- Plan Management & Persistence
- Stores trading plans in a database via
DatabaseService
- Tracks the progress of plans through different states
- Allows for plan validation and rechecking as market conditions change
- Stores trading plans in a database via
- Trade Life-Cycle Management
- Monitors active trading plans
- Updates plan status as market conditions evolve
- Records profit/loss metrics
Unlike the new SMCTradingBot:
- The original TradingBot relies heavily on AI (OpenAI) for analysis, whereas the SMC version uses algorithmic rules based on Smart Money Concept principles.
- TradingBot stores plans in a database for long-term tracking, while the SMC version operates more as a real-time scanner.
- TradingBot includes a more comprehensive validation and rechecking process for existing plans.
This dual-system approach gives users flexibility to choose between AI-driven analysis or the more deterministic SMC methodology for their trading decisions.
npm run start analyze BTCUSDT
npm run start analyze BTCUSDT -- -i 1h
npm run start analyze BTCUSDT -- -r
npm run start analyze BTCUSDT -- -i 4h -r
npm start monitor-smc -- --symbols BTCUSDT,ETHUSDT,BNBUSDT,LTCUSDT --interval 5
- Copy
.env.example
to.env
:
cp .env.example .env
- Fill in your API credentials in
.env
:
- Get Binance API credentials from Binance API Management
- Get OpenAI API credentials from OpenAI API Keys
- Required Environment Variables:
BINANCE_API_KEY= # Your Binance API key
BINANCE_API_SECRET= # Your Binance API secret
OPENAI_PROJECT_ID= # Your OpenAI project ID
OPENAI_API_KEY= # Your OpenAI API key
- Optional Settings:
NODE_ENV=development # development or production
LOG_LEVEL=debug # debug, info, warn, or error
- Never commit your
.env
file - Keep your API keys secure and rotate them periodically
- Use read-only API keys when possible
- Monitor your API usage regularly