Description
Trend Is Your Friend cBot β Advanced Multi-Strategy Trading Robot for cTrader
A professional-grade trading algorithm that combines Grid, Pyramid,
Scalping, and Swing Trading into one configurable system.
For beginners, scalpers, swing traders, and professionals.
The companion chart tool, "Trend is your friend cBot - Indicator" (MA bands, other-timeframe bands, daily pivots), is available for free on the cGuru cTrader Store profile. Video tutorials and showcases:
Manual Mode β Control Panel
AUDCAD β H4 β Backtest from 01.01.2023 to 01.02.2026
XAUUSD β M5 β Backtest from 01.01.2025 to 01.02.2026
Free visual helper available on my cTrader Store profile:
"Trend is your friend cBot β Indicator"
https://ctrader.com/products/3283
Trend is your friend is a multi-strategy trading robot for cTrader. It combines nine entry engines with grid averaging, pyramiding and basket-level take profit and stop-loss management in a single tool. You can let it trade automatically, run it as a semi-automatic assistant that only manages what you open from its panel, or mix both β automatic entries on one direction and manual control on the other.
Every building block is optional and independently configurable: which signal opens the first position, how many averaging positions may follow it, how their volume grows, where profits and losses are realised, and during which hours the robot is allowed to enter. All of this is configured through 84 parameters grouped into nine sections β a full reference follows the overview.
HOW THE BOT TRADES
Entries. The selected Mode decides what triggers the first position: a touch of a moving average, an MA cross, a daily pivot level, an RSI, MACD or Stochastic condition, a series of same-colour candles, a fixed time of day, or a manual click on the panel. Direction settings decide whether the robot trades long, short, one side at a time, both sides at once, or simply the side whose condition fired. Optional trend filters (own-timeframe MA alignment and a second-timeframe MA filter) and volatility/distance filters (MA channel width, ATR range, trading window) can block weak entries.
Grid averaging. When price moves against the initial position, the grid adds averaging positions: below the last fill for longs, above it for shorts. The distance starts at Grid level pips and can widen geometrically with each level. A same-candle restriction prevents stacking several grid orders on one fast candle, and per-direction caps (0 disables a side) limit the worst case.
Pyramiding. The pyramid does the opposite: it adds in the direction of the profit while the initial position is in profit. STANDARD mode adds after every fixed favourable distance; RE_ENTRY adds on a fresh entry signal of the same kind that started the trade, with a minimum number of bars between additions.
Exits. Profit and loss are managed on the whole basket, not per position: a monetary target, a "share of positions in profit" rule, a combination of both, or fixed price levels per direction. On the loss side you get a static monetary basket stop, an optional MA-based trailing stop that only ever tightens, an MA-cross exit, and fixed loss price levels per direction. After any basket close the robot can pause before re-entering.
Sizing. The first order uses a fixed lot or a size derived from the account balance. Grid and pyramid positions each have their own sizing scheme: same as the first order, step increases, martingale multiplication, or a fixed lot. Every calculated size is clamped to the broker's minimum and maximum and rounded down to the broker's volume step.
PARAMETER REFERENCE
[General]
β’ Label prefix β text tag written into the label of every position and order this cBot opens ("Initial", "Grid", "Pyramid", "Manual"). The cBot uses it to recognise and manage only its own trades, so different instances or manual trades stay separate.
[Run mode & direction]
β’ Mode β the entry engine: MA (price touches the selected moving average within the allowed distance), MA_CROSS (fast/slow MA cross), PIVOT (daily pivot support/resistance levels), RSI (oversold/overbought), MACD (MACD/signal line cross), STOCHASTIC (oscillator levels), SAME_CANDLE_SERIE (N consecutive same-colour candles), TIME (fixed hour and minute), MANUAL (no automatic entries; open trades from the panel β the bot still manages them).
β’ Direction β LONG (buys only), SHORT (sells only), LONG_OR_SHORT (long or short, never both at once), BOTH_AT_ONCE (independent long and short baskets), TRIGGER_SIDE (the robot opens the side whose signal condition was met).
β’ Only MA direction β trend gate for entries: longs only when the fast MA is above the slow MA, shorts only when it is below.
β’ Other TF MA direction β the same trend check on a second timeframe (with OFF option); entries require both timeframes to agree.
[Take profit]
β’ TP type β what closes a basket in profit: USD (monetary target), PERCENT (a required share of positions in profit), USD_OR_PERCENT (monetary target first, percentage rule later β see below).
β’ TP scope β PER_DIRECTION (long and short baskets evaluated and closed separately) or GLOBAL (all positions treated as one basket).
β’ TP $ β basket profit in account currency that triggers closing (despite the name, the account currency is used, not necessarily USD).
β’ TP % of grids in profit β the percentage of open basket positions that must have positive net profit for the basket to be closed (PERCENT mode).
β’ Min number of grid orders to close by % β how many grid/pyramid positions must exist before the percentage rule takes over in USD_OR_PERCENT mode.
β’ Disable $ TP when min grid orders opened β once that minimum is reached, the monetary target is switched off and only the percentage rule closes the basket.
β’ Long price level global TP (0 - disable) β a fixed price at which all long positions are closed in profit; 0 disables.
β’ Short price level global TP (0 - disable) β a fixed price at which all short positions are closed in profit; 0 disables.
[Grid]
β’ Grid level pips β base distance in pips between averaging entries.
β’ Grid level martingale multiplier β widens each next step: distance = base Γ multiplier ^ level. 1.0 keeps equal spacing; 2.0 doubles it every level.
β’ No grid on same candle β allows at most one grid position per candle, which prevents dense stacking during fast moves.
β’ Grid orders short (0 - disable) β maximum short grid positions; 0 disables the short grid entirely.
β’ Grid orders long (0 - disable) β maximum long grid positions; 0 disables the long grid entirely.
[Pyramid]
β’ Pyramid mode run β STANDARD (adds a position every time the price has moved Pyramid level pips in the trade's favour) or RE_ENTRY (adds on a new signal of the same type as the original entry).
β’ Re-entry min bars β minimum number of candles between pyramid re-entries (RE_ENTRY mode).
β’ Pyramid level pips β the favourable distance in pips that triggers the next pyramid addition (STANDARD mode).
β’ Pyramid orders short (0 - disable) β maximum short pyramid positions; 0 disables.
β’ Pyramid orders long (0 - disable) β maximum long pyramid positions; 0 disables.
[Protection]
β’ SL mode β OFF (no basket stop), STATIC (close the basket at a fixed monetary loss) or STATIC_AND_TRAILING (static stop plus an MA-based trailing stop).
β’ Static SL scope β PER_DIRECTION (long and short baskets stopped separately) or GLOBAL (one combined loss limit).
β’ Static SL $ β basket loss in account currency that closes the basket (account currency, not necessarily USD).
β’ Trailing SL trigger pips β how far price must travel away from the reference MA (in pips) before the trailing stop activates.
β’ Trailing SL pips β offset of the trailing level from the reference MA; negative values place the stop closer to price. Once set, the level only moves in the favourable direction β it never loosens.
β’ Trailing SL trigger wave β FAST or SLOW moving average used as the trailing reference.
β’ MA SL β OFF, FAST or SLOW: closes all positions of a direction when price crosses the chosen moving average.
β’ Pause on close minutes (0 - disable) β a cooldown in minutes after a basket close (TP/SL/trailing) during which no new entries are opened; prevents instant re-entry into the same move.
β’ Long price level global SL (0 - disable) β a fixed price at which all long positions are closed at a loss; 0 disables.
β’ Short price level global SL (0 - disable) β a fixed price at which all short positions are closed at a loss; 0 disables.
[Volume]
β’ First order fix lot β the initial position size in lots when balance-based sizing is off.
β’ Keep first order vol to balance ratio β instead of the fixed value, the initial size is derived from the account balance, the pip value and the grid spacing, so the first order scales with the account (clamped to broker limits).
β’ Grid volume type β how grid position sizes evolve: SAME_AS_ORDER (always as the first order), STEP (grow by a fixed amount per level), MARTINGALE (multiply per level), FIX_LOT (one fixed size for all grid positions).
β’ Grid step volume β lots added per grid level in STEP mode.
β’ Grid martingale multiplier β size multiplier per grid level in MARTINGALE mode (2.0 doubles each level).
β’ Grid fix lot β fixed lot size for all grid positions in FIX_LOT mode.
β’ Pyramid volume type β the same four schemes for pyramid positions.
β’ Pyramid step volume β lots added per pyramid level in STEP mode.
β’ Pyramid martingale multiplier β size multiplier per pyramid level in MARTINGALE mode.
β’ Pyramid fix lot β fixed lot size for all pyramid positions in FIX_LOT mode.
[Settings]
β’ Control panel β shows or hides the on-chart control panel (see CHART PANEL below).
β’ BE line β draws the break-even line: the volume-weighted average entry price of the current basket, drawn separately for long and short.
β’ TSL line β draws the current trailing-stop level on the chart (STATIC_AND_TRAILING mode only).
β’ MA modes channel interaction β which moving average (FAST or SLOW) drives MA-mode entries. The MA is computed on High prices for the long side and Low prices for the short side, forming a channel around price.
β’ MA fast period β period of the fast moving average.
β’ MA slow period β period of the slow moving average.
β’ MA fast type β smoothing type of the fast MA (Simple, Exponential, Weighted, Wilder and other cTrader types).
β’ MA slow type β smoothing type of the slow MA.
β’ Distance from MA pips β how far price may be from the selected MA for a touch entry to still count. 0 means "exactly at the MA" (with 1 pip of tolerance); larger values accept entries further away.
β’ Pivot start L β which daily pivot level starts the long grid: PP, S1, S2 or S3.
β’ Pivot start S β which daily pivot level starts the short grid: PP, R1, R2 or R3.
β’ RSI periods β RSI calculation period.
β’ RSI buy level β RSI below this value opens longs (standard 30).
β’ RSI sell level β RSI above this value opens shorts (standard 70).
β’ MACD fast period β fast MACD line period.
β’ MACD slow period β slow MACD line period.
β’ MACD smoothing β signal line smoothing period.
β’ Stochastic %K periods β %K line calculation period.
β’ Stochastic %K slowing β %K line smoothing.
β’ Stochastic %D periods β %D signal line period.
β’ Stochastic buy level β Stochastic below this value opens longs (standard 20).
β’ Stochastic sell level β Stochastic above this value opens shorts (standard 80).
β’ SAME CANDLE SERIE mode length β how many consecutive same-colour candles are required for the entry (bullish series for long, bearish for short).
β’ TIME mode hour β the hour of the timed entry in TIME mode.
β’ TIME mode minute β the minute of the timed entry in TIME mode.
β’ MA timeframe β calculation timeframe for both moving averages (Current or any higher timeframe).
β’ RSI timeframe β calculation timeframe for RSI.
β’ MACD timeframe β calculation timeframe for MACD.
β’ STOCHASTIC timeframe β calculation timeframe for Stochastic.
β’ Min MA waves distance pips filter β blocks entries while the fastβslow MA distance (channel width) is below this many pips; filters out flat, choppy markets.
β’ Max MA waves distance pips filter β blocks entries while the channel is wider than this; filters markets where the trend has already stretched too far.
β’ Min ATR filter β blocks entries when current ATR volatility is below this value.
β’ Max ATR filter β blocks entries when ATR is above this value.
[Timer]
β’ Open trades in certain hour β enables a daily trading window; outside it no new entries are opened (existing positions are still managed).
β’ From hour β window start hour.
β’ From minute β window start minute.
β’ To hour β window end hour.
β’ To minute β window end minute.
β’ Timezone difference hours β offset between broker server time and your local time, applied so the window matches your clock.
β’ Close all after end β closes all cBot positions when the window ends.
β’ Wait for BE after end β instead of closing immediately at the window end, waits until the basket reaches break-even, then closes.
CHART PANEL
The panel shows live account data: balance, equity, unrealized net profit, the number of opened long and short positions, and how many of each are in profit. Trading controls:
β’ Buy Mkt / Sell Mkt β manual market entries with the panel lot size; such positions are labelled like bot trades and are managed by the bot.
β’ Buy Limit / Buy Stop / Sell Limit / Sell Stop β manual pending orders with a typed lot size.
β’ Buy & Sell Mkt (blue button) β despite the label, this is a panic close: it closes ALL positions opened by this cBot on the symbol.
β’ Close L/S in profit / Close L/S in loss β selective closing of profitable or losing positions per direction.
β’ Close pending L/S β cancels pending orders per direction.
β’ Hide/Show β collapses or expands the panel.
CHART LINES
With positions open, the bot can draw the break-even line (BE line), the trailing-stop line (TSL line) and the configured global price-level TP/SL lines. These are computed management levels, not broker orders β treat them as visualisation, not as guaranteed execution prices.
UNDERSTANDING TAKE PROFIT
Monetary thresholds ("TP $", "Static SL $") are compared against the summed net profit of the basket and use the account currency, despite the USD/$ labels. PERCENT mode counts how many basket positions currently have positive net profit and closes the basket when the required share is reached β this is a relative condition, not an account-return target, and a basket closed by it can still be at an overall loss. A single-position basket always uses the monetary target. USD_OR_PERCENT applies the monetary target until the "minimum grid orders" condition (with its disabling switch enabled) is met, then the percentage rule takes over.
EXECUTION & RECOVERY
Trading logic runs on every tick: existing positions are managed first (basket TP/SL, price levels, session end, trailing), then new entries are evaluated per the selected mode; trend caches refresh on each new bar and the position list is periodically re-synchronised with the platform. After a terminal or connection restart the bot recovers its open positions by label. All stop/TP logic is executed by the running cBot β no protective orders are attached broker-side, so the terminal must stay running and connected for exits to happen. Gaps, slippage and rejected closes can result in exits away from the intended level.
IMPORTANT RISK NOTES
Grid averaging increases exposure as price moves against you, and martingale volume schemes multiply that effect β drawdown can grow quickly and margin can run out. The default SL mode is OFF. These defaults are a configuration choice, not a safety feature: choose limits deliberately. Backtest your settings and run them on a demo account before trading real funds. Past or simulated results never guarantee future performance.
PUBLISHER
cGuru: https://ctrader.com/profile/cGuru
For informational and educational purposes only. Not investment advice or a guarantee of trading results.
Summary
Key features include nine entry modes based on technical indicators and price action: Moving Average (MA), MA Cross, Pivot levels, RSI, MACD, Stochastic, consecutive same-direction candles, time-based entries, and manual control. Direction modes allow trading long, short, both simultaneously, or triggered sides.
Grid logic averages losing positions by opening additional orders at configurable distances, while Pyramid logic adds to winning positions either at fixed profit intervals or on new signals. Protection mechanisms include static and trailing stops, MA-based stops, price-level stops, and pause timers.
Volume models support fixed lots, martingale, step increases, or matching order size. Filters include ATR volatility, MA distance, multi-timeframe confirmation, trading hours, and trend direction locks. Visual aids display break-even, trailing stop loss, global take profit/stop loss lines, and profit/loss labels.
Backtests cover multiple instruments and timeframes, with recommended minimum balance and risk parameters provided. The bot supports various order types and risk models, making it adaptable for different trading styles and risk management preferences.
