A powerful and flexible crypto backtesting platform built with TypeScript, designed to help you test and optimize trading strategies with real market data. This project uses the Binance API to fetch historical data and supports two backtesting methods: Simple Moving Average (SMA) and Volume Profile Visible Range (VPVR).
• Two Backtesting Methods: • SMA (Simple Moving Average): Test strategies using moving average crossovers. • VPVR (Volume Profile Visible Range): Analyze strategies based on volume distribution. • Binance Integration: Fetch real-time and historical market data directly from the Binance API. • TypeScript Powered: Ensure reliability with a strongly typed and maintainable codebase. • Performance Metrics: Get reports on profitability and strategy efficiency. • Customizable Parameters: Adjust strategy configurations for maximum flexibility.
Prerequisites
• Node.js: Version 18.18 or later.
Installation
git clone <https://github.com/eduardofx/backtesting-crypto-typescript>
cd backtesting-crypto-typescript
npm install
npm i -g typescript
npm i -g ts-node-dev
Run VPVR
• npm run start:sma
RUN SMA
• npm run start:vpvr
You can customize the backtesting parameters in the index.ts file:
• SMA
const shortPeriod = 7;
const longPeriod = 25;
• VPVR
const limit = 800; // Number of candles to analyse
const binSize = 100; // Bin Size
A classic strategy where a short-term moving average crossing above or below a long-term moving average generates buy or sell signals.
This method analyzes volume distribution within a visible price range, identifying key levels of support and resistance for optimized trading strategies.
After running the backtesting, you will receive reports, including: • Total Return • Buy and Sell prices
🛡️ Disclaimer
This tool is for educational and research purposes only. Do not use it for live trading without extensive testing. Cryptocurrency trading involves significant risk, and past performance does not guarantee future results.