ml crypto trading expressions

    1

    Author and validate safe, deterministic trading expressions for the ml-crypto-trading (MCT) framework.

    Free

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    ml crypto trading expressions

    Example session with this skill installed

    Write a dynamic_quantity expression that risks 2% of equity, capped by 95% of available balance, and never drops below min_qty.

    • Read your context and instructions
    • Compiled the ml crypto trading

    The following expression implements fixed-fractional risk management. It calculates the quantity by dividing 2% of total equity by the current close price, ensuring the order respects exchange minimums and total wallet liquidity.

    MCT Dynamic Quantity Expression

    
    # Place this in your trading-config.yaml under dynamic_quantity
    # or assets[].dynamic_quantity
    
    dynamic_quantity: >-
      max(
        min_qty,
        min(
          (equity * 0.02) / close,
          (balance * 0.95) / close
        )
      )
    

    Next steps
    1.

    Validate Syntax: Run python -c "from src.core.expressions.expression_parser import ExpressionParser; ExpressionParser.validate('max(min_qty, min((equity * 0.02) / close, (balance * 0.95) / close))')" to confirm the AST is valid.
    2.

    Dry Run: Use the POST /api/v1/expressions/evaluate endpoint with your current equity and balance to see the resulting quantity.
    3.

    Backtest: Run make run-backtest to ensure this sizing logic doesn't lead to frequent "insufficient margin" errors.

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

    About this skill

    Writing trading logic in YAML shouldn't feel like guessing. This skill helps you author, debug, and validate spreadsheet-style expressions for position sizing and strategy rules in the ml-crypto-trading (MCT) framework.

    What it does

    • Position Sizing writes dynamic_quantity formulas that calculate order sizes based on equity, risk percentages, and consensus signals.
    • Strategy Triggers drafts boolean expressions for DYNAMIC strategies to gate entries and exits based on market indicators.
    • Validation Support generates Python snippets or API requests to test syntax and semantic correctness using the MCT ExpressionParser.
    • Volatility Scaling implements ATR-based sizing and risk-parity patterns to protect capital.
    • Logic Guardrails applies safety patterns like max(min_qty, ...) and clamp() to prevent order execution failures or zero-division errors.

    How it works

    1. Scope Definition specifies whether you are building a global dynamic_quantity rule or a per-asset strategy expression.
    2. Logic Drafting constructs the formula using allowed arithmetic, logical, and rolling series functions like highest() or lowest().
    3. Refinement applies risk limits, flooring against min_qty and capping against available balance.
    4. Validation Generation provides the specific CLI commands or curl requests to verify the expression against your local MCT instance.

    Frameworks & tools

    Specifically designed for the ml-crypto-trading (MCT) Python project. It uses the project's internal ExpressionParser syntax, including rolling series functions and consensus variables like signal and vote_ratio.

    Why this beats prompting it yourself

    Generic LLMs often use arbitrary Python or invalid indicators that crash the MCT engine. This skill enforces the strict AST-safe subset of Python permitted by the ExpressionParser, ensuring your formulas actually execute in backtests.

    Use cases

    • Scaling position size up or down based on model confidence scores.
    • Creating mean-reversion strategies using RSI or EMA crossovers in YAML.
    • Implementing fixed-fractional risk management based on current equity.
    • Gating trades so they only trigger during specific rolling channel breakouts.

    Known limitations

    Does not support arbitrary Python imports, loops, or attribute access. Expressions are limited to 1000 characters. Strategy scopes cannot access consensus variables like signal.

    Limited to MCT ExpressionParser syntax. Max 1000 characters. Strategy expressions cannot access consensus variables. Requires Python 3.11+ for local validation.

    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 4 days ago

    • Free with an Agensi account

    Permissions

    Terminal / Shell
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    This skill provides a specialized interface for authoring and validating formulas used in the ml-crypto-trading (MCT) framework, ensuring your logic follows the strict ExpressionParser syntax to prevent engine crashes.

    Yes, it specifically handles rolling series functions like highest(), lowest(), and EMA crossovers for YAML-based strategy triggers and position sizing.

    The skill targets the ml-crypto-trading (MCT) Python project specifically and is compatible with any AI agent platform that supports MCT's YAML-based configuration.

    No, the skill enforces an AST-safe subset of Python; it cannot generate code for external libraries or custom Python imports that fall outside the permitted MCT environment.

    You receive the pre-configured AI skill designed to draft, debug, and validate MCT expressions, along with templates for position sizing, volatility scaling, and CLI validation commands.

    It automatically applies safety patterns like 'clamp' and 'min_qty' flooring to your expressions to ensure your orders aren't rejected by exchanges for being too small or exceeding your balance.

    New in Trading & Investing