Skip to content

Commit dd38035

Browse files
3.0.21
1 parent 55758a8 commit dd38035

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 3.0.21 - 2025-02-07
2+
### Update
3+
* Some minor improvements
4+
15
## 3.0.20 - 2025-02-06
26
### Update
37
* `Bybit`: checking for the minimum/maximum Buy/Sell orders price is [excluded](https://announcements.bybit.com/article/title-adjustments-to-bybit-s-spot-trading-limit-order-mechanism-blt786c0c5abf865983/)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<p align="center"><img src="https://github.com/DogsTailFarmer/martin-binance/raw/public/doc/Modified%20martingale.svg" width="200"></p>
1+
<p align="center"><img src="https://raw.githubusercontent.com/DogsTailFarmer/martin-binance/55758a8d32b08c4deb1b34add01c5e259b88f738/doc/Modified%20martingale.svg" width="200"></p>
22
<h3 align="center">Profitable, fault-tolerant, adaptable to the market</h3>
33

44
***

martin_binance/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
__author__ = "Jerry Fedorenko"
77
__copyright__ = "Copyright © 2021 Jerry Fedorenko aka VM"
88
__license__ = "MIT"
9-
__version__ = "3.0.20"
9+
__version__ = "3.0.21"
1010
__maintainer__ = "Jerry Fedorenko"
1111
__contact__ = "https://github.com/DogsTailFarmer"
1212

@@ -52,6 +52,7 @@ def init():
5252
"cli_2_TESTBTCTESTUSDT.py",
5353
"cli_3_BTCUSDT.py"
5454
]
55+
# skipcq: PYL-W0106
5556
[copy(Path(templates, file_name), Path(WORK_PATH, file_name)) for file_name in files_to_copy]
5657

5758
print(f"Before the first run, set the parameters in {CONFIG_FILE}")

martin_binance/executor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ def start(self, profit_f: Decimal = O_DEC, profit_s: Decimal = O_DEC) -> None:
794794
self.over_price = OVER_PRICE
795795
self.order_q = ORDER_Q
796796
self.grid_update_started = None
797+
self.place_grid_part_after_tp = True
797798
#
798799
start_cycle_output = not self.start_after_shift or self.first_run
799800
if self.cycle_buy:

martin_binance/service/funds_rate_exporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
VPS_MEMORY = Gauge("margin_vps_memory", "average memory use in %", ['vps_name'])
100100

101101
SET_ACTIVE = Gauge("margin_set_active", "mark rows as loaded and reset some metrics", ['vps_name'])
102-
SET_ACTIVE.labels(VPS_NAME).set_function(lambda: set_active())
102+
SET_ACTIVE.labels(VPS_NAME).set_function(lambda: set_active()) # skipcq: PYL-W0108
103103

104104
''' Cycle parameters for future use
105105
PRICE_SHIFT = Gauge("margin_price_shift", "price shift", ['exchange', 'pair'])

martin_binance/strategy_base.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,8 +1524,7 @@ def wss_cancel_tasks(self):
15241524

15251525
async def tlg_get_command(self):
15261526
while True:
1527-
res = await self.tlg_client.get_update()
1528-
command = json.loads(res.data) if res else None
1527+
command = await self.tlg_client.get_update()
15291528
if command:
15301529
self.command = command
15311530
await asyncio.sleep(TLG_DELAY)

martin_binance/telegram_proxy/tlg_client.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
__author__ = "Jerry Fedorenko"
2020
__copyright__ = "Copyright © 2025 Jerry Fedorenko aka VM"
2121
__license__ = "MIT"
22-
__version__ = "3.0.20"
22+
__version__ = "3.0.21"
2323
__maintainer__ = "Jerry Fedorenko"
2424
__contact__ = "https://github.com/DogsTailFarmer"
2525

2626
import ssl
2727
from pathlib import Path
2828
import asyncio
29-
29+
from typing import Any
30+
import ujson as json
3031
import toml
3132
import random
3233
import logging.handlers
@@ -89,7 +90,7 @@ def tasks_manage(self, coro, name=None, add_done_callback=True):
8990
_t.add_done_callback(self.tasks.discard)
9091

9192
def task_cancel(self):
92-
[task.cancel() for task in self.tasks if not task.done()]
93+
[task.cancel() for task in self.tasks if not task.done()] # skipcq: PYL-W0106
9394

9495
async def connect(self):
9596
self.init_event.clear()
@@ -111,7 +112,7 @@ async def connect(self):
111112
logger.error(f"Connect to Telegram proxy failed: {e}")
112113
break
113114

114-
async def post_message(self, text, inline_buttons=False, reraise=False) -> tlg.Response:
115+
async def post_message(self, text, inline_buttons=False, reraise=False):
115116
try:
116117
res = await self.stub.post_message(
117118
tlg.Request(
@@ -133,14 +134,14 @@ async def post_message(self, text, inline_buttons=False, reraise=False) -> tlg.R
133134
except (asyncio.CancelledError, KeyboardInterrupt):
134135
pass # user interrupt
135136

136-
async def get_update(self) -> tlg.Response:
137+
async def get_update(self) -> Any | None:
137138
try:
138139
res = await self.stub.get_update(
139140
tlg.Request(
140141
bot_id=self.bot_id,
141142
)
142143
)
143-
return res
144+
return json.loads(res.data) if res else None
144145
except (ConnectionRefusedError, exceptions.StreamTerminatedError):
145146
if self.init_event.is_set():
146147
self.tasks_manage(self.connect())

0 commit comments

Comments
 (0)