1124 Commits

Author SHA1 Message Date
Matthias
38a470098f test: shorten explanatory comment 2026-01-15 19:27:52 +01:00
Matthias
b0eb5c77ec test: add additional test case for rpc_balance 2026-01-15 18:17:53 +01:00
Matthias
0d5bd94f43 test: switch futures position to ADA 2026-01-15 18:17:53 +01:00
Matthias
735284dccd test: extend rpc_balance test for short and long positions 2026-01-15 18:17:53 +01:00
Matthias
45b6ec95a4 test: add tests for point annotations 2026-01-09 20:00:33 +01:00
Matthias
31cf2dd46d test: improve rpc_balance handle error test 2026-01-09 06:49:17 +01:00
Matthias
06a53924d7 test: improve balance rpc test 2026-01-08 20:53:29 +01:00
Matthias
f08f19d1cb test: Change test to ADA (it's in markets)
Mock trades for balance test
2026-01-08 20:37:12 +01:00
Matthias
60425e6237 test: update rpc tests to new calculation mode 2026-01-08 06:47:17 +01:00
Matthias
b9a4918d61 test: reset converter before and after fiat conversions 2026-01-03 14:33:08 +01:00
Matthias
0d7127bb6a refactor: use metaclass for Singleton in FiatConverter 2026-01-03 14:06:17 +01:00
Matthias
cfd048e74e test: mock fiat_convert entry method 2026-01-03 14:02:18 +01:00
Matthias
c911332da3 test: simplify telegram fiat_convert mocking 2026-01-03 13:51:39 +01:00
Matthias
43a849d45d test: remove pointless mocks 2026-01-03 13:46:37 +01:00
Matthias
3ad502b073 test: mock object instead of global mock 2026-01-03 13:40:18 +01:00
Matthias
6d4ad393d5 test: cleanup unneeded mocks from test_rpc 2026-01-03 13:18:23 +01:00
Matthias
69cc238700 Merge pull request #12560 from stash86/main-stash
add more metrics on profit stat
2026-01-03 12:51:18 +01:00
Matthias
577464c12d Merge pull request #12506 from dev-starlight/develop
fix, Add UTF-8 encoding to read_text method
2026-01-02 13:56:25 +01:00
Matthias
bc2be74b36 fix: further fixes for utf8 reading on windows 2026-01-02 12:20:09 +00:00
Matthias
8a33b71351 test: update exchange api test 2026-01-02 11:40:10 +01:00
Stefano
1e6d832f71 fix test 2025-12-31 10:40:09 +09:00
Matthias
0ed3bdc747 test: add test for force exit API logic 2025-12-14 17:57:52 +01:00
Matthias
8af0631ff0 Merge pull request #12599 from freqtrade/fix/dynamic_funding_fees
Adjust to dynamic funding fees
2025-12-14 17:56:34 +01:00
Matthias
b406219515 test: add candle_types test 2025-12-14 15:51:06 +01:00
Matthias
4c3d9b8c70 test: simplify some stoploss test setups 2025-12-10 19:28:30 +01:00
Matthias
7f831f8a9c test: update tests for new test pairs 2025-12-04 21:28:31 +01:00
Matthias
a4e6ac0c7f test: update test for new status table behavior 2025-11-23 08:18:51 +01:00
Matthias
b364153d02 feat: add nr_of_successful_* to api 2025-11-22 15:46:34 +01:00
Matthias
916d8324cb test: update tests with new fields 2025-11-22 13:48:57 +01:00
Matthias
cdd9968831 test: use realistic arguments for tests 2025-10-31 07:02:53 +01:00
Matthias
34cba1480e test: improved line-annotation test-case 2025-10-08 07:07:39 +02:00
Matthias
9ea249180a test: add annotation line test 2025-10-08 06:42:53 +02:00
Matthias
9f436dcd1e chore: fix RUF043 violations 2025-09-15 19:20:20 +02:00
Matthias
95a710d4a8 chore: fix RUF059 violations 2025-09-15 19:15:43 +02:00
Matthias
739a67fdcb test: add test for new webhook functionality 2025-08-31 08:41:12 +02:00
Matthias
2542102280 test: Test telegram init exception handling 2025-08-30 20:02:03 +02:00
Matthias
07906d2576 test: update api backtest test 2025-08-17 15:02:28 +02:00
Matthias
5e64416dfa test: add test for profit_all 2025-07-18 20:17:19 +02:00
Matthias
571497e58b Merge pull request #11974 from qqqqqf-q/feat/telegram-profit-direction
feat(telegram): Add /profit long and /profit short commands
2025-07-18 06:54:21 +02:00
Matthias
35dab9b566 test: fix typo in test name 2025-07-17 07:28:53 +02:00
Matthias
2b05a49671 test: Update telegram /profit tests 2025-07-17 07:26:45 +02:00
Matthias
b79b5b6c32 refactor: move profit test next to each other 2025-07-17 07:21:05 +02:00
Matthias
78124cd025 feat: support /profit long, too 2025-07-17 07:20:15 +02:00
qqqqqf
19b57ad87e Add /profit long and /profit short commands#2
# Added `/profit_long` and `/profit_short` Commands

Users can now use commands like:

- `/profit_long [<n>]`
- `/profit_short [<n>]`
- `/profit [<n>]`

---

## Key Changes Implemented

### `freqtrade/rpc/telegram.py`:

- The `_profit` command handler has been updated to robustly parse `long` or `short` as optional arguments.
  - **Translation:** The `_profit` command handler has been improved to reliably interpret `long` or `short` as optional parameters.

- The determined direction is passed to the RPC layer.
  - **Translation:** The direction determined (either `long` or `short`) is passed to the RPC layer.

- The `/help` command documentation is updated.
  - **Translation:** The documentation for the `/help` command has been updated accordingly.

---

### `freqtrade/rpc/rpc.py`:

- The `_rpc_trade_statistics` method now accepts a direction parameter.
  - **Translation:** The `_rpc_trade_statistics` method has been updated to accept a `direction` parameter.

- The method has been refactored into a main function and a `_process_trade_stats` helper function to reduce complexity and improve readability.
  - **Translation:** The method has been refactored into a main function and a helper function, `_process_trade_stats`, to reduce complexity and improve readability.

- The database query filter is dynamically modified to include a condition on `Trade.is_short` when a direction is provided.
  - **Translation:** The database query filter dynamically adjusts to include a condition on `Trade.is_short` when a direction is specified.

---

### `tests/rpc/test_rpc_telegram.py`:

- Existing tests for `_profit` have been updated to match the new message format.
  - **Translation:** Existing tests for the `_profit` function have been updated to match the new message format.

- New test cases have been added to specifically validate the `long` and `short` filtering functionality.
  - **Translation:** New test cases have been added to specifically validate the filtering functionality for `long` and `short` trades.

---

## Testing

- All local `pytest` tests pass successfully.
  - **Translation:** All local `pytest` tests have passed successfully.

- All `ruff` linter checks pass.
  - **Translation:** All `ruff` code checks have passed.

- As I do not have a full local deployment, I am relying on the CI pipeline for final validation.
  - **Translation:** Since I don't have a complete local deployment, I am relying on the CI pipeline for final validation.

---
This time, only a little AI was used :)
Except for the translation.
2025-07-15 19:15:04 +08:00
qqqqqf
97f30cf13d feat(telegram): Add /profit long and /profit short commands
This commit enhances the /profit Telegram command to allow filtering by trade direction.

- The `_profit` handler in `telegram.py` now parses 'long'/'short' arguments and passes the direction to the RPC layer.
- The `_rpc_trade_statistics` method in `rpc.py` is updated to filter trades based on the provided direction. It has also been refactored for lower complexity.
- The `/help` command documentation is updated to reflect the new functionality.
- Corresponding unit tests in `test_rpc_telegram.py` are updated and extended to cover the new cases.
2025-07-12 08:41:39 +08:00
Matthias
2ecadabd92 chore: align API endpoints 2025-07-08 20:09:17 +02:00
Matthias
e90c60c940 chore: improved response on delete order 2025-07-07 19:26:35 +02:00
Matthias
60029c2a8b fix: improved message when nonexisting trade is deleted
part of #11967
2025-07-07 19:20:24 +02:00
Matthias
640cab2ca8 refactor: tests - update timezone.utc to UTC 2025-07-04 18:22:42 +02:00
Matthias
9bd8b7acf5 test: use event based init for telegram 2025-07-03 21:08:09 +02:00