Overview
How It Works
- Entry: Places order at
entry_price(or market if not specified) - Monitor: Once filled, continuously monitors price against barriers
- Exit: First barrier hit triggers position close
- Report: Reports P&L and terminates
Configuration
Triple Barrier Config
TheTripleBarrierConfig defines all exit conditions:
Take Profit
Closes position when price moves in your favor by the specified percentage.Stop Loss
Closes position when price moves against you by the specified percentage.Time Limit
Closes position after a maximum duration, regardless of P&L.Trailing Stop
A dynamic stop loss that follows the price as it moves in your favor.- Position enters at $100
- Price rises to $101 (1% profit) → trailing stop activates
- Stop is placed at $100.50 (0.5% below current price)
- Price rises to 102.49
- Price drops to $102.49 → trailing stop triggers, position closes
Parameters
Order Types
You can configure which order type to use for each action:Example: Scalp Trade
Example: Swing Trade with Trailing Stop
Close Types
When the executor terminates, it reports which barrier was hit:Position Handover
Ifkeep_position=true (set via early stop):
- Position remains open in the account
- Added to agent’s Position Hold for later management
keep_position=false (default for barrier exits):
- Position fully closed
- Realized P&L calculated and reported

