Allow exchange-minimum Kelly layers
This commit is contained in:
@@ -140,7 +140,7 @@ class CryptoSpotBot:
|
||||
symbol,
|
||||
"HOLD",
|
||||
0.0,
|
||||
"пауза после закрытия позиции",
|
||||
"пауза между входами по паре",
|
||||
{"cooldown_remaining_seconds": cooldown_seconds - age},
|
||||
)
|
||||
)
|
||||
@@ -150,6 +150,7 @@ class CryptoSpotBot:
|
||||
candles = self.market.candles.get(symbol, [])
|
||||
trend_candles = self.market.trend_candles.get(symbol, [])
|
||||
open_count = len(self.broker.positions_for_symbol(symbol))
|
||||
instrument = self.market.instruments.get(symbol)
|
||||
pattern = self.market.patterns.get(symbol, {})
|
||||
forecast = self.market.forecasts.get(symbol, {})
|
||||
learning = self.learner.adjustment_for(symbol, str(pattern.get("label", ""))).as_dict()
|
||||
@@ -159,6 +160,7 @@ class CryptoSpotBot:
|
||||
account["symbol"] = symbol
|
||||
account["symbol_exposure_usdt"] = self.broker.symbol_exposure(symbol)
|
||||
account["open_positions_for_symbol"] = open_count
|
||||
account["exchange_min_entry_usdt"] = self.broker.minimum_entry_budget(instrument, ticker)
|
||||
if risk_guard.get("block_new_entries"):
|
||||
self.storage.insert_signal(
|
||||
Signal(
|
||||
@@ -224,12 +226,14 @@ class CryptoSpotBot:
|
||||
)
|
||||
self.storage.insert_signal(signal)
|
||||
if signal.action == "BUY" and ticker is not None:
|
||||
self.broker.buy(
|
||||
position = self.broker.buy(
|
||||
signal,
|
||||
ticker,
|
||||
self.market.instruments.get(symbol),
|
||||
instrument,
|
||||
prices,
|
||||
)
|
||||
if position is not None:
|
||||
self._entry_cooldown_until[symbol] = utc_now()
|
||||
|
||||
@staticmethod
|
||||
def _risk_guard_for_symbol(risk_guard: dict, symbol: str) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user