• SIGNAL DATA
  • PERFORMANCE
  • REFINEMENT
  • HUMAN

How to backtest trading strategies with your agent

Connect your agent to historical price data and run simulations to see if your entry and exit rules actually hold up.

Ask AI about this page

Our technology reaches across leading technology and enterprise teams.

  • Amazon
  • NVIDIA
  • Red Hat
  • Fidelity Investments
  • Intuit
  • OLX Brasil
  • Writesonic
  • Artium
  • Trolley
Bunny World Voxel Workspace

Short answer

How can I backtest my pairs trading strategy?

You give your agent specific z-score thresholds and a pair of assets, then it runs those parameters against historical price data. You get a clear view of how those specific signals would have triggered in the past. This breakdown shows you how to set up those simulations.

The simulation results

What you get from the backtest

Once the simulation finishes, your agent delivers these specific outcomes.

SIGNAL DATA

Historical signal logs

Your agent uses generate_trading_signals to produce a list of each time your threshold was hit. You get the exact timestamps and price levels for each historical trigger.

PERFORMANCE

Threshold effectiveness

You see how different z-score levels change the frequency and quality of trades. This helps you decide if a tighter or wider spread works better for your specific pair.

REFINEMENT

Parameter tuning

Your agent identifies where your current rules would have failed or missed opportunities. You use this to adjust your entry and exit logic before risking real capital.

HUMAN

Final strategy approval

Your agent provides the raw data and signal history, but you decide if the results justify moving the strategy to live trading. You make the final call on risk management.

The workflow

What your agent does when the strategy arrives.

Your agent handles the heavy lifting of scanning history and calculating spreads.

  1. Data ingestion

    Your agent pulls the historical price series for the assets you want to pair. It aligns the timestamps so the spread calculation is accurate.

    generate_trading_signals
  2. Signal generation

    Your agent calculates the rolling mean and standard deviation to find the z-score for each point in the history. It flags each instance where the spread crosses your chosen threshold.

    generate_trading_signals
  3. Threshold testing

    Your agent iterates through your requested z-score levels to see how they impact the signal frequency. It maps out the specific moments the spread diverged from the mean.

    generate_trading_signals
  4. Result summary

    Your agent organizes the resulting signals into a readable format. It presents the historical triggers so you can review the timing of each simulated trade.

    generate_trading_signals

Vinkius Agentic Execution Platform

State the outcome. Agents take it from there.

You don't have to drive this run by hand. Inside the Vinkius Agentic Execution Platform, agents pick up the task above and carry it to the end: you set the limits, you watch the steps, you keep all decisions.

Run it in Vinkius

Agents carry the task to the end

Agents execute Pairs Trading Engine tasks from end to end inside the Vinkius Agentic Execution Platform: set the outcome, and the steps run.

Take it to any compatible AI

One connection, any client

Same connection follows you to ChatGPT, Claude, Gemini and any other client you love. Switch whenever you want: your connection, your permissions and your record move with you.

Spaces

One Space per activity

A Space gathers the context, tools and tasks of one activity, so you coordinate several agents at once and follow each execution as it happens.

Limits

Autonomy inside limits you set

Permissions and spending limits are yours to define. Agents halt for your approval on anything sensitive, and you choose how far autonomy goes, step by step or end to end.

Record

All steps, on the record

Each action your agents take lands in a signed audit trail. Results are verified, mistakes are learned from, and an emergency stop is one click away.

Models

Included in your plan

A curated selection of AI models is included in your plan, and you can add your own through BYOK whenever you prefer.

Try it

Copy these to start.

Use these prompts to kick off your first simulation.

Starting points

Swap the asset names and the z-score numbers to match your specific strategy.

Pairs Trading Engine Connector

You're all set. Choose your MCP client and follow the setup instructions.

Connector linkhttps://edge.vinkius.com/vk_preview_fR7Wf0hWapXR13V1VXTEZOFEzjbZp3DEKpJbfA80/mcp

Claude Desktop

Follow the steps below to connect in seconds.

  1. 1In Claude Desktop, open Settings → Connectors.
  2. 2Click “Add custom connector” and paste the connector link above as the remote MCP server URL.
  3. 3Click Add and start a new chat, Pairs Trading Engine capabilities are ready to use.
Configuration · claude_desktop_config.jsonCopy
{
  "mcpServers": {
    "pairs-trading-strategy-engine-mcp": {
      "url": "https://edge.vinkius.com/vk_preview_fR7Wf0hWapXR13V1VXTEZOFEzjbZp3DEKpJbfA80/mcp"
    }
  }
}
Copy into chat04
  • 01

    Backtest a pairs trading strategy for PEP and KO using a z-score threshold of 2.0.

  • 02

    Run a simulation on the spread between GLD and SLV with a z-score of 1.5 to see how often signals trigger.

  • 03

    Compare how a 2.0 z-score threshold performs against a 2.5 z-score threshold for the EURUSD and GBPUSD pair.

  • 04

    Generate trading signals for a pair of tech stocks using a rolling 20-day window and a 2.0 z-score.

  • Claude
  • ChatGPT
  • Cursor
  • VS Code
  • Windsurf
  • Claude Code
  • JetBrains
  • Cline

Start here

Connect Pairs Trading Strategy Engine once, then ask.

Link the MCP to your preferred client. Your credentials stay encrypted, and you can start running simulations immediately.

Connect Pairs Trading Strategy Engine to your agent

FAQ

How this task behaves

  • 01

    Can your agent execute these trades in my brokerage account?

    No. Your agent only generates signals based on historical data for testing purposes. It cannot place live orders.

  • 02

    Does your agent choose the assets for me?

    No. You must specify which assets you want to pair and the z-score thresholds you want to test.

  • 03

    Can I use this to find new pairs to trade?

    Yes, you can ask your agent to test various asset combinations to see which ones exhibit the most consistent mean reversion.

  • 04

    What kind of data does it use for the backtest?

    It uses the historical price data provided through the Pairs Trading Strategy Engine to calculate the z-scores and signals.

  • 05

    Can your agent change my existing trading software settings?

    No. Your agent operates within your chat client and only interacts with the data through this MCP.

  • More questions about Pairs Trading Strategy Engine? The Connector page answers them. See everything the Pairs Trading Strategy Engine Connector can do

Building with AI? Ship this whole workflow in your product.

Vinkius Connect is the connectivity layer for AI builders. All the capabilities used on this page, from Pairs Trading Engine to thousands more, arrive through one SDK, already maintained for you. One Application, unlimited seats, each with their own connectors and credentials, isolated and never exposed to Vinkius. No OAuth flows to write, no tokens to store, no APIs to chase.

Explore Vinkius Connect

TypeScript · Python · Java · Go · C# · PHP · Rust

  • 01

    Your customers bring their own keys.

    Each user connects their own apps and keeps their own credentials. Vinkius only sees the identifier your backend sends.

  • 02

    Whole catalog, kept current.

    Pairs Trading Engine plus thousands more, maintained and growing daily. No integrations to write, no token storage, no OAuth plumbing.

  • 03

    Any agent, any model.

    Capabilities land as framework-neutral objects, with adapters for OpenAI, Anthropic, Gemini, the Vercel AI SDK, LangChain and more.

Connect Pairs Trading Engine to Claude, Cursor, ChatGPT & more

From idea to done

See what gets done when the agents take over the busywork

Each workflow on this page runs on the same platform. Connect your tools once, and your agents keep working in any AI you trust.