Skip to content

Commit

Permalink
2.1.0rc25
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Feb 2, 2024
1 parent b9b9fb2 commit 6dcf4dc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.0rc25 - 2024-02-02
### Update
* Up requirements for exchanges-wrapper==1.4.8

## 2.1.0rc20 - 2024-01-27
### Fix
* An order that was `PARTIALLY FILLED` at the time of creation was counted as `FILLED`
Expand All @@ -9,6 +13,7 @@
* executor: remove parameters `SAVE_TRADE_HISTORY` and `SAVED_STATE`, already use for saving/restore trade events
* comprehensive improvement of the internal accounting and recovery system
* Up requirements for exchanges-wrapper==1.4.7
* Dependency: Up requirements for Python>=3.9

### Added for new features
* Per 10 mins update trade rules for pair
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.0rc21"
__version__ = "2.1.0rc25"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down
14 changes: 5 additions & 9 deletions 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__ = "2.1.0rc20"
__version__ = "2.1.0rc24"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down Expand Up @@ -1234,7 +1234,7 @@ async def buffered_orders():
f" checking it", log_level=LogLevel.WARNING, tlg=False)
for _id in diff_id:
res = await fetch_order(_id, _filled_update_call=True)
if res.get('status') == 'CANCELED':
if res.get('status') in ('CANCELED', 'EXPIRED_IN_MATCH'):
await cancel_order_handler(_id, cancel_all=False)

if cls.last_state:
Expand Down Expand Up @@ -1370,7 +1370,7 @@ async def on_order_update_handler(cls, ed):
ed['order_price'] = str(so.price)
ed['quote_order_quantity'] = str(so.amount * so.price)

if trade_not_exist(ed['order_id'], ed['trade_id']):
if order_trades_sum(ed['order_id']) < Decimal(ed['order_quantity']):
_on_order_update_handler_ext(ed, cls)
await save_trade_queue.put(
["TRADE" if ed['is_maker_side'] else "TRADE_BY_MARKET",
Expand Down Expand Up @@ -1429,17 +1429,13 @@ def _on_order_update_handler_ext(ed, cls):
# noinspection PyStatementEffect
cls.trades[-TRADES_LIST_LIMIT:]

cumulative_quantity = Decimal(ed['cumulative_filled_quantity'])
saved_filled_quantity = order_trades_sum(ed['order_id'])

if ((ed['order_status'] == 'FILLED' and saved_filled_quantity > Decimal(ed['order_quantity']))
or saved_filled_quantity != cumulative_quantity):
if ed['order_status'] == 'FILLED' and order_trades_sum(ed['order_id']) < Decimal(ed['order_quantity']):
cls.strategy.message_log(f"Order: {ed['order_id']} was incorrect partially filling event",
log_level=LogLevel.INFO)
# Remove trades associated with order from list
remove_from_trades_lists(ed['order_id'])
# Update current trade
price = str(Decimal(ed['quote_asset_transacted']) / cumulative_quantity)
price = str(Decimal(ed['quote_asset_transacted']) / Decimal(ed['cumulative_filled_quantity']))
trade |= {
"id": -1,
"qty": ed['cumulative_filled_quantity'],
Expand Down
4 changes: 2 additions & 2 deletions martin_binance/service/tmux.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ After=syslog.target
After=network.target

[Service]
Type=forking
Type=simple
User=ubuntu
Environment=DISPLAY=:0
ExecStart=/usr/bin/tmux new-session -d

ExecStop=/bin/bash home/ubuntu/.tmux/plugins/tmux-resurrect/scripts/save.sh
ExecStop=/usr/bin/tmux kill-server
KillMode=none
KillMode=mixed

RestartSec=2

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.9"

dependencies = [
"exchanges-wrapper==1.4.7",
"exchanges-wrapper==1.4.8",
"margin-strategy-sdk==0.0.11",
"jsonpickle==3.0.2",
"psutil==5.9.6",
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.4.7
exchanges-wrapper==1.4.8
margin-strategy-sdk==0.0.11
jsonpickle==3.0.2
psutil==5.9.6
Expand Down

0 comments on commit 6dcf4dc

Please sign in to comment.