cBot Overview
This cBot runs in the background of your cTrader platform and checks open positions against your defined expiry rules. It can track both profitable and losing trades, measuring how long they've been open in hours. When the set limit is reached, the bot will automatically close the trade. This ensures you stick to your trading plan without second-guessing or allowing trades to run endlessly.
History and Background
The Position Expiry Timer cBot was designed in response to a common problem: traders leaving positions open far longer than intended, either out of hope or neglect. Many strategies benefit from fixed holding times, especially intraday or scalping systems where exposure needs to be tightly controlled. This bot employs a simple yet effective timing mechanism to ensure positions are closed on schedule, regardless of whether they’re in profit or loss.
How it Works
The cBot constantly monitors open positions. It looks at:
-
The entry time of each trade.
-
The net profit status (winning or losing).
-
The number of hours defined in the inputs.
If a trade has been open longer than your chosen period, the bot will close it immediately. Losing trades can be closed after a shorter window to cut drawdowns quickly, while profitable trades can be given more breathing space if desired. All actions are confirmed in the log and chart messages, so you know exactly why a position was closed.
Key Features
This bot's primary strength lies in its simplicity and flexibility.
-
Close losing trades after a fixed time.
-
Close winning trades after a fixed time.
-
Adjustable expiry rules in hours.
-
Works across all symbols and timeframes.
-
Runs seamlessly in both live and backtesting environments.
How to Use It for Trading
-
Attach the bot to a chart in your cTrader platform.
-
Choose whether to activate timers for losing trades, winning trades, or both.
-
Set the number of hours before expiry for each type of trade.
-
Start trading as usual – the bot will automatically manage expiry in the background.
For example, you might decide to close all losing trades after 2 hours to prevent prolonged drawdowns. At the same time, you could give winning trades 6 hours to develop before locking in profits. Beginners can start by testing these settings on demo accounts, experimenting with different expiry times to match their trading style and risk tolerance.
Inputs and Parameters
The cBot includes several configurable inputs that allow traders to define expiry rules.
Parameter |
Default/Type |
Description |
Include Losing Trade Timer |
false / Boolean |
Enable or disable automatic expiry for losing trades. |
Losing Positions Expiry (hours) |
1 / Integer |
Number of hours before a losing trade is closed. |
Include Winning Trade Timer |
false / Boolean |
Enable or disable automatic expiry for winning trades. |
Winning Positions Expiry (hours) |
1 / Double |
Number of hours before a winning trade is closed. |
Advantages
The Position Expiry Timer cBot removes emotional bias and enforces time-based discipline. It is especially useful for traders who use intraday strategies, where holding trades overnight or for extended periods can increase risk unnecessarily. By automating the process, it reduces stress and ensures consistency.
Disadvantages
The main limitation is that profitable trades may be closed too early if the expiry period is set too short. Similarly, a losing trade might recover if left open longer, but this cBot enforces strict time-based exits regardless of market conditions. Traders should carefully test their expiry times to avoid cutting off potential gains
How To Install & Remove
First, ensure that you have the cTrader trading platform installed. Then, unzip the file and double-click it to install the platform automatically.
Need Extra Help?
Get instant answers with cTrader Sensei — our free AI assistant built for the cTrader platform. It can explain the indicator settings, suggest trading strategies, and guide you step-by-step through the use of this indicator. Rated 4.9 out of 5 in the ChatGPT Store.
Chat with cTrader Sensei.
Prefer human help? Visit our support forum, where our team and community are available to assist you.
Note: cTrader Sensei runs on OpenAI's ChatGPT platform. To use it, you will be asked to create a free OpenAI account. Registration is quick and costs nothing.
The free version works immediately, but upgrading to a ChatGPT Plus subscription unlocks the latest GPT model, which provides more accurate and detailed answers for trading, coding, and product support.
Need a Broker
If you're still looking for a broker with tight spreads and fast execution, visit our top cTrader broker site.