pybinbot 2.1.13__tar.gz → 2.1.14__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pybinbot-2.1.13/pybinbot.egg-info → pybinbot-2.1.14}/PKG-INFO +1 -1
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/bot_base.py +9 -3
- {pybinbot-2.1.13 → pybinbot-2.1.14/pybinbot.egg-info}/PKG-INFO +1 -1
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pyproject.toml +1 -1
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_conditional_entry.py +4 -2
- {pybinbot-2.1.13 → pybinbot-2.1.14}/LICENSE +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/MANIFEST.in +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/README.md +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/__init__.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binance/base.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binance/exceptions.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binbot/base.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/binbot/exceptions.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/coingecko.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/base.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/exceptions.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/futures.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/market.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/orders.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/apis/kucoin/rest.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/__init__.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/autotrade_settings.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/bot.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/cvd.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/deal.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/derivatives.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/fastest_movers.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/grid_ladder.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/order.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/routes.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/signals.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/models/symbol.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/py.typed +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/__init__.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/beta.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/breadth.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/cache.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/candles.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/enums.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/handlers.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/heikin_ashi.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/indicators.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/logging_config.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/maths.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/price_crossings.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/telegram_delivery.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/timestamps.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/types.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/shared/utils.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/beta.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/breadth.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/price_crossings.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/strategy/swing_protection.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/async_socket_client.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/socket_client.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/binance/socket_manager.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot/streaming/kucoin/kucoin_async_client.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/SOURCES.txt +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/dependency_links.txt +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/requires.txt +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/pybinbot.egg-info/top_level.txt +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/setup.cfg +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_beta.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_binbot_api.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_bot_futures_leverage.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_breadth.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_candles.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_closed_bot_status.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_coingecko.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_conditional_futures_orders.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_cvd_api.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_deal_model.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_derivatives_api.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_fastest_movers.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_futures_place_order.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_grid_ladder.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_handlers.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_heikin_ashi.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_indicators.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_kucoin_api.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_logging_config.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_matching_engine.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_maths.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_price_crossings.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_swing_protection.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_symbol_model.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_telegram_delivery.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_timestamps.py +0 -0
- {pybinbot-2.1.13 → pybinbot-2.1.14}/tests/test_utils.py +0 -0
|
@@ -15,6 +15,8 @@ from pybinbot.shared.enums import (
|
|
|
15
15
|
from pybinbot.shared.timestamps import timestamp, ts_to_humandate
|
|
16
16
|
from pybinbot.shared.types import Amount
|
|
17
17
|
|
|
18
|
+
DEFAULT_ENTRY_EXPIRY_MS = 15 * 60 * 1000
|
|
19
|
+
|
|
18
20
|
|
|
19
21
|
class RecoveryParams(BaseModel):
|
|
20
22
|
reversal_path: Literal["source", "recovery"] = "source"
|
|
@@ -50,10 +52,10 @@ class BotBase(BaseModel):
|
|
|
50
52
|
entry_mode: EntryMode = Field(default=EntryMode.immediate, validate_default=True)
|
|
51
53
|
entry_price: float | None = Field(default=None, ge=0, allow_inf_nan=False)
|
|
52
54
|
entry_expires_at: float = Field(
|
|
53
|
-
default_factory=lambda data: data["created_at"] +
|
|
55
|
+
default_factory=lambda data: data["created_at"] + DEFAULT_ENTRY_EXPIRY_MS,
|
|
54
56
|
gt=0,
|
|
55
57
|
allow_inf_nan=False,
|
|
56
|
-
description="Absolute entry deadline in Unix milliseconds; defaults to creation +
|
|
58
|
+
description="Absolute entry deadline in Unix milliseconds; defaults to creation + 15 minutes",
|
|
57
59
|
)
|
|
58
60
|
dynamic_trailing: bool = Field(default=False)
|
|
59
61
|
dynamic_position_sizing: bool = Field(default=False)
|
|
@@ -121,7 +123,11 @@ class BotBase(BaseModel):
|
|
|
121
123
|
@field_validator("entry_expires_at", mode="before")
|
|
122
124
|
@classmethod
|
|
123
125
|
def default_entry_expiry(cls, value, info: ValidationInfo):
|
|
124
|
-
return
|
|
126
|
+
return (
|
|
127
|
+
info.data["created_at"] + DEFAULT_ENTRY_EXPIRY_MS
|
|
128
|
+
if value is None
|
|
129
|
+
else value
|
|
130
|
+
)
|
|
125
131
|
|
|
126
132
|
@model_validator(mode="after")
|
|
127
133
|
def validate_conditional_entry(self):
|
|
@@ -8,10 +8,12 @@ from pybinbot import BotBase, EntryMode, MarketType
|
|
|
8
8
|
"overrides",
|
|
9
9
|
[{}, {"entry_mode": None, "entry_expires_at": None, "entry_price": None}],
|
|
10
10
|
)
|
|
11
|
-
def
|
|
11
|
+
def test_omitted_or_null_entry_fields_default_to_immediate_and_fifteen_minutes(
|
|
12
|
+
overrides,
|
|
13
|
+
):
|
|
12
14
|
bot = BotBase(pair="XBTUSDTM", created_at=1000, **overrides)
|
|
13
15
|
assert bot.entry_mode == EntryMode.immediate
|
|
14
|
-
assert bot.entry_expires_at ==
|
|
16
|
+
assert bot.entry_expires_at == 901_000
|
|
15
17
|
assert bot.entry_price is None
|
|
16
18
|
assert bot.model_dump(mode="json")["entry_price"] is None
|
|
17
19
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|