# Grid Executor hits stop loss
grid_config = GridExecutorConfig(
keep_position=True, # Keep accumulated inventory
triple_barrier_config=TripleBarrierConfig(
stop_loss=Decimal("0.05"),
),
)
# After stop loss:
# - Grid executor terminates
# - Net inventory (e.g., 0.5 BTC) stays in account
# - Position added to agent's inventory
# On next tick, agent sees:
# "Held position: Long 0.5 BTC @ $62,500"
# Agent decides to wait for recovery
# Later, spawns Order Executor to exit at better price:
exit_config = OrderExecutorConfig(
side=TradeType.SELL,
amount=Decimal("0.5"),
execution_strategy=ExecutionStrategy.LIMIT,
price=Decimal("64000"), # Better exit
)