Skip to content

Add unit tests for the grid trading strategy #15

Description

@sanmaxdev

Background

The core trading logic in backend/app/strategy/ (grid levels, indicators, state machine, liquidation) currently has no automated test coverage. Solid tests here give contributors confidence to change the strategy safely.

Tasks

  • Add pytest tests for backend/app/strategy/grid.py (grid level + TP price math)
  • Add tests for backend/app/strategy/indicators.py (signal evaluation)
  • Add tests for backend/app/strategy/state_machine.py
  • Use fixtures for sample candle/price data (no live Binance calls)

Acceptance criteria

  • pytest -v passes locally and in CI
  • New code paths are covered with clear, isolated unit tests

New to the project? See CONTRIBUTING.md. Happy to help scope this further.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions