



✅ Basic Information & Restrictions
- Demo Account Only: The bot stops if running on a live account, enforced via
Account.IsLive
.
🔧 Parameters
Money Management
MaxOpenPositions
: Maximum number of simultaneously open positions.LotSizingMode
: Lot calculation mode (Fixed / Balance-based / Peak balance-based).RiskPercentage
: Percentage of account balance to risk per trade.FixedLotSize
: Fixed lot size (when selected).
Trading Strategy
DonchianPeriod
: Period for Donchian Channel.SlMultiplierBuy/Sell
: Stop-loss multiplier based on ATR (Buy/Sell).Tp1MultiplierBuy/Sell
: Initial take-profit multiplier.TrailMultiplierBuy/Sell
: Trailing stop multiplier.
Filters
AtrPeriod
: Period for ATR indicator.EnableAdxFilter
: Enables ADX-based filtering.AdxPeriod
,MaxAdxValue
: ADX settings and threshold.
Cool-Down (Drawdown Management)
EnableCoolDown
: Enables temporary pause after losses.MaxLosses
: Max consecutive losses allowed before pause.CoolDownHours
: Number of hours to pause trading.
🧠 Strategy Logic
OnStart()
- Initializes indicators (Donchian, ATR, ADX).
- Checks for demo account only.
- Registers event handler for position closures.
OnBar()
- On each new bar:
- Skips if cooling down or positions already exist.
- Skips if ADX is above threshold (strong trend).
- Otherwise, calls
HandleEntry()
to evaluate signals.
HandleEntry()
- Fade Breakout Logic:
- If price breaks above the Donchian high then closes below → Sell
- If price breaks below the Donchian low then closes above → Buy
ProcessOrder()
- Calculates SL/TP using ATR.
- Determines lot size via
GetVolume()
. - Executes market order using
ExecuteMarketOrder()
.
ManagePositions()
- If initial TP is hit: closes half the position and moves SL to break-even.
- If no TP is set: applies trailing stop based on ATR multiplier.
GetVolume()
- Calculates volume based on selected lot sizing mode:
- Fixed lot
- Risk % of current balance
- Risk % of peak balance
OnPositionClosed()
- Increments consecutive loss count.
- If losses exceed threshold, initiates cooldown period.
📊 Strategy Summary
- Fade Breakout Style: Reacts to Donchian breakouts by trading reversals.
- Uses ATR to adapt SL/TP and trailing stop to volatility.
- ADX Filter avoids trading in overly strong trends.
- Cool-down mechanism helps protect capital after consecutive losses.
Mais deste autor
Também poderá gostar de
cBot
forex
VegaXLR - Trendline Trading cBot
This is a cBot that will detect trendlines on the chart and open trades when the price interacts with them.
cBot
forex
VegaXLR - Fibonacci Trading cBot
Automate Fibonacci trading with this cTrader cBot—advanced risk management, alerts, and seamless order execution.
cBot
prop
NoWeekendHoldingV2
'No Weekend Holding' makes sure that your trades are closed before the weekend and opens them again after the weekend.