Fancy Bollinger Bands Strategy [BigBitsIO]This script is for a Bollinger Band type indicator with built-in TradingView strategy including as many features as I can possibly fit into a Bollinger Band type indicator including a wide variety of options to create the most flexible Bollinger Bands strategy possible.
Features:
- A single custom moving average serving as the middle band.
- Standard MA inputs.
- MA type.
- MA period.
- MA price.
- MA resolution (time frame).
- Visibility toggle.
- MA Candle Type
- Fancy MA inputs.
- Toggle to show only candles included in the MA calculation ("Highlight inclusion") or display entire MA history.
- Toggle to show a ghost trail when Highlight inclusion is toggled on. Displays a shaded version of past MA history before the inclusion period (as seen on snapshot).
- Toggle to show forecast values for the MA.
- Other inputs related to forecasting:
- Forecast bias. (Neutral forecasts MA if the current price remains the same.)
- Forecast period.
- Forecast magnitude.
- Toggle showing details on the screen
- Toggle the visibility of the fill between the upper and lower bands.
- Toggle to use ATR instead of the standard deviation to calculate the location of the upper and lower bands.
- Custom input for the ATR period.
Strategy Features
-Strategy Window - only test during this window
-Take Profit and Stop Loss
-Open and Close conditions, including condition counts and any/all requirements
-Many conditions to choose from that can either be selected to open, close or open and close a position
-Conditions include:
-Price crossing above/below the Upper, Middle, or Lower bands
-Price being above/below the Upper, Middle, or Lower bands
-Bollinger Band width crossing or being above/below custom values
-Percent B crossing or being above/below custom values
This script may contain errors, or out of date code. Please be mindful of updates to the script.
*** DISCLAIMER: For educational and entertainment purposes only. Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security or investment including all types of crypto. DYOR, TYOB. ***
Bollingerbandsstrategy
Advanced Bollinger Bands StrategyAdvanced Bollinger Bands Strategy
Why is it an advanced Bollinger Bands Strategy?
The purpose of Bollinger Bands is to provide a relative definition of high and low prices of a market. By definition, prices are high at the upper band and low at the lower band. This definition can aid in rigorous pattern recognition and is useful in comparing price action to the action of indicators to arrive at systematic trading decisions. Adding a Moving Average filter which only allows trades if MA and Price are outside of the BB increases the probability of profitable trades with the sacrifice of a lower trade-frequency.
Inputs for Bollinger Bands
-> BB Source
-> BB Length
-> BB Multiplier
-> Moving Average Period
-> Moving Average Source
-> Strategy Condition Options:
-> Exit Trades if Price crosses Basis Line
-> Enable Moving Average Filter
Double Bollinger Bands strategyLong Trade Setups:
To go long (to buy), you have to wait for one of the candlesticks to close above the BB upper band. (background color is green)
Short Trade Setups:
To go short (to sell), you have to wait for one of the candlesticks to close below the BB lower band. (background color is red)
How To Maximize Your Profit?
As I explained above, this trading system is good in catching the trends. Therefore, you’d better to take the advantage of the strong movements and maximize your profit.
When there is a strong trade setup, you can also take two positions with the same stop loss, when there is a trade setup based on the Double Bollinger Bands trading system. Set a 2 x SL target for the first position, and no target for the second one. If the first position hits the target, move the second’s position stop loss to breakeven and hold it (TLDR : Hold a sell as long as background is red)
In case of a long position, hold the second position as long as the candlesticks form between the BB1 and BB2 upper bands, or above the Bollinger Middle Band. Close the second position when candlesticks start crossing the BB1 upper bands, or when one of the candlesticks breaks below the Bollinger Middle Band . (TLDR : Holda buy as long as background is green)
Custom Band Strategy1. Trend
if ema200 > ema30 Long entry only
else Short entry only
2. Custom Band
Upper band = sma(period) + max(close, period) * multiplier
Lower band = sma(period) - max(close, period) * multiplier
Multiplier can be either 1.3 or 1.1 depending on the trend.
(If trend is long, upper band's factor would be 1.3, lower band be 1.1)
2. Long entry condition
- Cross over the lower band and band width is greater than (close price)*2.2%(assume this band width as an expected ROE)
- Previous candle change rate((close-open)/open*100) is less than 3%.
3. Short entry condition
- Cross under the upper band and band width is greater than (close price)*2.2%
- Previous candle change rate is less than 3%.
4. Long/Short exit condition
- cross over/under the lower/upper band and roe is higher than 2%.
5. Stop/Target condition
- Target 10%, Stoploss 3%
- Previous candle change rate is higher than 3%.
Most variables can be set manually.
Test period changeable.