Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/performance page endpoints #36

Merged

Conversation

tomasgaudino
Copy link
Contributor

Enhancements and Updates

This PR introduces the following enhancements and updates:

Database parsing and management:

  • List and read databases
  • Create, list and read checkpoints

Performance processing:

  • Get performance results through backtesting engine

@tomasgaudino
Copy link
Contributor Author

@cardosofede ready for review

@tomasgaudino
Copy link
Contributor Author

@nikspz @rapcmia hey guys can you take a look to this pr please?

@rapcmia
Copy link
Contributor

rapcmia commented Oct 28, 2024

@nikspz @rapcmia hey guys can you take a look to this pr please?

Hi @tomasgaudino im currently blocked by an issue i found on my local machine and created a ticket so others to confirm hummingbot/dashboard#187, other than that i am able to setup and run backtesting and manually create container using :8000/docs, will update more of my tests later tonight

@rapcmia rapcmia self-requested a review October 29, 2024 04:42
Copy link

@rapcmia
Copy link
Contributor

rapcmia commented Oct 29, 2024

PR update:

  • Setup this PR with development dashboard and broker
  • Compare this PR with development branch
    • Found new endpoints for market performance and database management
  • Deployed an instance and wait for few trades to happened
  • Run endpoints after getting few trades
  • Database:
    • post /list-databases
      image
    • post /read-databases
      image
    • post /create-checkpoints
      • create a checkpoint sqlite file and saved on ./bots/data folder
    • post /list-checkpoints
      • Displays all available checkpoint on ./bots/data folder
      • Toggle between false and true to display full dir ok
    • post /load-checkpoint
      • Load the dir path of the checkpoint
      • Displays executors, orders, trade_fill and controller tables
        image

For post /get-performance-results
image

  • Can you advise a sample response schema to use?

Copy link
Contributor

@cardosofede cardosofede left a comment

Choose a reason for hiding this comment

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

remove the * and it's good to go @rapcmia let's continue with the review after @tomasgaudino answers

bots/conf/controllers/.gitignore Outdated Show resolved Hide resolved
@rapcmia
Copy link
Contributor

rapcmia commented Nov 7, 2024

PR update:

  • Ran tests with Feat/strategy performance page v2 dashboard#184
  • When trying to load strategy performance backend-api crashed
    INFO:     127.0.0.1:54484 - "GET /get-active-bots-status HTTP/1.1" 200 OK
    INFO:     127.0.0.1:54488 - "POST /list-databases HTTP/1.1" 500 Internal Server Error
    ERROR:    Exception in ASGI application
    Traceback (most recent call last):
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
        result = await app(  # type: ignore[func-returns-value]
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
        return await self.app(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in __call__
        await super().__call__(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/applications.py", line 113, in __call__
        await self.middleware_stack(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in __call__
        raise exc
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in __call__
        await self.app(scope, receive, _send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
        await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
        raise exc
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
        await app(scope, receive, sender)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/routing.py", line 715, in __call__
        await self.middleware_stack(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/routing.py", line 735, in app
        await route.handle(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle
        await self.app(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/routing.py", line 76, in app
        await wrap_app_handling_exceptions(app, request)(scope, receive, send)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
        raise exc
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
        await app(scope, receive, sender)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/starlette/routing.py", line 73, in app
        response = await f(request)
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/fastapi/routing.py", line 301, in app
        raw_response = await run_endpoint_function(
      File "/Users/rapcomia/miniconda3/envs/backend-api/lib/python3.10/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
        return await dependant.call(**values)
      File "/Users/rapcomia/github/hummingbot/backend-api/36/routers/manage_databases.py", line 19, in list_databases
        return file_system.list_databases()
      File "/Users/rapcomia/github/hummingbot/backend-api/36/utils/file_system.py", line 207, in list_databases
        archived_instances = self.list_folders("archived")
      File "/Users/rapcomia/github/hummingbot/backend-api/36/utils/file_system.py", line 47, in list_folders
        return [d for d in os.listdir(dir_path) if os.path.isdir(os.path.join(dir_path, d))]
    FileNotFoundError: [Errno 2] No such file or directory: 'bots/archived'
    

Steps to reproduce:

  1. Setup this PR with Feat/strategy performance page v2 dashboard#184 and broker
  2. Go to Strategy Performance page

@cardosofede cardosofede merged commit fc9616f into hummingbot:main Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Development 2.2.0
Development

Successfully merging this pull request may close these issues.

4 participants