Welcome to the TradePro documentation. This framework is designed for rapid development, testing, and live monitoring of cryptocurrency trading strategies using EMA-based indicators and candlestick patterns.
The application is split into a Live Monitor (UI) and a Backtesting Engine (Console). It uses the Binance WebSocket API for real-time 15m candle updates and REST APIs for historical data.
You can now adjust strategy parameters directly from the browser console without reloading the page. Use the window.backtestSettings object:
// Update Target, Stop-Loss and Leverage
backtestSettings.target = 1.5; // 1.5% profit target
backtestSettings.stoploss = 0.8; // 0.8% stop loss
backtestSettings.leverage = 50; // 50x leverage
// Update Look-Ahead Window (Exit strategy)
backtestSettings.maxWait = 60; // Wait up to 60 candles (15 hours)
The runAllBacktests() function now supports side-specific filtering to help you isolate performance for Long vs. Short trades:
runAllBacktests("BUY"): Only simulates "Buy / Long" signals.runAllBacktests("SELL"): Only simulates "Sell / Short" signals.runAllBacktests("BOTH"): Simulates all signals (Default).To create a new strategy, open src/strategies.js and add a function to the Strategies object. Every strategy receives the settings object automatically.
My_Custom_Strategy: (data, index) => {
const { candles, ema9, settings } = data;
const current = candles[index];
if (current.c > ema9[index]) {
return {
side: 'Buy',
reason: 'Above EMA9',
entry: current.c,
target: settings.target, // Uses dynamic console value
stoploss: settings.stoploss // Uses dynamic console value
};
}
return null;
}
The system includes a production-grade trailing stop-loss in engine.js:
TradePro Framework v2.1 - Built for Precision Backtesting