Add MIN_DELAY_BETWEEN_TRADES_SECONDS to config and main logic for trade pacing

This commit is contained in:
Nawaz Haider
2026-01-12 16:15:16 +06:00
parent b4c3eb90c9
commit 351a76a308
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -11,4 +11,5 @@ MAX_TRADING_BPS_THRESHOLD = 30
MARKET_SESSION_SECONDS = 900 MARKET_SESSION_SECONDS = 900
TIMEZONE = "US/Eastern" TIMEZONE = "US/Eastern"
MAX_TRADES = 1 MAX_TRADES = 1
MIN_DELAY_BETWEEN_TRADES_SECONDS = 10
PLACE_OPPOSITE_ORDER = True # Hedge orders PLACE_OPPOSITE_ORDER = True # Hedge orders
+7 -1
View File
@@ -13,7 +13,11 @@ from utils.clob_orders import (
cache_token_trading_infos, cache_token_trading_infos,
) )
from utils.cpu_affinity import set_cpu_affinity from utils.cpu_affinity import set_cpu_affinity
from config import MAX_TRADES, MAX_TRADING_BPS_THRESHOLD from config import (
MAX_TRADES,
MAX_TRADING_BPS_THRESHOLD,
MIN_DELAY_BETWEEN_TRADES_SECONDS,
)
gc.disable() gc.disable()
@@ -102,6 +106,7 @@ async def main():
logger.info( logger.info(
f"Placed UP anchor and hedge orders. Total trades: {current_trades}" f"Placed UP anchor and hedge orders. Total trades: {current_trades}"
) )
await asyncio.sleep(MIN_DELAY_BETWEEN_TRADES_SECONDS)
elif (trading_side == SIGNALES.DOWN) and up_trend: elif (trading_side == SIGNALES.DOWN) and up_trend:
await place_anchor_and_hedge( await place_anchor_and_hedge(
@@ -116,6 +121,7 @@ async def main():
logger.info( logger.info(
f"Placed DOWN anchor and hedge orders. Total trades: {current_trades}" f"Placed DOWN anchor and hedge orders. Total trades: {current_trades}"
) )
await asyncio.sleep(MIN_DELAY_BETWEEN_TRADES_SECONDS)
await asyncio.sleep(0.01) await asyncio.sleep(0.01)