
Start Here
Platform

Tour
Bots 101How it worksLive demo
Tools
Automated tradingOptions backtestingWatchlist scannerPrivate community
Use cases
New investorsStock tradersActive tradersPassive investorsSwing tradersAlgorithmic traders

Templates
By trade type
Stock trading botsOptions trading bots
By strategy type
Bullish options strategiesNeutral options strategiesBearish options strategiesHedging strategies
By style
Active and high frequency botsEvent-based botsTrend trading botsMomentum trading botsStatistic and probability-based botsTechnical analysis botsEarnings strategy bots

Integrations

Pricing
Education

Courses
Overview
By experience
Beginner
What is an options contract?Stock trading vs. options tradingOptions contract specificsCall vs. put options basicsBuying options vs. selling optionsOptions profit and loss diagramsOptions pricing tablesOption moneyness (ITM, OTM, and ATM)Options pricing and the "Greeks"Options expiration and assignmentWhat's our "edge" trading options?Single vs. multi-leg options strategiesSmall account options strategies
Intermediate
Fearless, confident options tradingHistorical volatility vs. implied volatilityPredicting market movesTrade size and capital reservesPortfolio balance and beta weightingHow to choose the best options strategyHow far out to place trades?Strike price anchoring with probabilitiesTips on getting your trades filledAdvanced and contingent orders7 step options trade entry checklist
Advanced
Developing a daily trading routineHow to avoid "Black Swan" eventsAdjusting and hedging option tradesExiting options trades automaticallyOptions strategies we don't adjust (and why)Big picture adjustment strategyWhen to adjust or notAdjusting straddles and stranglesAdjusting credit spreads, iron condors, and calendarsSmarter stop-loss ordersBuilding a diversified options portfolioRolling options trades for duration and premiumOptions expiration week position checklistDealing with stock assignment and dividendsHow to free up trading margin and cash
By subject
Options basics
Why options vs. stocks?What is an options contract?Smart use of leverageOption strike priceOption premiumOption expirationOption contract multiplierProfit and loss diagramsLong call option explainedShort call option explainedLong put option explainedShort put option explainedATM, ITM, and OTM optionsCash vs. margin basicsHigh probability trading definedHow to buy a call optionHow to buy a put optionSingle-leg vs. multi-legWhat is the VIX?Is fundamental analysis dead?
Entering and exiting trades
Game of numbers7 step entry checklistStrong liquidity examplesPicking the next directionScanning for tradesOption pricing table basicsSetting up your trade tabPinning your probability of profitUsing delta for probabilitiesBuy to open vs sell to openBuy to close vs sell to closeMarket, limit, stop loss orders5 types of contingent ordersLimit ordersMarket ordersLimit on close ordersMarket on close ordersAdvanced contingent ordersTaking profits before expirationMechanics of rollingConsider future events
Options expiration
Options expiration explainedWhat is the Options Clearing Corporation (OCC)?Physical vs. cash settlement optionsAmerican vs. European style optionsWeekly options expirationWeekly expiration tags/codesOptions assignment processOptions exercise processTrading timeline (duration)
Bullish options strategies
Bull put spreadBull call spreadLong callShort putBull call backspreadPut broken wing butterflyCall calendar spreadPut diagonal spreadCustom naked putCovered callSynthetic long stock
Neutral options strategies
Short straddleLong straddleIron condorsShort strangleLong strangleIron butterflyUnbalanced iron condors
Bearish options strategies
Bear call spreadBear put spreadLong putShort callBear put backspreadCall broken wing butterflyPut calendar spreadCall diagonal spreadCustom naked callCovered putSynthetic short stock
Portfolio managmeent
No guaranteed tradesDon't do something, sit thereAccount size adjustmentsAvoiding stock market overloadStocks, indexes, & ETFsMonitoring positionsCreating automatic alertsIndividual stock betaPortfolio betaBeta weighting your portfolioUncorrelated industries/sectorsSystematic vs. unsystematic riskEfficient portfolio frontierLimiting undefined risk tradesEconomic calendarConcept of legging
Options pricing and volatility
How to find option price quotesUnderstanding the mathIV vs. IV percentileProbability of profit vs. probability of touchOption probability curveBid-ask spread definedIV expected vs. actual moveThe "Greeks"Fatal pricing errorsInverse ETFsOptions parity
Adjusting trades
#1 adjustment for any tradeWhen to adjust a tradeSingle options trade vs. overall portfolioLeveraging the analyze tabCall spread adjustmentsPut spread adjustmentsShort strangle adjustmentsIron condor adjustmentsShort straddle adjustmentsCalendar spread adjustmentsDebit spread adjustmentsButterfly adjustmentsUsing stop lossesDelta hedgingRolling positionsPairs hedging

Strategies
Long callLong putShort callShort putCovered callCovered putProtective putCollar strategyLEAPSBull call debit spreadBear call credit spreadBull put credit spreadBear put debit spreadLong straddleShort straddleLong strangleShort strangleCall calendar spreadPut calendar spreadIron condorReverse iron condorIron butterflyReverse iron butterflyCall butterflyPut butterflyStrapCall diagonal spreadPut diagonal spreadCall ratio spreadPut ratio spreadCall backspreadPut backspreadLong box spreadShort box spreadReversalStock repair

Topics
OverviewAsset allocationAutomated tradingBehavioral financeBrokersCandlestick patternsChart patternsDividendsEconomic indicatorsEquity investmentsExercise & assignmentFinancial analysisFinancial historyFinancial marketsFinancial modelingFinancial theoriesFundamental analysisFuturesInvestment accountsInvestment taxesInvestor biasesMarket holidaysMarket hoursMarket indexesMarket indicatorsMomentum tradingOptionsOptions pricingOptions settlementPortfolio managementRisk managementStocksStock marketTechnical analysisTechnical indicatorsTrading commissionsTrading platformsTrading psychologyTrend trading
Resources

Workshops

Podcast

Blog
Support

Help Center
Overview
Getting started
What is a bot?Creating a botAutomation typesAutomation editorBot dashboardBot positionsBot logTemplates and cloningKey conceptsSafeguards and limitsPower of botsBest practices
Bot automations
What is an automation?Scanner automationsMonitor automationsEvent automationsEditing automationsReusing automationsCopying automationsOrdering automationsUsing custom inputsBot level inputsAutomation statusesAutomations library
Bot actions
DecisionsOpen positionClose positionNotificationsLoop symbolsLoop positionsBot tagsPosition tags
Bot examples
Genesis 1.0 botGenesis 2.0 botGenesis 3.0 botTrend trading with stocks botPortfolio trend trading botTrend trading with options botMultiple moving averages botTechnical swing trading botTrend and momentum botWeekly credit spread botRecurring iron condors botThe "Honey Badger" botHybrid spreads botHigh IV rank iron condor bot
Decision recipes
Comparing underlying symbol priceEvaluating symbol typeComparing underlying symbol propertiesEvaluating underlying symbol performanceEvaluating underlying symbol standard deviationComparing underlying symbol price to an indicatorComparing multiple underlying symbol indicatorsEvaluating underlying symbol implied volatility rankEvaluating underlying symbol earnings reportingEvaluating underlying symbol price probabilityEvaluating underlying symbol probability within rangeEvaluating bot propertiesEvaluating bot available capital for opportunitiesComparing bot position count to position typeComparing bot position count to underlying symbolEvaluating bot position count to position type and underlying symbolEvaluating bot last position activityEvaluating bot last activity with underlying symbolComparing bot active orders statusComparing bot active orders status with underlying symbolEvaluating bot position availabilityEvaluating bot tagsEvaluating opportunity availabilityEvaluating opportunity return expectationsComparing opportunity attributesComparing opportunity leg attributesComparing opportunity bid-ask spreadEvaluating opportunity probabilitiesEvaluating position performanceComparing profit target to trailing valueComparing position time to expirationComparing position durationEvaluating position underlying symbolComparing position propertiesComparing position leg propertiesEvaluating position typeEvaluating position sideComparing underlying symbol price to position legEvaluating position tagsEvaluating underlying symbol indicator propertiesComparing multiple underlying symbol indicator propertiesEvaluating MACD technical indicatorComparing Bollinger Bands to symbol priceEvaluating stochastic technical indicatorComparing VIX propertiesEvaluating market time of the dayEvaluating days of the weekEvaluating bot switches
Position statement
Activity summaryPosition detailsTrade detailsOpened positionsClosed positionsCanceled positionsOverride positionsExpired positionsPosition historyManually open positionManually close positionImport position
Order pricing
SmartPricingFinal price settingsPosition summaryOrder detailsWorking ordersManual override
Bot templates
Creating new templatesUpdating existing templatesDeleting templatesSharing templatesUpdating shared templatesTemplate best practices
Cloning bots
Cloning existing botsCloning from templateCloning from shared template
Troubleshooting
Using bot logsTesting your botsNot enough capital warningDaily position limit warningTotal position limit warningPricing anomaly warningMissing or invalid input errorDaily symbol limit errorExcessive errors failsafeOverlapping strikes failsafePrice exceeds strike-difference errorOptions expiration protocolDuplicate orders errorOptions approval level errorBot event loopsStock splits and corporate actionsSupported browsersSupported countries
Community forum
Community guidelinesCrafting your introductionSending group messagesSending private messagesAttaching bot templatesReceiving bot templatesAttaching automationsReceiving automationsFollowing tradersPosting publiclyEditing posts and messagesSubscribed discussionsUsing bookmarks
Using backtester
Running a new backtestBacktesting results summaryModifying existing backtestsMy backtestsBacktesting research databaseTop backtestsBacktesting errors
Account settings
My profileTrading accountsConnecting to TDAmeritradeConnecting to TradeStationConnecting to TradierIncompatible accountsPassword managementSession timeoutTwo-step authentication
Technical docs
Infrastructure and securityAutomation structureAutomation behaviorData feedsOrder handlingTrade enforcementsBroker rejection errorsBot limitationsProfit and lossFair value pricingDecision propertiesDecision calculationsParameter selectionCalculating probabilityPlatform indicators

Contact
Send FeedbackReport IssueEmail Us
Option AlphaOption Alpha

LoginFree Trial
BlogBot InspirationHow to Automate a Bollinger Band Strategy

How to Automate a Bollinger Band Strategy

Learn how to build an automated Bollinger Band bot using debit and credit spreads to trade breakouts.
How to Automate a Bollinger Band Strategy
Steve Boswell
Mar 31, 2022
•
6 min read





Bollinger Bands are a technical indicator that visually display the upper and lower range of a security’s normal price movement using standard deviation. 

Traders use Bollinger Bands to identify overbought or oversold conditions in a security and potential breakouts from a trading range. 

Bollinger Bands are typically drawn 2 standard deviations above and below a 20-day simple moving average. Approximately 95% of a security’s price action should occur inside the upper and lower Bollinger Band. 

If you change the default parameters from 2 standard deviations to 1, 68% of price action should occur inside the bands. Widening the band’s parameters from 2 to 3 standard deviations would capture approximately 99% of the expected price range inside the bands. 

This guide shows you how to automate buying and selling spreads based on Bollinger Band breakout signals.

Strategy Overview 

While 95% of a security’s price action occurs between the upper and lower band, a breakout can be a significant event. With proper risk management, trading breakouts can be rewarding. 

To identify and trade breakouts manually, you must first identify the breakout and then take action. It’s difficult enough to monitor breakouts in a single security, let alone a group of tickers.

Bots scan for breakouts so you don’t have to. Bots can continuously look for breakouts in multiple tickers and automate a trade’s entry when conditions are right. 

This bot trades Bollinger Band breakouts with risk-defined credit spreads or debit spreads. You can easily choose to trade the strategy with credit spreads or debit spreads by simply toggling a bot switch.

After you’ve selected the position type, you can define profit targets and build in protection if a profit target is not hit. The bot automatically sends an order to your broker if a profit target triggers.

Automating the Strategy

Automating a Bollinger Band breakout strategy allows you to look for breakouts across multiple tickers. 

This bot’s scanner automation includes SPY, TLT, GLD, and XOP. The bot uses a symbol loop to check for a Bollinger Band breakout in each ticker. You can always add or remove tickers to the symbol loop.

An opening order is sent to your broker if a breakout is identified.

The bot only trades when you tell it to trade. You can include filters to prevent overtrading. If a position limit is hit, the bot will not trade. Or, if the bot already has a position in the security, it will not open another position. 

As you can see in the screenshot below, there is more to this scanner automation. So let’s dive into the specifics of each decision recipe.

Bollinger Band bot scanner automation

Entering Positions 

The scanner automation first checks to ensure the bot doesn’t already have an open position in each ticker. This prevents the bot from opening multiple positions in a single security.

Bot position count

The bot then checks its position limits to ensure it can open a new position.

Bot check for position limits

Next, the bot checks if the security has broken above the upper or below the lower band intraday with this Bollinger Band decision recipe. 

This bot uses the default Bollinger Band inputs of a 20-day simple moving average with 2 standard deviations above and below the SMA.

Bollinger band breakout decision recipe

We’ve also added a bot switch.

Switches are a dynamic tool that give you the ability to effectively “turn on” or “turn off” certain parts of an automation, controlling which path the bot takes. 

In this case, the switch tells the bot to open a debit spread or credit spread. 

Switches allow you to adapt to market conditions. When implied volatility is higher, maybe you may want the bot to sell credit spreads. Other times, you may want to buy debit spreads for a more directional move. 

Your individual technical analysis can help you decide when to turn the switch on or off.

Bot swtich

You can label the switch, turn its default value to “On,” and provide a description for easy future reference.

Turning on bot switch

Next, the bot checks for liquidity using a minimum bid/ask spread threshold. Then, the bot confirms there is sufficient open interest for the inside leg of the position.

Grouping opportunity filter decision recipes

If all conditions are met, the bot sends an order to the broker to open a position using Option Alpha’s SmartPricing technology.

Open position action

Managing Positions

One of the great things about automation is that it removes human emotion from trade management, especially when exiting a position. You can tell the bot when to take profits, and it will consistently execute without thinking twice. 

The bot uses a position loop inside the monitor automation to apply the same exit parameters to each open position. 

First, the bot determines if the position is a short credit spread or a long debit spread. Remember, this depends on whether or not you’ve turned the switch “on” or “off.”

Check position type

For credit spreads, the bot targets a 50% profit. For debit spreads, the bot targets a 25% profit. You can adjust these values based on personal preference and risk tolerance.

Check for profit

If the position’s profit target is met, the bot sends an order to your broker.

If not, there are additional criteria for the bot to check for each position type.

The bot checks each position’s days until expiration before making its next decision.

For credit spreads, the bot will automatically exit the position if it expires in less than two days and the position is challenged.

Managing position at expiration

If the credit spread’s short leg is not challenged, the bot references the Bollinger Band. If the price reverses back through the moving average, the bot closes the position to preserve any profits or mitigate further losses.

Monitor automation

As you can see, the monitor automation has a lot going on. But that is the beauty of bots: they can control entries and exits dynamically based on certain conditions. 

Adapting the Strategy to Trade Reversions

You can easily modify this bot to trade a reversion instead of a breakout. 

To trade a Bollinger Band reversion, you could sell call credit spreads when the indicator reaches the upper range and sell put credit spreads when the indicator reaches the lower range. 

If you turn the switch off, you can trade debit spreads when the Bollinger Band serves as support or resistance and price reverts.

Bollinger band reversion scanner automation

You also will need to modify the recipe that checks if the position is close to expiration and is challenged.

Managing position close to expiration

If the position is not close to expiration or challenged, you can check the Bollinger Band indicator is still within the mean reversion trading range. 

Price between bollinger bands

If the position is not at a 50% profit but is also not at risk of being challenged, the position remains open. 

Another benefit of bots is the ability to effortlessly test various strategies. You can clone these Bollinger Band strategies and let them run side by side in paper trading. 

After a few weeks or months, you can verify the performance of each strategy and decide which to turn on for live trading. 

Automation Advantage 

Bots take the mundane, repetitive processes traders deal with on a daily basis and automates them. Automation provides:

  1. Better consistency
  2. More time to focus on other aspects of trading (and life)
  3. Ability to take advantage of opportunities, even if you can’t watch the market

This Bollinger Band strategy is one example of the many strategies that can be automated with a bot. Watch this bot workshop where Kirk builds a Bollinger Band bot step-by-step.

If Bollinger Bands are not for you, check out our RSI swing trading bot. 

You can easily clone either Bollinger Band strategy in the Community here:

Automated Bollinger Band Bot with Spreads

Bollinger Bands Reversion

Strategies
Autotrading
Automated Trading
Technical Indicators
Bull Put Spread
Long Put Spread
Bear Call Spread
Long Call Spread
Short Put Spread
Short Call Spread
Open Position
Close Position
Exiting Trades
Decision Actions
Decision Recipes
Grouping Decisions
You're on the list right?
Want to know when new posts go live? Subscribe to get updates each time we publish new training, research, or case studies. Autotrading is moving fast so don't get left behind.
‍
Thank you! Please click the verification link we just sent to your email address.
Oops! Something went wrong while submitting the form.
We’ll never share your email address
Featured posts
New Open High Low Close (OHLC) Stock Decisions
New Open High Low Close (OHLC) Stock Decisions
June 10, 2022
Create Bots Instantly from Any Backtest
Create Bots Instantly from Any Backtest
June 11, 2022
Introducing the Bot Wizard
Introducing the Bot Wizard
June 11, 2022
We Analyzed 20,000 Options Trades: Here’s What We Learned About Position Swings
We Analyzed 20,000 Options Trades: Here’s What We Learned About Position Swings
March 25, 2022
Backtester Enhancements Unlock Research Superpowers for Options Traders
Backtester Enhancements Unlock Research Superpowers for Options Traders
February 22, 2022
Building an RSI Swing Trading Bot with Credit Spreads
Building an RSI Swing Trading Bot with Credit Spreads
December 13, 2021
3 Smart Ways to Use SmartStops
3 Smart Ways to Use SmartStops
December 8, 2021
5-Year SPY Put Credit Spread Backtest
5-Year SPY Put Credit Spread Backtest
November 17, 2021
Managing Multiple Strategy Types with Monitor Automations
Managing Multiple Strategy Types with Monitor Automations
June 30, 2021
Automated Does Not Mean Unattended
Automated Does Not Mean Unattended
May 19, 2021
Using Bots to Automate Profit Targets and Stop Losses
Using Bots to Automate Profit Targets and Stop Losses
April 19, 2021
Most popular
See All
13 Stock Chart Patterns that You Can’t Afford to Forget
13 Stock Chart Patterns that You Can’t Afford to Forget
6 min read
The Three Best Option Strategies for Earnings
The Three Best Option Strategies for Earnings
8 min read
How Can a Call Option Decline in Value When a Stock Rises?
How Can a Call Option Decline in Value When a Stock Rises?
3 min read
What Your Mother Didn’t Tell You About Trading Iron Condors
What Your Mother Didn’t Tell You About Trading Iron Condors
4 min read
4 Must Know Options Expiration Day Traps to Avoid
4 Must Know Options Expiration Day Traps to Avoid
5 min read
Problems Getting Your Option Order Filled? Try These 3 Quick Adjustments
Problems Getting Your Option Order Filled? Try These 3 Quick Adjustments
7 min read
How to Set Up a Broken-Wing Butterfly Option Strategy
How to Set Up a Broken-Wing Butterfly Option Strategy
3 min read
5-Year SPY Put Credit Spread Backtest
5-Year SPY Put Credit Spread Backtest
7 min read
3 Option Strategies to Use During Low Volatility Markets
3 Option Strategies to Use During Low Volatility Markets
2 min read
Naked Option Selling: The Stupid Myth of "Unlimited Losses"
Naked Option Selling: The Stupid Myth of "Unlimited Losses"
6 min read
Rising Interest Rates: Taper Tantrum or Opportunity?
Rising Interest Rates: Taper Tantrum or Opportunity?
5 min read
Mastering the 4 Different Types of Option Orders
Mastering the 4 Different Types of Option Orders
8 min read

No-code, fully automated trading for stocks and options.

HomeAboutLegalStatusContact
©2022 Option Alpha. All Rights Reserved. Patent Pending USSN 63/118,547