VegaXLR - cTrader Trendline Trading cBot
This cTrader cBot detects trendlines and opens trades when price interacts with them. It offers customizable risk management, advanced stop loss/take profit options, and proximity zone detection.
Introduction
The VegaXLR - Trendline Trading cBot is a fully customizable tool designed to detect trendlines on your chart and open positions when the price interacts with them. With flexible risk management options, advanced stop loss and take profit features, and proximity zone detection for both trendlines and horizontal lines, this cBot can significantly enhance your trading strategy.
Core Features
Detects manually drawn trendlines and opens trades based on user-defined conditions.
Multiple risk calculation methods: Fixed Lots, Money Risk, and Balance Percentage.
Customizable stop loss and take profit methods, including fixed pips, average bar sizes, and proximity to horizontal lines.
Proximity zones to avoid trades with take profits or stop losses that are too close to critical levels.
Settings & Parameters
Risk Management
Risk Type
Defines how the cBot calculates risk for trades.Fixed Lots: Trades with a fixed lot size.
Money Risk: Calculates lot size based on a specified monetary risk.
Balance Percentage: Trades risk a percentage of your account balance.
Set risk in trendline comments: Use "$Number" for money risk or "%Number" for balance percentage.
Rounding Mode
Determines how the cBot rounds the calculated lot size.To nearest, Up, or Down based on your preference.
Fixed Lots
Used when Fixed Lots is selected as the risk type. Specify the lot size for all trades.Money Risk
Default risk value (in account currency) used if you forget to specify it in the trendline comments. Example:$50
for $50 risk.Balance Risk (%)
Default percentage of account balance used if you forget to set it in the trendline comments (e.g.,%2.5
for 2.5% risk).
To set the risk on a trendline, follow these steps:
Select the Risk Type in the cBot parameters:
Choose one of the risk types: Money Risk, or Balance Percentage in the cBot parameters. This determines how the cBot will calculate the risk. If you choose Fixed Lots, the cBot will use the value in the Fixed Lots parameter and will not look for a risk in the trendline commentary.
Add a comment to the trendline:
For Money Risk: Write "$" followed by the risk amount in the comment. For example, enter "$25" to risk 25 units of your account's currency (e.g., 25 USD, EUR, etc.). Even if you use "$" in the comment, the cBot will calculate the risk in your account's base currency. So if your account is in euros and you set "$25," the cBot will risk 25 euros.
For Balance Percentage: Write "%" followed by the percentage of your account balance to risk. For example, enter "%2.5" to risk 2.5% of your balance. The cBot will calculate the lot size accordingly.
If no risk is set in the comment, the cBot will use the default risk values from the parameters.
Trendlines & Trade Initiation
Trade Start Mode
Sets how trades are triggered by the trendline interaction.Touch: Trade opens when the price touches the trendline.
Proximity: Trade opens when the price enters a set distance (in pips) from the trendline.
Uptrend Trade Type
Sets trade direction for upward trendlines:Bounce: Price touches trendline and moves in the opposite direction.
Continuation: Price continues in the direction it came from.
Downtrend Trade Type
Same as Uptrend Trade Type, but for downward trendlines.Trendline Proximity Zone (Pips)
Defines the distance (in pips) used for the proximity mode. Parallel lines are drawn around the trendline, forming a "proximity zone."Proximity Lines Color
Choose the color of the proximity zone lines.Proximity Lines Style
Choose the style of the proximity zone lines (e.g., solid, dashed, dotted).
Blocking Entries & Targets Near Horizontal Lines
Proximity Zone (Pips)
Creates zones around horizontal lines to avoid trades with take profits too close to these lines. If entry and take profit are in the same zone, the trade is blocked. This will only work when you use “Horizontal Line” in the Take Profit Type. Set to "0" to disable.Lines Color
Sets the color for the proximity zone lines of horizontal lines.Lines Style
Choose the style for proximity zone lines drawn around horizontal lines.Alternative Take Profit
If the take profit is blocked by a proximity zone, the cBot will look for another horizontal line. If no line is available, it will use the Backup SL/TP (Pips) value.
Stop Loss & Take Profit
Take Profit Type
Choose how the take profit is calculated:Fixed size in pips: Set a fixed number of pips for all trades.
Detect Extreme Price: The cBot finds the highest/lowest price between the start and end of the trendline and sets the take profit there.
Multiple of Average Bars Size: The cBot calculates the average size of recent bars and multiplies it by a user-defined number.
Horizontal Lines: Take profit is set at the nearest horizontal line.
Stop Loss Type
Works similarly to the Take Profit Type but for stop loss.Stop Loss Gap (Pips)
Adds extra room to the stop loss. This value (in pips) will be added to the calculated stop loss.Fixed Take Profit (Pips)
When using a fixed take profit, this is the distance in pips to set.Fixed Stop Loss (Pips)
When using a fixed stop loss, this is the distance in pips to set.Bars to Average
Number of bars used to calculate the average bar size for the Multiple of Average Bars Size method.Take Profit (X Average)
Multiplier used when calculating take profit based on the average bar size.Stop Loss (X Average)
Multiplier used when calculating stop loss based on the average bar size.SL/TP on Bid Only
When enabled, positions will close based on the bid price only.Backup SL/TP (Pips)
If a take profit or stop loss cannot be placed, this value will be used as a fallback.
Extra Options
Recycle Trendlines
Allows a trendline to open multiple trades (once the last one is closed, a new one can open), or if disabled, only one trade per trendline.Delete Trendline After TP/SL
Automatically deletes a trendline once its associated trade has closed.Reset Trendline Records
Clears trade records from the trendline comment box, allowing trendlines to be reused after the cBot restarts.Options: On start, on stop, or never.
Allow Gapped Entry
Specifies whether trades are allowed if the price gaps over the trendline.Options: Small Gaps Only, Any Gap, or No.
Lock Activated Trendline
Locks the trendline while a trade is active, preventing it from being moved or modified.
Alerts & Help
Alert Types:
No: Disables all alerts.
Essential: Alerts only when a critical issue occurs (e.g., problems placing stop loss or take profit). Non-essential messages, such as missing risk amount on the trendline, will not trigger an alert since the cBot will use the backup SL/TP.
All: Enables all available alerts from the cBot.
Telegram Messages:
Options: No, Text and Image (a screenshot of the chart).
Telegram Bot Token:
Users must provide their Telegram bot token to enable Telegram alerts.
Telegram Bot ID:
Enter the Telegram bot ID to receive alerts through Telegram. Click on the button above and use the Telegram Client ID Fetcher.
Imgur Client ID:
Required for Telegram alerts with image attachments.
Your Email:
Enter your email address to receive email alerts. Ensure the cTrader platform is configured for email sending.
PopUps:
Enable or disable cTrader pop-up alerts.
Sound Alerts:
Enable or disable sound alerts.
Show User Guide Button:
Enable or disable a button on the chart that opens this user guide when clicked.
Notes
This cBot does not place trendlines automatically; users must add them manually to the chart.
Only the official version of cTrader is supported. If you downloaded cTrader from your broker’s website, that is most certainly outdated and not supported. Download the correct version here.
Horizontal lines are used only for setting stop losses and take profits and for blocking trades with small take profits, not for initiating trades.
Arrows can be used if you want to place lines on the chart without triggering trades. They behave just like trendlines but feature a small arrow tip at the end. This allows for annotations without affecting trade execution.
The cTrader Analysis Tools Alerts indicator works in tandem with this cBot, offering additional insights and alerts for trendline interactions. As you can see in the image bellow, the labels on the trendline and on the horizontal lines are being managed by the indicator. The parallel lines are being created by the Trendline Trading cBot. The Indicator also offers many quality-of-life improvements, including Telegram and email alerts for many types of chart objects.