PROTECTED SOURCE SCRIPT
Bollinger Bands by Abu Elyas

Bollinger Bands with Adjustable Stop Loss (Long-Only)
This strategy uses a Bollinger Band breakout approach to enter long positions and incorporates an adjustable stop loss for risk management.
Below is an overview of the logic, parameters, and usage instructions.
1. Bollinger Bands Logic
2. Entry Triggers
3. Exit Triggers
1. Bollinger Band Exit:
2. Stop Loss Exit:
3. Date Range:
4. Position Sizing & Other Settings
1- Position Size:
2- Commissions & Slippage:
3- Timeframe Handling:
5. Customization
1. Bollinger Bands Parameters:
2. Stop Loss (%)
3. Date Filter:
6. Notes & Best Practices
1- No Short Trades:
2- Risk Management:
3- Market Gaps & Volatility:
4- Test Thoroughly:
7. Disclaimer
Use this script as a foundation and personalize it based on your trading style, tolerance for drawdowns, and market conditions.
This strategy uses a Bollinger Band breakout approach to enter long positions and incorporates an adjustable stop loss for risk management.
Below is an overview of the logic, parameters, and usage instructions.
1. Bollinger Bands Logic
- Basis (Middle Band): A moving average (type selectable by the user) of the chosen source, typically the closing price.
- Upper Band: The basis plus a specified number of standard deviations (user-defined multiplier).
- Lower Band: The basis minus the same number of standard deviations.
2. Entry Triggers
- The strategy enters a long position when the close price rises above the upper Bollinger Band, suggesting a potential bullish breakout.
- This logic is only applied within a user-specified date range (adjustable in the strategy’s inputs).
3. Exit Triggers
1. Bollinger Band Exit:
- If the close price drops below the lower Bollinger Band, the strategy closes the position, indicating a loss of bullish momentum.
2. Stop Loss Exit:
- A default 8% stop loss is set, which automatically exits the trade if the close falls 8% below the entry price.
- This stop-loss percentage is adjustable from the strategy’s settings, allowing users to tailor risk based on their preferences.
3. Date Range:
- If the current bar is outside of the specified start/end dates, the strategy will also exit any open positions.
4. Position Sizing & Other Settings
1- Position Size:
- By default, the script uses 100% of account equity for each trade.
2- Commissions & Slippage:
- Commission is set to 0%, and slippage is set to 3 ticks.
3- Timeframe Handling:
- You can select a custom timeframe or leave it blank to use the chart’s timeframe.
5. Customization
1. Bollinger Bands Parameters:
- Length of the moving average, type of moving average (SMA, EMA, etc.), and the standard deviation multiplier can be adjusted.
2. Stop Loss (%)
- The default stop loss of 8% can be changed in the script’s input settings to any percentage you prefer.
3. Date Filter:
- Modify the start/end dates to control the historical period over which the strategy executes trades.
6. Notes & Best Practices
1- No Short Trades:
- This is a long‐only strategy. It will either be in a long position or flat (no open position).
2- Risk Management:
- An 8% stop loss may or may not align with your personal risk tolerance. Always adjust according to market conditions and your own trading style.
3- Market Gaps & Volatility:
- In highly volatile markets, slippage or gaps can cause the actual exit price to be worse than the intended stop-loss level.
4- Test Thoroughly:
- Backtest on different timeframes and market conditions. No single strategy works in all scenarios.
7. Disclaimer
- Educational Use Only: This script is for informational and illustrative purposes and should not be considered financial advice.
- No Guarantee of Profit: Past performance does not guarantee future results. Trading involves substantial risk, and it is possible to lose more than your initial investment.
- Consult a Professional: Always consult a qualified financial advisor before making investment decisions.
Use this script as a foundation and personalize it based on your trading style, tolerance for drawdowns, and market conditions.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.