StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py
5.0.1
Prefix Reserved
dotnet add package StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py --version 5.0.1
NuGet\Install-Package StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py -Version 5.0.1
<PackageReference Include="StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py" Version="5.0.1" />
<PackageVersion Include="StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py" Version="5.0.1" />
<PackageReference Include="StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py" />
paket add StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py --version 5.0.1
#r "nuget: StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py, 5.0.1"
#:package StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py@5.0.1
#addin nuget:?package=StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py&version=5.0.1
#tool nuget:?package=StockSharp.Strategies.0221_Bollinger_Band_Squeeze.py&version=5.0.1
Bollinger Band Squeeze Strategy (Python Version)
This setup monitors the width of the Bollinger Bands to detect periods of low volatility. When the bands contract relative to their recent average, it signals a potential volatility expansion is near.
Testing indicates an average annual return of about 100%. It performs best in the forex market.
Once a squeeze is identified, the strategy waits for price to break outside the bands. A close above the upper band initiates a long, while a close below the lower band opens a short. The trade is closed if price returns toward the middle of the bands or if a stop-loss is triggered.
The method targets traders who like to trade volatility breakouts rather than trend continuation. Using the band width as a filter helps avoid false signals during choppy conditions.
Details
- Entry Criteria:
- Long: Band width < average width && Close > upper band
- Short: Band width < average width && Close < lower band
- Long/Short: Both sides.
- Exit Criteria:
- Long: Exit when price drops back inside the bands
- Short: Exit when price rises back inside the bands
- Stops: Yes, typically at 2*ATR.
- Default Values:
BollingerPeriod
= 20BollingerMultiplier
= 2.0mLookbackPeriod
= 20CandleType
= TimeSpan.FromMinutes(5)
- Filters:
- Category: Breakout
- Direction: Both
- Indicators: Bollinger Bands
- Stops: Yes
- Complexity: Intermediate
- Timeframe: Intraday
- Seasonality: No
- Neural networks: No
- Divergence: No
- Risk Level: Medium
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Move state resets to OnReseted for strategies 224-227