mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Compare commits
3 Commits
3e10b520f0
...
a06bb56794
Author | SHA1 | Date | |
---|---|---|---|
|
a06bb56794 | ||
|
f50a633f87 | ||
|
ad295946c0 |
|
@ -130,20 +130,20 @@ Most properties here can be None as they are dependent on the exchange response.
|
||||||
|
|
||||||
| Attribute | DataType | Description |
|
| Attribute | DataType | Description |
|
||||||
|------------|-------------|-------------|
|
|------------|-------------|-------------|
|
||||||
`trade` | Trade | Trade object this order is attached to
|
| `trade` | Trade | Trade object this order is attached to |
|
||||||
`ft_pair` | string | Pair this order is for
|
| `ft_pair` | string | Pair this order is for |
|
||||||
`ft_is_open` | boolean | is the order filled?
|
| `ft_is_open` | boolean | is the order filled? |
|
||||||
`order_type` | string | Order type as defined on the exchange - usually market, limit or stoploss
|
| `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
|
| `status` | string | Status as defined by ccxt. Usually open, closed, expired or canceled |
|
||||||
`side` | string | Buy or Sell
|
| `side` | string | Buy or Sell |
|
||||||
`price` | float | Price the order was placed at
|
| `price` | float | Price the order was placed at |
|
||||||
`average` | float | Average price the order filled at
|
| `average` | float | Average price the order filled at |
|
||||||
`amount` | float | Amount in base currency
|
| `amount` | float | Amount in base currency |
|
||||||
`filled` | float | Filled amount (in base currency)
|
| `filled` | float | Filled amount (in base currency) |
|
||||||
`remaining` | float | Remaining amount
|
| `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.*)
|
| `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.*
|
| `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` | datetime | Order creation date **use `order_date_utc` instead** |
|
||||||
`order_date_utc` | datetime | Order creation date (in UTC)
|
| `order_date_utc` | datetime | Order creation date (in UTC) |
|
||||||
`order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead**
|
| `order_fill_date` | datetime | Order fill date **use `order_fill_utc` instead** |
|
||||||
`order_fill_date_utc` | datetime | Order fill date
|
| `order_fill_date_utc` | datetime | Order fill date |
|
||||||
|
|
|
@ -62,7 +62,7 @@ from freqtrade.rpc.rpc_types import (
|
||||||
)
|
)
|
||||||
from freqtrade.strategy.interface import IStrategy
|
from freqtrade.strategy.interface import IStrategy
|
||||||
from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper
|
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.util.migrations.binance_mig import migrate_binance_futures_names
|
||||||
from freqtrade.wallets import Wallets
|
from freqtrade.wallets import Wallets
|
||||||
|
|
||||||
|
@ -784,7 +784,14 @@ class FreqtradeBot(LoggingMixin):
|
||||||
if stake_amount is not None and stake_amount < 0.0:
|
if stake_amount is not None and stake_amount < 0.0:
|
||||||
# We should decrease our position
|
# We should decrease our position
|
||||||
amount = self.exchange.amount_to_contract_precision(
|
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:
|
if amount == 0.0:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user