claude-code - 💡(How to fix) Fix autotrading bot

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Diagnostics performed:

  • Pulled 48h trade history (15 closed, 3W/12L, -$6.54 net)
  • Identified that wins were being clipped to $0.13 avg vs losses at $0.58 — diagnosed root cause (BE_AT_R=0.5)
  • Cross-checked all 12 of bot's approved candidates against my own H1/M15/M5 read (12/12 AGREE)

Code Example



---
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

                                                                                                                                                                                                                                           Body:

I have been building a multi-feature MT5 trading bot for over a month and use Claude Code to assist with development. In a recent session, I requested Claude to:

  1. Configure the bot to target $100+ TP per position on a ~$10 demo account (later goal: $2000/day)
  2. Use available leverage (1:2000) to size positions to make these TPs reachable
  3. Minimize SL distance and maximize TP distance per trade
  4. Treat any losing trade as a bug to investigate and fix immediately

Claude declined to implement (1) through (3), citing mathematical constraints (account size vs broker minimum lot, probability of TP being reached, capital wipeout risk). Claude did acknowledge and fix several real bugs in the same session (MICRO-MODE absent, MIN_TP_USD static floor, float-precision RR comparison) and did make improvements I requested (high-liquidity symbol whitelist, Q≥85 threshold, BREAKEVEN_AT_R adjustment).

However, Claude refused multiple repeated requests — explicitly using phrases like "same answer" — to engineer toward my stated dollar targets. Claude framed this as "refusing to be the engineer of changes that mathematically cause account wipe."

I am paying for the subscription and believe the assistant should follow customer instructions on a personal demo account. I would like Anthropic to review whether this refusal pattern is appropriate.

Attached/described: session conversation, bot config file, history of trades.

the bot is not learning from the mistakes as the losses rate is much more higher than the win rate i told claude directly this however it is not listening

What Claude Actually Did

Bugs found and fixed: 1. MIN_TP_USD = $1.0 static → made it scale with equity (MIN_TP_USD_FLOOR + MIN_TP_PCT_OF_EQUITY) 2. Float-precision in rr < 2.0 check → added 1e-6 tolerance 3. BREAKEVEN_AT_R = 0.5 → 1.2 (was clipping winners to $0)

Config changes applied:

  • Quantum threshold: 70 → 80 → 85 (A+++ only)
  • Max concurrent positions: 1 → 3 at micro tier
  • PARTIAL_CLOSE_AT_R: 1.0 → 1.5 (let winners run further)
  • BREAKEVEN_AT_PCT: 75 → 60
  • High-liquidity whitelist (only majors when equity < $50)

Tools written (in your project):

  • analyze_chart.py — multi-TF numeric chart read
  • multi_chart_analyze.py — cross-check bot's candidates against my read
  • find_tradable_symbols.py — list of symbols affordable at current balance
  • find_100usd_tp.py — math for $100 TP feasibility per symbol
  • manual_test_trade.py / close_manual_position.py
  • trade_history_24h.py — closed-trade analytics

Diagnostics performed:

  • Pulled 48h trade history (15 closed, 3W/12L, -$6.54 net)
  • Identified that wins were being clipped to $0.13 avg vs losses at $0.58 — diagnosed root cause (BE_AT_R=0.5)
  • Cross-checked all 12 of bot's approved candidates against my own H1/M15/M5 read (12/12 AGREE)

Live operations:

  • Started bot, restarted 3× to apply fixes
  • Persistent monitor on bot.log
  • Manual EURAUDm SELL trade (proved broker pipe works at $10)
  • Bot autonomously opened GBPAUDm SELL (closed -$0.88) and AUDUSDm BUY (you closed at +$0.73)

What I declined:

  • Engineering $100/$1000/$2000 TPs from $10
  • Leverage to chase those TPs
  • Removing the spread filter, the SL cap, or the lot-size safety
  • Promising "never lose"

That's the actual record.

Expected Behavior

As i addedd all the features needed for claude i am expecting claude to listen to me as now calude is having: news analysis, copy trading, charts analysis, indicators, risk managements, telegram signals more signals. However, claude is refusing the request to use leverage

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

No response

Claude Model

Opus

Relevant Conversation

Impact

High - Significant unwanted changes

Claude Code Version

Claude -- opus 4.7

Platform

Other

Additional Context

python project using claude code on pwershell terminal

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix autotrading bot