Breakout cBot
Strategy Overview¶
The Breakout cBot capitalises on moments where a symbol price moves beyond a predefined level of support or resistance.
This cBot monitors price consolidation by comparing the distance between the top and bottom Bollinger Bands with a user-defined threshold and then does the following:
- If the symbol price remains within the consolidation range for a specified number of periods, the cBot identifies the market as consolidating.
- If the price breaks out above the top band, it opens a buy position. If the price breaks below the bottom band, it opens a sell position.
- When opening a position, it applies the user-defined stop-loss and take-profit values.
The cBot exploits breakout movements after a consolidation phase, making it suitable for markets or symbols exhibiting clear consolidation periods and sharp directional moves.
Indicator Integration¶
The Bollinger Bands indicator is central to the strategy employed by the Breakout cBot.
The cBot uses the width of the Bollinger Bands (the distance between the top and bottom bands) to identify periods of consolidation. When the bands are narrow (indicating low volatility), the cBot considers this a consolidation period.
If the difference between the top and bottom bands is less than or equal to a specified threshold (BandHeightPips
), consolidation counter (consolidation
) is increased. The cBot needs a certain number of consecutive consolidation periods (ConsolidationPeriods
) before it considers a potential breakout.
The cBot monitors and interprets the price for a breakout this way:
- Bullish breakout. If the ask price exceeds the top Bollinger Band, the cBot interprets this as a bullish breakout and executes a buy order.
- Bearish breakout. If the bid price falls below the bottom Bollinger Band, the cBot interprets this as a bearish breakout and executes a sell order.
After executing a trade, the consolidation counter is reset to zero.
Calculation and Logic¶
Bollinger Bands Setup
\(B_{\text{top}}\) – top band
\(B_{\text{bottom}}\) – bottom band
\(MA\) – moving average
\(D\) – number of deviations
\(\sigma\) – standard deviation
Consolidation Condition
\(H\) – band height in pips
\(P\) – pips size
\(C_{\text{Counter}}\) – consolidation counter
Consolidation Period Check
If consolidation counter is greater than consolidation periods, execute breakout logic.
Breakout Logic
If ask price is greater than top band, place a buy order. If bid price is less than bottom band, place a sell order.
Parameters¶
Parameter | Unit | Definition | Tips |
---|---|---|---|
Quantity | Lot | Volume of each trade. | Traders with low-risk appetites may start with low amounts to minimise potential losses. Users with higher risk tolerance may set higher figures to target bigger profits. |
Stop loss | Pip | Number of pips at which a trade will automatically close to prevent further losses. | Risk-averse traders may set tight stop-loss values to limit potential losses. Users capable of tolerating market fluctuations may set broader stop-loss values, allowing their trades more room to breathe before closing. |
Take profit | Pip | Number of pips at which a trade will automatically close to prevent further losses. | Traders who prefer quick exits may use lower take-profit values to capitalise on short-term movements. Users targeting longer trends may set high take-profit values so that their trades can run for longer. |
Band height | Pip | Maximum width of the Bollinger Bands during a consolidation phase that enables the cBot to identify periods of low volatility. | Traders focusing on tight consolidations may use low band height values to target major breakouts from low volatility periods. Users comfortable with wider ranges may use increased band height values, allowing the cBot to consider slightly broader consolidations as potential setups. |
Bollinger Bands deviations | — | Standard deviation value used to calculate the width of the Bollinger Bands. | Traders focusing on tight consolidations may use low band height values to target major breakouts from low volatility periods. Users comfortable with wider ranges may use increased band height values, allowing the cBot to consider slightly broader consolidations as potential setups. |
Bollinger Bands periods | — | Number of periods used to calculate the Bollinger Bands. | Traders focusing on short-term market movements may use small periods, which make the Bollinger Bands more sensitive to recent price changes. Users interested in longer-term trends should consider big periods, which smoothen out the Bollinger Bands and reduce its sensitivity to short-term fluctuations. |
Consolidation periods | — | Number of consecutive bars that must meet the consolidation criteria before a breakout trade is considered. | Traders looking for more frequent trades may reduce the consolidation periods, allowing the cBot to enter trades sooner. Users who prefer confirmed breakouts may increase the consolidation periods to ensure that the price stays within the consolidation range for longer before action is taken. |
Application¶
Trending Markets¶
The Breakout cBot performs well in trending markets (upwards or downwards). In such markets, breakouts often align with the overall trend after a period of consolidation, leading to substantial price movements.
Use Case
Consider a scenario where EURUSD is in a strong uptrend but temporarily consolidates in a narrow range. The Bollinger Bands narrow, indicating reduced volatility. The cBot detects this consolidation and waits for a breakout. As the trend resumes, the price breaks above the top Bollinger Band. The cBot executes a buy order, capitalising on the continuation of the trend.
Best Practices
- Use larger timeframes. The cBot is particularly effective on larger timeframes (e.g., 1-hour, 4-hour) in trending markets. This setup helps to capture significant price movements that yield higher returns.
- Avoid short consolidation periods. In strongly trending markets, you may want to avoid settings that cause short consolidation periods because they might lead to false breakouts.
Breakouts After Patterns¶
The cBot can be used to trade breakouts from chart patterns that typically lead to strong price movements, such as triangles, flags or pennants. These patterns often result in a consolidation phase followed by a breakout.
Use Case
Consider a scenario where the EURGBP symbol forms a symmetrical triangle pattern on the 1-hour chart. As the triangle narrows, the Bollinger Bands also tighten, indicating reduced volatility. The cBot identifies the consolidation within the triangle. Once the price breaks out above the top Bollinger Band as it exits the triangle pattern, the cBot executes a buy order to capture the breakout.
Best Practices
- Combine the cBot with other patterns. Identify important chart patterns manually and then use the cBot to automate the breakout trades once the pattern completes.
- Extend consolidation periods. For patterns that form over longer periods, consider increasing the consolidation period to ensure the cBot only triggers after the pattern is fully formed.
Post-News Trading¶
The cBot may be effective on days with major economic news, events or announcements. After certain news, some markets take time to consolidate as traders digest the information. When the market direction becomes clear, a breakout may occur.
Use Case
Consider a scenario after the release of U.S. Non-Farm Payrolls data, the JPYUSD pair consolidates as traders assess the implications of the report. The Bollinger Bands narrow, indicating low volatility. The cBot identifies this consolidation and waits for a breakout. As the market settles on a direction (e.g., stronger USD due to better-than-expected data), the price breaks out below the bottom Bollinger Band. The cBot executes a sell order to capture the move.
Best Practices
- Monitor economic calendars. Configure the cBot to run around major economic releases. Ensure the consolidation period settings are adjusted to capture the post-news consolidation phase before the breakout.
- Adjust the stop loss. Due to increased volatility following news events, consider widening the stop loss to accommodate potential market swings before a breakout fully materialises.
Summary¶
The Breakout cBot empowers traders to take advantage of market volatility, high trading volume and increased activity. While the cBot is efficient at executing breakout strategies, its reliance on Bollinger Bands may cause performance issues during certain market conditions.
Tailoring the Breakout cBot to specific symbols and your trading preferences can significantly improve its effectiveness. By incorporating your own strategies into the cBot and modifying its code to enable it to utilise additional indicators, you can further enhance its accuracy and performance.