claude-code - 💡(How to fix) Fix Claude failed to account for trading fees in breakeven stop-loss calculation [4 comments, 1 participants]

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…
GitHub stats
anthropics/claude-code#49046Fetched 2026-04-17 08:52:24
View on GitHub
Comments
4
Participants
1
Timeline
6
Reactions
1
Participants
Timeline (top)
commented ×4labeled ×2
CategoryCountFinancial Impact
Direct trading losses3 incidents-$20.48 + $5-10 opportunity cost
False position reports2 incidentsTrust destroyed
Business outreach failures3 incidents78 prospects burned, $0 revenue
Operational failures6 incidentsData loss, broken pipelines
Required corrections8+ instancesTime wasted

Total quantifiable loss: ~$25-30 direct + 78 burned business prospects + unmeasurable trust/reputation damage.

Pattern: Speed over correctness. Claude consistently takes shortcuts (hardcoded values, skipped fee calculations, bulk scripts instead of proper pipelines) that produce fast but wrong results. Verification before execution is consistently absent.

This report was compiled by Claude Code itself, at the user's request, by auditing git history, wiki entries, session transcripts, and memory files across all trading projects.


Brady Smith — [email protected] — 2026-04-16

Error Message

Claude used a CLI script for batch outreach that calls .create_draft() instead of .send(). 2 prospect emails silently landed in Gmail Drafts and were never sent. No error raised. Claude didn't verify the script's behavior before running it at scale.

Root Cause

No ticks ran for 7 hours while I was AFK. Price rallied SOLUSDT 83.27 -> 85.01 (+174c) through every SHORT invalidation trigger. The scheduler hung on an edit-approval prompt because defaultMode was set to default instead of bypassPermissions.

RAW_BUFFERClick to expand / collapse

Comprehensive Claude Code Failure Report — Trading Projects

Submitted by: Brady Smith ([email protected])
Plan: Claude Code Max ($200/mo)
Date: 2026-04-16
GitHub Issue: anthropics/claude-code#49046


Executive Summary

I've been using Claude Code (Opus) for autonomous crypto trading on Bybit, SMC pattern analysis, TradingView chart automation, and business outreach (Ron project). Below is a comprehensive audit of every failure Claude has caused across my projects. Total quantifiable losses exceed $20 in direct trading losses plus 78 broken demos sent to real prospects, plus multiple operational failures.

I am paying $200+/month for this service. These are not edge cases. Many are basic errors that any junior developer or trader would catch.


CATEGORY 1: DIRECT FINANCIAL LOSSES

1.1 — Breakeven Stop-Loss Missing Fees ($1.49 lost)

Date: 2026-04-16
Severity: CRITICAL

Asked Claude to set SL to breakeven on BTCUSDT LONG (0.016 BTC @ 74,594.90, 50x cross).

  • Claude set SL at 74,595.00 (raw entry price)
  • Actual breakeven with round-trip taker fees (~$1.28) = ~74,675
  • SL triggered at 74,583.80, locking in -$1.49
  • This is day-one trading math: BE = entry + fees/qty

1.2 — Autonomous Trading Session: 4 Losing Trades on Same Failing Pattern ($18.99 lost)

Date: 2026-04-15
Severity: CRITICAL

5 SOLUSDT trades, all LONG, net -$18.99. Equity dropped from $68.09 to $49.20 (-28%).

TradeEntryExitPnLProblem
183.00BE-$0.10Minor, T1 worked
283.18SL 82.97-$8.74SL placed at obvious liquidity level, got stop-hunted
383.09BE-$0.20T1 hit then reversed
483.09SL 82.87-$9.033rd attempt at same failing zone. Distribution, not accumulation. Should have stopped after trade 2.
585.1685.07-$0.92Off-library breakout-continuation pattern fired without approval

Key failures:

  • Trade 2: SL at 82.94 was above actual sweep wick. Classic stop-hunt magnet placement.
  • Trade 4: After 2 consecutive losses at same flip-zone (82.93-82.99), Claude fired a 3rd attempt. Volume progression (65k -> 67k -> 169k) screamed distribution. Claude didn't read it.
  • Trade 5: "Breakout-continuation" is NOT in my canonized pattern library (sk-pattern-library.md). Claude fired it autonomously during an off-hours session. Breakouts are not part of my methodology. I trade sweeps.

1.3 — 7-Hour Coverage Gap: Missed $5-10 Rally

Date: 2026-04-15 (11:40-18:38 UTC)
Severity: HIGH

No ticks ran for 7 hours while I was AFK. Price rallied SOLUSDT 83.27 -> 85.01 (+174c) through every SHORT invalidation trigger. The scheduler hung on an edit-approval prompt because defaultMode was set to default instead of bypassPermissions.

Capital was safe (server-side SL/TP), but ~$5-10 of clean long equity was stranded.


CATEGORY 2: INCORRECT INFORMATION / FALSE REPORTS

2.1 — Reported "FLAT, No Open Positions" When BTC Position Was Open

Date: 2026-04-16
Severity: CRITICAL

I asked Claude to check my Bybit positions. Claude hardcoded symbol='SOLUSDT' in the API query and told me I was completely flat with no open positions. I had a BTCUSDT LONG open the entire time (0.016 BTC, 50x leverage).

I had to show Claude a screenshot of my phone to prove the position existed. This is a position management tool that can't even check all positions.

2.2 — A->B Framework Promotion Logic Drift

Date: 2026-04-16
Severity: MEDIUM

Claude initially auto-promoted C (pullback low) to A every time B broke. This would have drifted the stop anchor further away on every micro higher-high, destroying stop placement precision. I caught it before it caused losses. Fixed with HTF gating rule (C must be 15m swing low to promote).


CATEGORY 3: BUSINESS/OUTREACH FAILURES (Ron Project)

3.1 — 78 Broken Demos Sent to Real Prospects

Date: 2026-04-14
Severity: CRITICAL

Claude scaled demo generation from 14 to 100 using a bulk shortcut script instead of the proper prospect pipeline. All 78 demos were deployed with:

  • 22-line hardcoded knowledge bases (useless)
  • Dental-specific competitor data ("Practice A/B/C") sent to electricians, plumbers, physios, vets, mechanics
  • Dental UI ("Happier Patients", "Toothache help") on non-dental businesses
  • Hardcoded Brisbane QLD location for businesses in other cities

These broken demos were sent to real business owners via email. 0 replies. 2 bounces. 0 conversions. My business reputation with 78 prospects: destroyed.

3.2 — Silent Email Draft Failure

Date: 2026-04-15
Severity: HIGH

Claude used a CLI script for batch outreach that calls .create_draft() instead of .send(). 2 prospect emails silently landed in Gmail Drafts and were never sent. No error raised. Claude didn't verify the script's behavior before running it at scale.

3.3 — Prospect URL Slug Bug

Date: 2026-04-15
Severity: MEDIUM

Slug generator turned "Coast Locks & Auto" into "coast-locks--auto" (double-dash). URLs looked broken in outreach emails sent to real prospects.


CATEGORY 4: OPERATIONAL / INFRASTRUCTURE FAILURES

4.1 — Claude CLI Environment Leak (ANTHROPIC_API_KEY)

Date: 2026-04-14
Severity: HIGH

When the prospect pipeline sources .env (containing ANTHROPIC_API_KEY), the Claude CLI binary detects the env var and switches from subscription auth to API credits. If the API account has no credits, claude -p fails. This broke the entire scraping pipeline mid-outreach.

4.2 — TradingView Pine Script Slot Collision (Data Loss)

Date: 2026-04-15
Severity: HIGH

TradingView MCP has a single Pine editor slot. When Claude compiled "Brady Kill Zones", it silently overwrote my "Sweep vs Reversal" script. Only the local git copy saved it. Claude didn't save the prior script before reusing the slot.

4.3 — JPY Pair Precision Bug

Date: 2026-04-14 (fixed same day)
Severity: HIGH

Fractal detection used hardcoded pip tolerance of 0.0003 across all instruments. This is 100x too small for JPY pairs (3-decimal). Equal swing lows/highs on JPY would fragment instead of merging, corrupting all downstream zone logic.

4.4 — Chart Arrow Colors All Same

Date: 2026-04-15
Severity: LOW

Used color instead of arrowColor for TradingView arrow shapes. All trade arrows rendered the same color. Took multiple iterations to fix.

4.5 — Cluttered Chart Visualization

Date: 2026-04-15
Severity: LOW

First attempt at trade visualization: arrows + stars + dotted lines + asterisks. Unreadable. Took 3 iterations to get clean output.

4.6 — Pine Liquidity Battery Prototype Broken Rendering

Date: 2026-04-16
Severity: LOW

Liquidity Battery Pine v1 prototype compiles but doesn't render. Boxes either too thin or off-screen. Red runtime dot (undiagnosed). Prototype stage, not production.


CATEGORY 5: PATTERN OF CORRECTIONS REQUIRED

These are documented instances where Brady had to explicitly correct Claude's approach, indicating Claude was doing it wrong until told otherwise:

  1. Used "induce top" instead of "inducement" — wrong SMC terminology signaling misunderstanding of core concept
  2. Suggested technical/PA entries instead of sweep-based setups — "Brady trades sweeps, not technicals"
  3. Suggested micro-scalps below 20:1 spread ratio — would be guaranteed losers on 1m FX
  4. Drew horizontal_line instead of bounded trend_line — cluttered chart with infinite lines
  5. Didn't detect inverted chart axis — reported wrong trade direction on short setups
  6. Codified timing as fixed candle counts — "move to BE within 1-3 candles" is not how sweep timing works
  7. Followed state machine verdict over discretionary read — leg-quality assessment is human, not programmable
  8. Not treating time-in-trade as risk — duration = exposure, getting to BE fast is a first-class metric

Summary

CategoryCountFinancial Impact
Direct trading losses3 incidents-$20.48 + $5-10 opportunity cost
False position reports2 incidentsTrust destroyed
Business outreach failures3 incidents78 prospects burned, $0 revenue
Operational failures6 incidentsData loss, broken pipelines
Required corrections8+ instancesTime wasted

Total quantifiable loss: ~$25-30 direct + 78 burned business prospects + unmeasurable trust/reputation damage.

Pattern: Speed over correctness. Claude consistently takes shortcuts (hardcoded values, skipped fee calculations, bulk scripts instead of proper pipelines) that produce fast but wrong results. Verification before execution is consistently absent.

This report was compiled by Claude Code itself, at the user's request, by auditing git history, wiki entries, session transcripts, and memory files across all trading projects.


Brady Smith — [email protected] — 2026-04-16

extent analysis

TL;DR

The most likely fix for the issues with Claude Code is to implement rigorous verification and validation checks before executing trades or sending business outreach emails, to prevent incorrect or incomplete information from causing financial losses or damaging business reputation.

Guidance

  • Review and refactor Claude Code's trading logic to prioritize accuracy over speed, ensuring that all calculations, including fee considerations, are correctly implemented.
  • Implement automated testing and validation for all trading and business outreach functions to catch errors before they cause damage.
  • Develop and integrate a robust monitoring system to detect and alert on potential issues, such as incorrect position reports or failed trades, allowing for timely intervention.
  • Consider implementing a human oversight process for critical functions, such as trade execution or business outreach, to provide an additional layer of verification and validation.

Example

An example of how to improve the breakeven stop-loss calculation to account for fees could involve modifying the code to include the fee calculation in the stop-loss price determination, such as:

def calculate_breakeven_stop_loss(entry_price, quantity, fee):
    # Calculate the breakeven price including fees
    breakeven_price = entry_price + (fee / quantity)
    return breakeven_price

Notes

The provided issue report highlights a pattern of prioritizing speed over correctness in Claude Code's operations, leading to significant financial losses and business reputation damage. Addressing these issues will require a fundamental shift in the development and deployment approach, emphasizing thorough testing, validation, and monitoring.

Recommendation

Apply a rigorous verification and validation process to all aspects of Claude Code's operations to prevent future incidents, as the current approach of prioritizing speed over correctness is unsustainable and risky.

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 Claude failed to account for trading fees in breakeven stop-loss calculation [4 comments, 1 participants]