Skip to content

Commit

Permalink
1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Jul 4, 2023
1 parent ec57053 commit aa7f914
Show file tree
Hide file tree
Showing 6 changed files with 24 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 @@
## v1.3.3 2023-07-04
### Added for new features
* Send alarm (to db) if exist unreleased grid orders or hold TP
* Up requirements for exchanges-wrapper to 1.3.2

## v1.3.2-3 2023-07-02
### Fix
* fetch_order(): fixed status for archived order (remove it from StrategyBase.orders)
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__ = "1.3.2-3"
__version__ = "1.3.3"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down
18 changes: 15 additions & 3 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__ = "1.3.2-3"
__version__ = "1.3.3"
__maintainer__ = "Jerry Fedorenko"
__contact__ = 'https://github.com/DogsTailFarmer'
##################################################################
Expand Down Expand Up @@ -906,7 +906,19 @@ def save_strategy_state(self, return_only=False) -> Dict[str, str]:
and not self.tp_hold
and not self.tp_was_filled
and not self.orders_init)
if MODE in ('T', 'TC') and stable_state:
if (MODE in ('T', 'TC')
and (
stable_state
or (
self.grid_hold.get('timestamp')
and int(self.local_time() - self.grid_hold['timestamp']) > HOLD_TP_ORDER_TIMEOUT
)
or (
self.tp_order_hold.get('timestamp')
and int(self.local_time() - self.tp_order_hold['timestamp']) > HOLD_TP_ORDER_TIMEOUT
)
)
):
orders = self.get_buffered_open_orders()
order_buy = len([i for i in orders if i.buy is True])
order_sell = len([i for i in orders if i.buy is False])
Expand Down Expand Up @@ -995,7 +1007,7 @@ def save_strategy_state(self, return_only=False) -> Dict[str, str]:
f"WSS status: {ticker_update}s\n"
f"From start {ct}\n"
f"Delay: {time_diff} sec", tlg=True)
elif self.tp_order_hold['timestamp']:
elif self.tp_order_hold.get('timestamp'):
time_diff = int(self.local_time() - self.tp_order_hold['timestamp'])
if time_diff > HOLD_TP_ORDER_TIMEOUT:
self.message_log(f"Exist hold TP order for"
Expand Down
2 changes: 1 addition & 1 deletion martin_binance/margin_wrapper.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__ = "1.3.2-3"
__version__ = "1.3.3"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dynamic = ["version", "description"]
requires-python = ">=3.8"

dependencies = [
"exchanges-wrapper==1.3.2",
"exchanges-wrapper==1.3.3",
"margin-strategy-sdk==0.0.11",
"aiohttp==3.8.4",
"grpcio==1.48.1",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exchanges-wrapper==1.3.2
exchanges-wrapper==1.3.3
margin-strategy-sdk==0.0.11
aiohttp==3.8.4
grpcio==1.48.1
Expand Down

0 comments on commit aa7f914

Please sign in to comment.