TradeMemory Protocol for Openclaw

A persistent 3-layer trading memory system for AI agents to record trades, analyze patterns, and automate strategy adjustments.

zychenpeng
v0.3.2
Mar 3, 2026
2
1.3k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install tradememory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install tradememory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is TradeMemory Protocol?

TradeMemory Protocol provides a dedicated memory layer for AI trading agents, enabling them to track every decision and market context across multiple sessions. It bridges the gap between raw execution and strategic learning by organizing data into a hierarchical structure that allows for deep reflection and behavioral analysis. By utilizing Openclaw Skills, traders can integrate persistent memory into their automated workflows, ensuring that their AI agents learn from both wins and losses.

The system is platform-agnostic, supporting MT5, Binance, and Alpaca, making it a versatile tool for modern algorithmic trading environments. It ensures that your agent does not just execute trades but actually evolves its strategy based on historical performance data and discovered market edges.

TradeMemory Protocol Use Cases

  • Recording trade decisions with full market context, confidence scores, and reasoning
  • Performing post-trade reflections to identify emotional or logical biases in execution
  • Analyzing strategy performance across different market sessions such as London vs. Asian
  • Automating risk management adjustments based on historical win rates and drawdown sequences
  • Comparing current trading performance against past weekly or monthly benchmarks to track growth

How TradeMemory Protocol Works

  1. The user or agent records a trade using the store_trade_memory tool, capturing entry, exit, and specific market context.
  2. Trade data is stored in the L1 Raw Trades layer, maintaining a complete history of all execution details and timestamps.
  3. The reflection engine processes L1 data to identify L2 Discovered Patterns, such as session-specific edges or strategy performance gaps.
  4. Based on these patterns, the system generates L3 Strategy Adjustments, providing actionable recommendations for lot sizes and risk thresholds.
  5. Users can query the agent in natural language to recall similar past trades or generate automated performance summaries.

TradeMemory Protocol Setup

To begin, install the package using pip:

pip install tradememory-protocol

Next, start the TradeMemory server which runs on localhost:8000 by default:

python -m src.tradememory.server

For MetaTrader 5 users, configure your .env file with your broker credentials (MT5_LOGIN, MT5_PASSWORD, MT5_SERVER) and run the sync script to poll for closed trades every 60 seconds:

python scripts/mt5_sync.py

TradeMemory Protocol Data Schema & Taxonomy

TradeMemory utilizes a local SQLite database (tradememory.db) to organize information into three distinct layers for better data taxonomy:

Layer Name Description
L1 Raw Trades Includes entry/exit prices, P&L, lot size, timestamps, and confidence scores.
L2 Patterns Identifies session-based performance, strategy edges, and confidence correlations.
L3 Adjustments Provides rule-based tuning such as lot size scaling and strategy filters.

TradeMemory Protocol Advanced Features

  • Automated Daily, Weekly, and Monthly Reflections using Openclaw Skills cron jobs
  • Multi-layer memory architecture for separating raw execution data from strategic insights
  • LLM-powered reflection engine via Anthropic Claude integration for qualitative analysis
  • Seamless MT5 auto-sync functionality requiring zero modifications to existing Expert Advisors
  • Pattern matching for recalling similar historical market contexts to inform current decisions

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*