feat: Add market making strategy with configurable spread and order cycling#5
Merged
Merged
Conversation
…ycling New strategy that places symmetric buy/sell limit orders around the mid price, manages order lifecycle with configurable refresh intervals, and optionally closes filled positions immediately. Parameters (all configurable via CLI/env): - spread_bps: one-sided spread in basis points (default: 5) - order_size_usd: size per order in USD (default: 50) - max_open_orders: concurrent order limit (default: 4) - refresh_interval_seconds: stale order timeout (default: 30) - close_immediately: auto-close filled positions (default: true) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
market_makingstrategy that places symmetric buy/sell limit orders around the mid priceNew Strategy:
market_making--spread-bps--order-size-usd--max-open-orders--refresh-interval--no-close-immediatelyExample Usage
How It Works
mid - spreadand sell limit atmid + spread(post-only)close_immediatelyis enabled)refresh_interval_secondsRISK_LEVELenv var for dynamic position sizing (green=100%, yellow=50%, red/black=pause)Changes
strategies/market_making_strategy.py: New 235-line strategy with order tracking, stale order management, and spread calculationstrategies/__init__.py: ExportMarketMakingStrategybot.py: Add to strategy_map, default_configs, argparse choices, and CLI arg parsingTest plan
--no-close-immediatelyholds positionsRISK_LEVEL=yellowreduces order size to 50%RISK_LEVEL=redstops placing new ordershyna:BTC,xyz:GOLD)🤖 Generated with Claude Code