Merge branch 'develop' into feat_readjust_entry
This commit is contained in:
@@ -64,7 +64,10 @@ Binance supports [time_in_force](configuration.md#understand-order_time_in_force
|
||||
For Binance, please add `"BNB/<STAKE>"` to your blacklist to avoid issues.
|
||||
Accounts having BNB accounts use this to pay for fees - if your first trade happens to be on `BNB`, further trades will consume this position and make the initial BNB trade unsellable as the expected amount is not there anymore.
|
||||
|
||||
### Binance Futures' order pricing
|
||||
### Binance Futures
|
||||
|
||||
Binance has specific (unfortunately complex) [Futures Trading Quantitative Rules](https://www.binance.com/en/support/faq/4f462ebe6ff445d4a170be7d9e897272) which need to be followed, and which prohibit a too low stake-amount (among others) for too many orders.
|
||||
Violating these rules will result in a trading restriction.
|
||||
|
||||
When trading on Binance Futures market, orderbook must be used because there is no price ticker data for futures.
|
||||
|
||||
|
@@ -419,7 +419,7 @@ The function must return either `True` (cancel order) or `False` (keep order ali
|
||||
|
||||
``` python
|
||||
from datetime import datetime, timedelta
|
||||
from freqtrade.persistence import Trade
|
||||
from freqtrade.persistence import Trade, Order
|
||||
|
||||
class AwesomeStrategy(IStrategy):
|
||||
|
||||
@@ -431,7 +431,7 @@ class AwesomeStrategy(IStrategy):
|
||||
'exit': 60 * 25
|
||||
}
|
||||
|
||||
def check_entry_timeout(self, pair: str, trade: 'Trade', order: dict,
|
||||
def check_entry_timeout(self, pair: str, trade: 'Trade', order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
if trade.open_rate > 100 and trade.open_date_utc < current_time - timedelta(minutes=5):
|
||||
return True
|
||||
@@ -442,7 +442,7 @@ class AwesomeStrategy(IStrategy):
|
||||
return False
|
||||
|
||||
|
||||
def check_exit_timeout(self, pair: str, trade: Trade, order: dict,
|
||||
def check_exit_timeout(self, pair: str, trade: Trade, order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
if trade.open_rate > 100 and trade.open_date_utc < current_time - timedelta(minutes=5):
|
||||
return True
|
||||
@@ -460,7 +460,7 @@ class AwesomeStrategy(IStrategy):
|
||||
|
||||
``` python
|
||||
from datetime import datetime
|
||||
from freqtrade.persistence import Trade
|
||||
from freqtrade.persistence import Trade, Order
|
||||
|
||||
class AwesomeStrategy(IStrategy):
|
||||
|
||||
@@ -472,22 +472,22 @@ class AwesomeStrategy(IStrategy):
|
||||
'exit': 60 * 25
|
||||
}
|
||||
|
||||
def check_entry_timeout(self, pair: str, trade: Trade, order: dict,
|
||||
def check_entry_timeout(self, pair: str, trade: 'Trade', order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
ob = self.dp.orderbook(pair, 1)
|
||||
current_price = ob['bids'][0][0]
|
||||
# Cancel buy order if price is more than 2% above the order.
|
||||
if current_price > order['price'] * 1.02:
|
||||
if current_price > order.price * 1.02:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def check_exit_timeout(self, pair: str, trade: Trade, order: dict,
|
||||
def check_exit_timeout(self, pair: str, trade: 'Trade', order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
ob = self.dp.orderbook(pair, 1)
|
||||
current_price = ob['asks'][0][0]
|
||||
# Cancel sell order if price is more than 2% below the order.
|
||||
if current_price < order['price'] * 0.98:
|
||||
if current_price < order.price * 0.98:
|
||||
return True
|
||||
return False
|
||||
```
|
||||
|
@@ -183,11 +183,11 @@ class AwesomeStrategy(IStrategy):
|
||||
|
||||
``` python hl_lines="2 6"
|
||||
class AwesomeStrategy(IStrategy):
|
||||
def check_entry_timeout(self, pair: str, trade: 'Trade', order: dict,
|
||||
def check_entry_timeout(self, pair: str, trade: 'Trade', order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
return False
|
||||
|
||||
def check_exit_timeout(self, pair: str, trade: 'Trade', order: dict,
|
||||
def check_exit_timeout(self, pair: str, trade: 'Trade', order: 'Order',
|
||||
current_time: datetime, **kwargs) -> bool:
|
||||
return False
|
||||
```
|
||||
|
@@ -2,6 +2,10 @@
|
||||
|
||||
To update your freqtrade installation, please use one of the below methods, corresponding to your installation method.
|
||||
|
||||
!!! Note "Tracking changes"
|
||||
Breaking changes / changed behavior will be documented in the changelog that is posted alongside every release.
|
||||
For the develop branch, please follow PR's to avoid being surprised by changes.
|
||||
|
||||
## docker-compose
|
||||
|
||||
!!! Note "Legacy installations using the `master` image"
|
||||
|
Reference in New Issue
Block a user