quant risk engine

    by Abdulla Thaslim

    1

    Institutional-grade risk engine for precision lot-sizing and prop firm drawdown protection.

    $9.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+23 more

    quant risk engine

    Example session with this skill installed

    Calculate a trade for a $50,000 account. I want to buy XAUUSD at 2650.00 with a stop loss at 2640.00. Risk 1% and enable the prop firm shield. Give me JSON.

    • Read your context and instructions
    • Compiled the quant risk engine

    I have processed the risk parameters for your XAUUSD long position. The engine has applied the Prop Firm Shield to ensure the trade complies with institutional drawdown limits.

    Trade Risk Analysis (XAUUSD)

    {
      "account": {
        "balance": 50000.00,
        "currency": "USD"
      },
      "trade_details": {
        "symbol": "XAUUSD",
        "side": "LONG",
        "entry": 2650.00,
        "stop_loss": 2640.00,
        "pip_distance": 100.0
      },
      "risk_management": {
        "risk_percentage": 1.0,
        "risk_amount_usd": 500.00,
        "prop_firm_shield": "ACTIVE",
        "max_drawdown_limit": 5000.00,
        "single_trade_cushion_usd": 175.00
      },
      "execution": {
        "lot_size": 0.50,
        "pip_value_usd": 5.00,
        "required_margin": 1325.00
      },
      "projections": {
        "target_1_1.5_tp": 2665.00,
        "target_1_1.5_profit": 750.00,
        "target_1_2.0_tp": 2670.00,
        "target_1_2.0_profit": 1000.00
      }
    }
    

    Next steps

    1. Verify the lot size of 0.50 matches your broker's contract specifications for Gold.
    2. Confirm that the $500.00 risk does not exceed your remaining daily drawdown limit.
    3. Execute the order at 2650.00 with the projected TP levels.

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

    About this skill

    Manual position sizing leads to blown accounts and prop firm disqualifications. This skill provides an institutional-grade risk engine for Forex, Metals, and Crypto to ensure every trade fits within strict mathematical and firm-specific constraints.

    What it does

    • Position Sizing: Calculates exact lot sizes for Forex pairs, Gold/Silver, and major Cryptocurrencies based on entry and stop loss.
    • Prop Firm Guardrails: Enforces drawdown limits (e.g., 5% daily/10% total) specifically tuned for FTMO and FundedNext rules.
    • Kelly Criterion Integration: Computes optimal half-Kelly sizing based on historical win rates to manage long-term equity growth.
    • Risk Projection: Generates precise monetary gains for 1:1.5 and 1:2.0 risk-to-reward targets.
    • Agent-Ready Output: Delivers structured JSON or CLI results designed for integration into trading agent pipelines.

    How it works

    1. Define Parameters: Provide account balance, asset symbol, entry price, and stop loss.
    2. Apply Constraints: Set risk percentage or fixed dollar amounts, and toggle the --prop-firm flag for drawdown protection.
    3. Execute Calculation: Run the risk_engine.py script via CLI to process the math.
    4. Parse Results: Use the --json flag to receive structured data for downstream execution by your trading bot or agent.

    Frameworks & tools

    The engine is a Python-based utility (risk_engine.py) designed for CLI environments and AI agents like Claude Code, Cursor, or custom algorithmic pipelines.

    Why this beats prompting it yourself

    LLMs frequently hallucinate pip values and contract sizes for non-standard assets like Gold or Crypto. This skill uses hard-coded financial logic to ensure lot sizes are mathematically perfect, preventing catastrophic sizing errors that prompts alone cannot avoid.

    Use cases

    • Enforcing 1% risk rules on XAUUSD scalps for a funded account.
    • Automating position sizing for a BTCUSD breakout strategy.
    • Calculating Kelly-optimal bet sizes for high-frequency Forex strategies.
    • Protecting prop firm capital by applying a 35% single-trade safety cushion.

    Known limitations

    Requires manual input of entry and stop loss prices as it does not fetch real-time market data. Requires a Python 3 environment to execute the core logic.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Trading & Investing.

    Requires Python 3 environment. Does not fetch real-time price feeds; entry and exit prices must be provided as arguments.

    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 buying a skill.

    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

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    Software
    Python

    Permissions

    Terminal / Shell
    Listed7 days ago

    What's inside

    Frequently Asked Questions

    This skill eliminates the risk of account blowouts and 'fat-finger' errors by calculating mathematically precise lot sizes for Forex, Metals, and Crypto based on your specific risk parameters and prop firm drawdown rules.

    The skill is delivered as a standalone Python utility (`risk_engine.py`) designed to be called by agentic IDEs like Claude Code and Cursor, or integrated directly into custom Python-based trading bot pipelines via JSON output.

    Unlike LLMs, which often struggle with the complex pip math for Gold (XAUUSD) or varying contract sizes in Crypto, this engine uses hard-coded financial logic to ensure 100% mathematical accuracy every time.

    You will receive the core `risk_engine.py` script, a comprehensive README with CLI command examples, and documentation on integrating the JSON output into your existing trading agent workflows.

    The engine currently supports major Forex pairs, Gold (XAUUSD), Silver (XAGUSD), and high-liquidity Cryptocurrencies like BTC and ETH; additional assets can be configured within the script's parameter settings.

    To maintain maximum security and minimize latency, the engine requires you to provide the entry and stop-loss prices as inputs; it does not connect to external broker APIs or live price feeds.

    New in Trading & Investing