Skip to content

Commit

Permalink
2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Feb 16, 2024
1 parent 2b1553d commit cc86179
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.1.1 - 2024-02-16
### Fix
* `check_min_amount()`
* `restore_strategy_state()`

## 2.1.0 - 2024-02-16
### Added for new features
:rocket: Complete cyclic optimization of strategy parameters based on [`optuna` framework](https://optuna.readthedocs.io/en/stable/index.html)
Expand Down
2 changes: 1 addition & 1 deletion martin_binance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__author__ = "Jerry Fedorenko"
__copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM"
__license__ = "MIT"
__version__ = "2.1.0"
__version__ = "2.1.1"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down
12 changes: 6 additions & 6 deletions martin_binance/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__author__ = "Jerry Fedorenko"
__copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM"
__license__ = "MIT"
__version__ = "2.1.0"
__version__ = "2.1.1"
__maintainer__ = "Jerry Fedorenko"
__contact__ = 'https://github.com/DogsTailFarmer'
##################################################################
Expand Down Expand Up @@ -825,12 +825,12 @@ def restore_strategy_state(self, strategy_state: Dict[str, str] = None, restore=
if not grid_open_orders_len and self.orders_hold:
self.message_log("Restore, no grid orders, place from hold now", tlg=True)
self.place_grid_part()
if not GRID_ONLY and self.shift_grid_threshold is None and not tp_order:
self.message_log("Restore, no TP order, replace", tlg=True)
self.place_profit_order()
if not self.orders_grid and not self.orders_hold and not self.orders_save and not self.tp_order_id:
self.message_log("Restore, Restart", tlg=True)
self.start()
if not GRID_ONLY and self.shift_grid_threshold is None and not tp_order:
self.message_log("Restore, no TP order, replace", tlg=True)
self.place_profit_order()
#
self.message_log("Restored, go work", tlg=True)

Expand Down Expand Up @@ -2404,12 +2404,12 @@ def check_min_amount(self, amount=O_DEC, price=O_DEC, for_tp=True, by_market=Fal
else:
min_trade_amount = tcm.get_min_buy_amount(_price)
if not _amount:
if for_tp:
if for_tp and self.sum_amount_first:
_tp = self.calc_profit_order(not self.cycle_buy, by_market=by_market, log_output=False)
if _tp['target'] * _tp['price'] < tcm.min_notional:
return False
_amount = _tp['amount']
else:
elif not for_tp:
_amount = self.deposit_first
_amount = self.round_truncate(_amount, base=True)
return _amount >= min_trade_amount
Expand Down

0 comments on commit cc86179

Please sign in to comment.