AI algorithmic trading toolkit with backtest, simulation modes. ai algo trading agent
# Add to your Claude Code skills
git clone https://github.com/algotrading-lab/ai-algotrading-agentGuides for using ai agents skills like ai-algotrading-agent.
ai-algotrading-agent is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by algotrading-lab. AI algorithmic trading toolkit with backtest, simulation modes. ai algo trading agent. It has 71 GitHub stars.
ai-algotrading-agent's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/algotrading-lab/ai-algotrading-agent" and add it to your Claude Code skills directory (see the Installation section above).
ai-algotrading-agent is primarily written in Python. It is open-source under algotrading-lab on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh ai-algotrading-agent against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
Algorithmic trading toolkit for crypto — backtest, tick-by-tick replay, and simulation modes. Ported from the original Python framework with matching strategy semantics.
hist-{interval}/*.csv
│
▼
Entry / exit strategies (SMA cross, …)
│
▼
Stop-loss + trailing stop
│
▼
Backtest P&L · optional Redis cache
cp .env.example .env
npm install
npm run check # typecheck + vitest + smoke backtest
npm run backtest # SMA cross on BTC-XRP (default)
npm run tick # tick-by-tick replay
Custom market:
npm start -- backtest BTC-SRN
algotrading/
├── package.json
├── tsconfig.json
├── .env.example
├── hist-10m/ # Sample CSV history (BTC-XRP, BTC-SRN)
│
├── src/
│ ├── index.ts # Public API exports
│ ├── cli.ts # backtest | tick commands
│ ├── config/
│ │ ├── vars.ts # Env-driven defaults (interval, stops, …)
│ │ └── logger.ts
│ ├── types/market.ts # MarketRow, EntryFn, ExitFn
│ ├── data/csv.ts # loadMarketFromFile, listMarketsOnDisk
│ ├── indicators/
│ │ ├── sma.ts # SMA crossover helpers
│ │ └── bollinger.ts # Bollinger bands (pandas-compatible)
│ ├── strategies/
│ │ ├── entry.ts # crossSmas entry
│ │ └── exit.ts # crossSmas exit
│ ├── risk/stops.ts # stopLoss, trailingStopLoss
│ ├── engine/
│ │ ├── signals.ts # isTimeToBuy, isTimeToExit
│ │ ├── backtest.ts # backtest(), backtestMarket()
│ │ ├── tickByTick.ts # Candle replay loop
│ │ └── realtime.ts # Live feed stub (extend for exchanges)
│ └── cache/ # ioredis-os optional backtest cache
│
├── tests/ # Vitest — parity with legacy Python tests
├── scripts/smoke-test.ts
│
└── cryptoalgotrading/ # Legacy Python implementation (reference)
| Mode | API | Data source |
|---|---|---|
| Backtest | backtest() |
hist-{interval}/*.csv |
| Tick-by-tick | tickByTick() |
CSV replay with optional delay |
| Realtime | realtime() |
Stub — wire exchange WebSocket in src/engine/realtime.ts |
import { backtest, entry, exit } from './src/index.js';
const total = await backtest({
markets: ['BTC-XRP'],
entryFns: [entry.crossSmas],
exitFns: [exit.crossSmas],
smas: [15, 40],
interval: '10m',
fromFile: true,
});
console.log(`Total P&L: ${total}%`);
| Variable | Default | Description |
|---|---|---|
DATA_DIR |
. |
Root path for hist-{interval}/ folders |
DEFAULT_INTERVAL |
10m |
Candle folder suffix |
STOP_TYPE |
3 |
0 off · 1 fixed · 2 trailing · 3 both |
STOP_LOSS_PCT |
2 |
Fixed stop % below entry |
TRAILING_LOSS_PCT |
3 |
Trailing stop % below peak |
COMMISSION_ENABLED |
true |
Deduct BNB_COMMISSION on exits |
REDIS_URL |
— | Optional backtest result cache |
flowchart LR
CSV["hist-10m/*.csv"]
DATA["data/csv.ts"]
IND["indicators/sma.ts"]
STR["strategies entry/exit"]
SIG["engine/signals.ts"]
BT["engine/backtest.ts"]
CACHE[("Redis optional")]
CSV --> DATA --> BT
IND --> STR --> SIG --> BT
BT --> CACHE
The original Python package lives in cryptoalgotrading/. It required Pandas, Matplotlib, InfluxDB, and Bittrex/Binance clients. The TypeScript edition keeps the same SMA crossover logic and CSV layout but drops matplotlib plotting and DB dependencies for a leaner Node.js runtime.
To run legacy Python tests: pip install -r requirements.txt && python -m pytest test/
USE AT YOUR OWN RISK. This software is not financial advice. Test in simulation before deploying capital.