bot ema crossover backtester

    0

    Local EMA crossover backtesting with ATR-based risk management and drawdown kill-switches.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    bot ema crossover backtester

    Example session with this skill installed

    Run a backtest for ETH/USDT on the 4h timeframe for the last 500 candles with a 5000 initial balance.

    • Read your context and instructions
    • Compiled the bot ema crossover
    • Generated the data export

    I have executed the EMA crossover backtest for ETH/USDT on the 4h timeframe. The simulation processed 500 candles with an initial capital of 5000.00.

    Backtest Results: ETH/USDT (4h)

    MetricValue
    Initial Balance5000.00 USDT
    Final Balance5420.50 USDT
    Total Return+8.41%
    Win Rate42.5%
    Max Drawdown6.2%
    Risk-Reward Ratio2.15 (Avg)
    Consecutive Losses4 (Threshold: 8)
    ATR Stop Hits12
    StatusStrategy Active (Kill-switch not triggered)

    Next steps

    1. Review the specific entry/exit timestamps in the generated backtest_logs.csv.
    2. Increase the --period to 1000 to test the strategy across different market cycles.
    3. Adjust the --timeframe to 1h to evaluate if higher frequency trading improves the expectancy.

    backtest_logs.csv

    CSV · data export

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Backtesting trading strategies manually often results in biased results and ignored risk parameters. This skill enables local execution of EMA crossover simulations with built-in risk-management guardrails.

    What it does

    • EMA Signal Generation calculates fast (9) and slow (21) exponential moving averages to identify trend reversals.
    • Risk-Reward Enforcement applies a mandatory 2.0 minimum reward-to-risk ratio floor to every simulated trade.
    • ATR-Based Stops uses Average True Range calculations to set precise stop-loss levels based on market volatility.
    • Capital Protection monitors peak equity drawdown and halts execution if the 15% threshold is breached.
    • Execution Guard implements a kill-switch after 8 consecutive losses to prevent emotional or algorithmic spirals.

    How it works

    1. Initialize the backtest by specifying the asset symbol and timeframe via the CLI.
    2. Fetch Data from live exchange APIs using CCXT or use local deterministic fallbacks for offline testing.
    3. Execute Simulation to process historical candle feeds through the crossover logic and risk layers.
    4. Review Analytics including initial vs. final balance, drawdown percentages, and expectancy metrics.

    Frameworks & tools

    This skill is built for Python environments. It utilizes CCXT for exchange connectivity and standard quantitative libraries for EMA and ATR calculations.

    Why this beats prompting it yourself

    Generic prompts often fail to account for complex exit logic like ATR stops or drawdown kill-switches. This skill provides a structured, reusable implementation that ensures risk management is never an afterthought in your trading logic.

    Use cases

    • Strategy Validation by running 300-period simulations on BTC/USDT or other crypto pairs.
    • Risk Stress-Testing to see how a crossover strategy handles high-volatility environments.
    • Portfolio Guardrails to determine optimal drawdown limits before deploying live capital.

    Known limitations

    Requires a Python environment with CCXT installed for live data. Backtests are limited to EMA crossover logic and do not support custom indicator scripts.

    Requires Python and CCXT. Limited to 9/21 EMA crossover logic. Maximum 300 candle period by default. 15% drawdown and 8-loss kill-switches are hardcoded.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 5 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Network Access
    Listed6 days ago
    Updated5 days ago

    What's inside

    Frequently Asked Questions

    This skill automates the evaluation of EMA crossover strategies by integrating professional-grade risk layers, such as ATR-based volatility stops and drawdown kill-switches, preventing the biased or risky results often found in manual backtesting.

    The skill is designed for Python-based AI agents and environments. It requires the CCXT library for fetching exchange data, but it also supports local CSV/JSON data fallbacks for offline simulation.

    You receive the full Python-based logic for the EMA/ATR engine, the risk management modules (including the drawdown and loss-streak kill-switches), and documentation on how to initialize simulations via CLI.

    While the primary logic is optimized for the 9/21 EMA crossover, you can initialize the backtest with any asset symbol or timeframe supported by your data source, such as BTC/USDT on 1-hour or 4-hour candles.

    The skill includes a 'Capital Protection' module that monitors equity in real-time during the simulation; if your peak-to-trough drawdown exceeds 15%, the skill triggers a kill-switch to protect the remaining simulated balance.

    Currently, this skill is a standalone logic package focused on EMA crossovers. If the core logic or the CCXT integration requirements change, updates will be made available through your marketplace dashboard.

    New in Trading & Investing