Compare commits

...

5 Commits

Author SHA1 Message Date
Jakub W.
f1fc07dc5a
Merge 50f07e7b11 into f50a633f87 2024-09-18 07:51:30 +02:00
Matthias
f50a633f87 docs: order table formatting
Some checks failed
Build Documentation / Deploy Docs through mike (push) Waiting to run
Binance Leverage tiers update / auto-update (push) Has been cancelled
2024-09-18 07:11:12 +02:00
Matthias
ad295946c0 fix: use precise calculation for decrease adjustment calculations 2024-09-17 20:19:22 +02:00
Matthias
c28446dad0
Merge pull request #10672 from freqtrade/update/pre-commit-hooks
Some checks are pending
Build Documentation / Deploy Docs through mike (push) Waiting to run
Update pre-commit hooks
2024-09-17 06:28:16 +02:00
xmatthias
ff9d1f2728 chore: update pre-commit hooks 2024-09-17 03:03:39 +00:00
3 changed files with 27 additions and 20 deletions

View File

@ -31,7 +31,7 @@ repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.6.4'
rev: 'v0.6.5'
hooks:
- id: ruff
- id: ruff-format

View File

@ -130,20 +130,20 @@ Most properties here can be None as they are dependent on the exchange response.
| Attribute | DataType | Description |
|------------|-------------|-------------|
`trade` | Trade | Trade object this order is attached to
`ft_pair` | string | Pair this order is for
`ft_is_open` | boolean | is the order filled?
`order_type` | string | Order type as defined on the exchange - usually market, limit or stoploss
`status` | string | Status as defined by ccxt. Usually open, closed, expired or canceled
`side` | string | Buy or Sell
`price` | float | Price the order was placed at
`average` | float | Average price the order filled at
`amount` | float | Amount in base currency
`filled` | float | Filled amount (in base currency)
`remaining` | float | Remaining amount
`cost` | float | Cost of the order - usually average * filled (*Exchange dependent on futures, may contain the cost with or without leverage and may be in contracts.*)
`stake_amount` | float | Stake amount used for this order. *Added in 2023.7.*
`order_date` | datetime | Order creation date **use `order_date_utc` instead**
`order_date_utc` | datetime | Order creation date (in UTC)
`order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead**
`order_fill_date_utc` | datetime | Order fill date
| `trade` | Trade | Trade object this order is attached to |
| `ft_pair` | string | Pair this order is for |
| `ft_is_open` | boolean | is the order filled? |
| `order_type` | string | Order type as defined on the exchange - usually market, limit or stoploss |
| `status` | string | Status as defined by ccxt. Usually open, closed, expired or canceled |
| `side` | string | Buy or Sell |
| `price` | float | Price the order was placed at |
| `average` | float | Average price the order filled at |
| `amount` | float | Amount in base currency |
| `filled` | float | Filled amount (in base currency) |
| `remaining` | float | Remaining amount |
| `cost` | float | Cost of the order - usually average * filled (*Exchange dependent on futures, may contain the cost with or without leverage and may be in contracts.*) |
| `stake_amount` | float | Stake amount used for this order. *Added in 2023.7.* |
| `order_date` | datetime | Order creation date **use `order_date_utc` instead** |
| `order_date_utc` | datetime | Order creation date (in UTC) |
| `order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead** |
| `order_fill_date_utc` | datetime | Order fill date |

View File

@ -62,7 +62,7 @@ from freqtrade.rpc.rpc_types import (
)
from freqtrade.strategy.interface import IStrategy
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
from freqtrade.util import MeasureTime
from freqtrade.util import FtPrecise, MeasureTime
from freqtrade.util.migrations.binance_mig import migrate_binance_futures_names
from freqtrade.wallets import Wallets
@ -784,7 +784,14 @@ class FreqtradeBot(LoggingMixin):
if stake_amount is not None and stake_amount < 0.0:
# We should decrease our position
amount = self.exchange.amount_to_contract_precision(
trade.pair, abs(float(stake_amount * trade.amount / trade.stake_amount))
trade.pair,
abs(
float(
FtPrecise(stake_amount)
* FtPrecise(trade.amount)
/ FtPrecise(trade.stake_amount)
)
),
)
if amount == 0.0: