Hive Engine Trading Bot - Cycle Control - Part 2
Part 1 - @strangedad/hive-engine-trading-bot-unified
- Checks Hive RC before the bot starts a trading cycle.
- Calls
evaluate_tx_window()to decide if the account can act. - Prints RC percent, mode, allowed status, and wait time.
- Blocks the cycle if RC is too low.
- Uses a 1-hour cooldown when RC fails.
- If
dynamic_delayis enabled, it returns a longer next-cycle delay instead of sleeping. - If no dynamic delay is used, it sleeps for the cooldown.
- If RC is allowed but needs a short wait, it waits up to
max_inline_wait. - Returns
Truewhen the bot can continue. - Returns
Falsewhen the bot should skip the cycle.
bot_cycle_control.py
import time
from rc_intelligence import evaluate_tx_window
RC_FAIL_COOLDOWN_SECONDS = 3600
def run_cycle_preflight(
bot_label,
account_name,
dynamic_delay=None,
action="order",
divider="==============================",
desired_open_orders=None,
current_open_orders=None,
max_inline_wait=30,
):
kwargs = {"account_name": account_name, "action": action}
if desired_open_orders is not None:
kwargs["desired_open_orders"] = desired_open_orders
if current_open_orders is not None:
kwargs["current_open_orders"] = current_open_orders
rc_gate = evaluate_tx_window(**kwargs)
rc_percent = rc_gate.get("rc_percent")
rc_text = "n/a" if rc_percent is None else f"{rc_percent:.2f}%"
print(
f"{bot_label} RC preflight: rc={rc_text} mode={rc_gate.get('mode')} "
f"allow={rc_gate.get('allow')} wait={rc_gate.get('wait_seconds')}s"
)
if not rc_gate.get("allow", True):
wait_seconds = RC_FAIL_COOLDOWN_SECONDS
next_delay = dynamic_delay
if dynamic_delay is not None:
next_delay = max(10, wait_seconds)
print(f"{bot_label} RC preflight blocked cycle before strategy actions.")
if next_delay is not None:
print(f"{bot_label} Next cycle delayed to {next_delay}s based on RC policy.")
else:
print(f"{bot_label} RC preflight cooldown: sleeping {wait_seconds}s before next cycle check.")
time.sleep(wait_seconds)
print(f"{divider}\n")
return False, next_delay
wait_seconds = int(rc_gate.get("wait_seconds", 0) or 0)
if wait_seconds > 0 and wait_seconds <= max_inline_wait:
time.sleep(wait_seconds)
return True, dynamic_delay
π€ PeakeBot β Autonomous Trading System (RC-AWARE)
Independent multi-token trading bot featuring:
RC-aware execution, adaptive delay logic, and self-regulating trade cycles.
π Trading bot details:
π https://geocities.ws/p/e/peakecoin/trading-bot/peakebot_v0_01.html
π» Open-source repositories:
π https://github.com/paulmoon410
π Acknowledgements
For their continued support, guidance, and help expanding the PeakeCoin ecosystem.
Leave Hive Engine Trading Bot - Cycle Control - Part 2 to:
Read more #hive-167922 posts
Best Posts From Peake_Dad
We have not curated any of strangedad's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Peake_Dad
- Stolen Funds
- PeakeCoin Bots: Automated Trading Dashboard
- Peake RPG - MMO - Beta Version
- Peake RPG β Current Project Rundown
- Poor Manβs AI β Building While the Servers Are Down
- Hive Trading Bot - strategy.py - Part 4
- Hive Engine Trading Bot - Part 3 - rc_intelligence.py
- Hive Engine Trading Bot - Cycle Control - Part 2
- Hive Engine Trading Bot - Unified Logic - Part 1
- Arbiter Bot - Part 4 - place_order.py
- Arbiter Bot - Part 3 - fetch_market.py
- Arbiter Bot Part 2 - Cancel Logic
- Arbiter Bot - For All Hive Engine Tokens
- Turning Old Cell Phones Into CPU Miners
- Electrical Masters Exam... Passed.
- PeakeCoinBot.exe - Update
- Hive / Cronos - Hive Engine to CRO
- FPS - main.py - python
- PekAblo - Move Mechanics Problems
- Pekario - Now Mobile Friendly