TradePro Modular Framework Documentation

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.

1. System Overview

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.

Indicators

  • EMA 9 (Fast): Used for momentum triggers.
  • EMA 50 (Medium): Trend baseline and dynamic support.
  • EMA 100 (Slow): Major trend direction.

Candle Patterns

  • Hammer: Bullish reversal with long lower wick.
  • Shooting Star: Bearish reversal with long upper wick.
  • Engulfing: Strong momentum confirmation (Body-based).

2. Dynamic Backtesting New

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)
        

3. Filtered Simulations New

The runAllBacktests() function now supports side-specific filtering to help you isolate performance for Long vs. Short trades:

4. Creating a Custom Strategy

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;
}
        

5. Trailing Stop-Loss Logic

The system includes a production-grade trailing stop-loss in engine.js:

TradePro Framework v2.1 - Built for Precision Backtesting