Skip to content

Conversation

@Mirza-Samad-Ahmed-Baig
Copy link
Contributor

This PR addresses two issues:

  1. Critical bug fix: Division by zero in RSI calculation
  2. Documentation fix: Missing bullet point in Traditional Chinese README

Type of Change

Type of Change: Bug Fix / Documentation Update

Changes Made

Critical Bug Fix

  • File: python/valuecell/agents/auto_trading_agent/market_data.py
  • Issue: Division by zero error in RSI calculation when loss is zero
  • Impact: Application crash during technical analysis when there are no downward price movements
  • Solution: Replace zero loss values with infinity, resulting in RSI = 100 (maximum strength)
  • Why this is correct: When there are no losses, all movement is gains, which means maximum relative strength

Documentation Fix

  • File: README.zh_Hant.md
  • Issue: Missing bullet point marker before Trading Agents section
  • Solution: Added - marker for consistency with other language versions

Testing

  • Verified the markdown renders correctly
  • Reviewed RSI calculation logic for edge cases
  • Confirmed fix prevents ZeroDivisionError

Checklist

  • I have read the Code of Conduct
  • I have followed the Contributing Guidelines
  • My changes follow the project's coding style

When loss is zero (no downward price movements), the RSI calculation
would crash with ZeroDivisionError. Now replaces zero loss with infinity,
resulting in RSI = 100 (maximum strength), which is the correct behavior.
hazeone
hazeone previously approved these changes Oct 28, 2025
Copy link
Contributor

@hazeone hazeone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,thanks for your contribution!

@hazeone hazeone added the bug Something isn't working label Oct 28, 2025
@hazeone
Copy link
Contributor

hazeone commented Oct 28, 2025

You need run source python/.venv/bin/activate, use make format command to fix the style check

@Mirza-Samad-Ahmed-Baig
Copy link
Contributor Author

Mirza-Samad-Ahmed-Baig commented Oct 28, 2025

Done buddy, thanks

Copy link
Contributor

@hazeone hazeone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hazeone hazeone merged commit abf7797 into ValueCell-ai:main Oct 29, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants