Skip to content

Commit

Permalink
1.3.7.post1
Browse files Browse the repository at this point in the history
  • Loading branch information
DogsTailFarmer committed Sep 30, 2023
1 parent a6cb0b4 commit dfc2aa0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.7.post1 - 2023-09-30
### Fix
* Sonarcloud issues

## 1.3.7 - 2023-09-30
### Update
* Up requirements for exchanges-wrapper==1.3.7.post2
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.7"
__version__ = "1.3.7.post1"
__maintainer__ = "Jerry Fedorenko"
__contact__ = "https://github.com/DogsTailFarmer"

Expand Down
9 changes: 5 additions & 4 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.7"
__version__ = "1.3.7.post1"
__maintainer__ = "Jerry Fedorenko"
__contact__ = 'https://github.com/DogsTailFarmer'
##################################################################
Expand All @@ -19,6 +19,7 @@
# noinspection PyUnresolvedReferences
import traceback # lgtm [py/unused-import]
import contextlib
import math

from martin_binance import Path, STANDALONE, DB_FILE
# noinspection PyUnresolvedReferences
Expand Down Expand Up @@ -507,7 +508,7 @@ def dx(_fn, _x, _delta, **_kwargs):
if err >= 0:
solves.append((err, x))
slope = dx(fn, x, delta, **kwargs)
if slope != 0.0:
if not math.isclose(slope, 0):
x -= err/slope
x = max(_x + delta * tries, x + correction)
else:
Expand Down Expand Up @@ -2972,7 +2973,7 @@ def cancel_grid(self, cancel_all=False):
self.orders_save.orders_list.append(self.orders_grid.get_by_id(_id))
self.message_log(f"cancel_grid order: {_id}", log_level=LogLevel.DEBUG)
self.cancel_order_exp(_id, cancel_all=cancel_all)
elif self.grid_remove:
else:
self.message_log("cancel_grid: Ended", log_level=LogLevel.DEBUG)
self.orders_save.orders_list.clear()
self.orders_hold.orders_list.clear()
Expand Down Expand Up @@ -3344,7 +3345,7 @@ def on_place_order_success(self, place_order_id: int, order: Order) -> None:
if order.amount > order.received_amount > 0:
self.message_log(f"Order {place_order_id} was partially filled", color=Style.B_WHITE)
self.shift_grid_threshold = None
if order.remaining_amount == 0.0:
if math.isclose(order.remaining_amount, 0):
self.shift_grid_threshold = None
# Get actual parameter of last trade order
market_order = self.get_buffered_completed_trades()
Expand Down
7 changes: 4 additions & 3 deletions martin_binance/margin_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
TICKER_PKL = "ticker.pkl"
MS_ORDER_ID = 'ms.order_id'
MS_ORDERS = 'ms.orders'
EQUAL_STR = "================================================================"

session_result = {}

Expand Down Expand Up @@ -1000,10 +1001,10 @@ async def buffered_funds(print_info: bool = True):

cls.funds = funds
if print_info:
print('================================================================')
print(EQUAL_STR)
print(f"Base asset balance: {balance_f}")
print(f"Quote asset balance: {balance_s}")
print('================================================================')
print(EQUAL_STR)
else:
# print(f"buffered_funds.funds: {cls.funds}")
funds = {cls.base_asset: FundsEntry(cls.funds[cls.base_asset]),
Expand Down Expand Up @@ -1771,7 +1772,7 @@ async def main(_symbol):
for i in cancel_orders:
print(f"Order:{i['orderId']}, side:{i['side']},"
f" amount:{i['origQty']}, price:{i['price']}, status:{i['status']}")
print('================================================================')
print(EQUAL_STR)
except asyncio.CancelledError:
pass # Task cancellation should not be logged as an error.
except grpc.RpcError as ex:
Expand Down

0 comments on commit dfc2aa0

Please sign in to comment.