Double Bollinger Bands with Dynamic Stops and Take Profit### 📊 **Double Bollinger Bands with Dynamic Stops and Take Profit – Technical Description**
The **Double Bollinger Bands with Dynamic Stops and Take Profit** indicator is a comprehensive tool that enhances classic Bollinger Bands by incorporating **dual deviation bands** for improved volatility analysis. It also dynamically calculates **stop-loss** and **take-profit** levels based on recent price action, offering a robust framework for managing trades in trending or ranging markets.
---
### ✅ **Indicator Parameters**
1. **Bollinger Bands Settings:**
- **Period (`length`):** Defines the moving average window (default: 20).
- **Deviation 1 (`deviation1`):** Controls the width of the first Bollinger Band (default: 1.0).
- **Deviation 2 (`deviation2`):** Controls the width of the second Bollinger Band (default: 2.0).
2. **Dynamic Stop-Loss and Take-Profit Settings:**
- **Lookback Period (`stop_lookback`):** Number of bars used to determine dynamic stop levels (default: 26).
- **Stop Multiplier (`stop_multiplier`):** Fraction of the range used to calculate the stop-loss (default: 0.5).
- **Risk/Reward Ratio (`rr_ratio`):** Determines the take-profit relative to the stop-loss (default: 3.0).
---
### 📐 **Calculation Logic**
1. **Bollinger Bands Calculation:**
- **Basis Line:** A **Simple Moving Average (SMA)** of the closing price:
\
- **Deviation Multipliers:** Standard deviations scaled by user input:
- **Upper Band 1:** \( \text{Basis} + \text{Deviation 1} \times \text{stdev} \)
- **Lower Band 1:** \( \text{Basis} - \text{Deviation 1} \times \text{stdev} \)
- **Upper Band 2:** \( \text{Basis} + \text{Deviation 2} \times \text{stdev} \)
- **Lower Band 2:** \( \text{Basis} - \text{Deviation 2} \times \text{stdev} \)
2. **Dynamic Stop Calculation:**
- Identifies the **highest high** and **lowest low** over the lookback period:
\
- **Dynamic Stop for Long Positions:**
\
- **Dynamic Stop for Short Positions:**
\
3. **Dynamic Take-Profit Calculation:**
- Extends the stop calculation by multiplying with the **risk/reward ratio**:
\
\
---
### 📈 **Visual Outputs**
- **Bollinger Bands:**
- **Green Bands:** Inner Bollinger Bands (Deviation 1) indicate short-term volatility.
- **Red Bands:** Outer Bollinger Bands (Deviation 2) highlight extreme price movements.
- **Blue Line:** The central moving average (basis) for trend direction.
- **Dynamic Stops & Take-Profits:**
- **Green Circles:** Dynamic stop-loss and take-profit levels for **long** positions.
- **Red Circles:** Dynamic stop-loss and take-profit levels for **short** positions.
---
### 🛠️ **Practical Use-Cases**
1. **Trend-Following Strategy:** Use the **outer bands** to confirm breakouts, with dynamic stops for protection.
2. **Mean Reversion:** Enter trades when the price touches **outer bands**, aiming for the **basis**.
3. **Volatility Management:** Adjust **stop_multiplier** to adapt stops to changing market conditions.
4. **Dynamic Risk Control:** Automatically calculates stop-loss and take-profit for structured **risk management**.
---
👉 This indicator provides a **multi-layered approach** for both trend and mean-reversion strategies, integrating real-time **risk control** through dynamic stop and take-profit mechanisms.
---
Bands and Channels
Smart Zone Intraday Strategy (by Sunil Bhave)Identify the power zone. For simplicity, maybe use a moving average (like EMA) as the central line and upper/lower bands based on ATR (Average True Range). This creates a dynamic zone.
Determine solid green/red candles. Check if the candle's body is above a certain threshold (e.g., body size greater than 70% of the candle's range) and the close is above/below the power zone.
Generate buy/sell signals when price crosses above/below the smart zone with a strong candle.
Set stop loss at the low of the power zone for buys and high for sells. Maybe use the lower band for stop loss in buys and upper band for sells.
Calculate take profit based on a 1:1 risk-reward ratio. So, the distance from entry to stop loss is the same as entry to take profit
Key features:
The strategy automatically calculates position sizing based on account equity
Includes realistic commission settings (0.1% per trade)
Allows parameter optimization through input settings
Maintains separate tracking for long and short positions
Volume Weighted Average Price 5 Muñi¿Qué hace este código?
Detecta cuando el precio cruza el VWAP o cualquiera de las bandas superiores/inferiores .
Genera alertas que pueden activarse en TradingView.
Muestra señales visuales en el gráfico con etiquetas de COMPRA (compra) y VENTA (venta) .
EMA Crossover with FillEMA Crossover with Fill
This indicator plots two customizable Exponential Moving Averages (EMAs) and fills the area between them with colors to easily identify trend direction and potential crossover points.
Key Features:
Fully Customizable EMAs: Set any period length for both Fast and Slow EMAs
Visual Trend Identification: Green fill when Fast EMA > Slow EMA (bullish), Red fill when Fast EMA < Slow EMA (bearish)
Complete Style Control: Customize colors, line widths, and line styles for each EMA
Fill Transparency: Adjust fill opacity to suit your chart setup
Flexible Source: Choose any price data point as the calculation source
Multi-timeframe Support: Works across all timeframes with proper gaps handling
Offset Option: Shift the indicator forward or backward for backtesting or forecast visualization
Trading Applications:
Use this indicator to identify trend direction, momentum shifts, and potential entry/exit points. The colored fill between EMAs provides immediate visual confirmation of market conditions without requiring close examination of line crossovers.
Perfect for both novice traders seeking clear trend signals and experienced traders wanting a customizable EMA crossover system that integrates smoothly with their existing strategy.
QB Trend v3I added new ema values and an extra ALMA moving average to the "Optimized Ema Bands" developed by Onur Ağdacı.
If the 20 ema value is above the optimized band, we look for Long Bias, and if it is below the optimized band, we look for Short Bias.
As an entry point, the 5 ema crossing the 10 ema gives us a signal.
Red and green ema bands indicate that we are in the overbought and oversold zone.
Apart from all these, the trend can also be followed by using only the "ALMA moving average" of 25 and the heikin ashi candle.
RSI and EMA 50/200 StrategyExplanation:
RSI: Calculated with a period of 14 by default.
EMA 50 and EMA 200: The short-term and long-term EMAs are calculated.
Signal logic: Buy (1) when RSI is between 30-70 and EMA50 is above EMA200. Sell (-1) when RSI is below 30 and EMA50 is below EMA200.
You can backtest this strategy using this data and observe the signals plotted on the chart.
Market Open Marker - NQ8am ny open line .................................................................................................................................................... CME_MINI:NQ1!
Market Open Marker - NQ//@version=5
indicator("Market Open Marker - NQ", overlay=true)
// Define market open time (New York Time)
nyHour = 8
nyMinute = 0
nyTimezone = "America/New_York"
// Get today's timestamp for 8:00 AM in New York time
nySession = timestamp(nyTimezone, year(time), month(time), dayofmonth(time), nyHour, nyMinute)
// Check if the current bar time matches 8 AM NY time
showMarker = (time >= nySession and time < nySession + 60 * 1000) // Within 1 minute of 8 AM
// Plot vertical line at 8 AM New York Time
if showMarker
line.new(x1=bar_index, y1=high, x2=bar_index, y2=low, width=2, color=color.blue, style=line.style_dashed)
A股趋势跟踪买卖点策略//@version=6
indicator("A股趋势跟踪买卖点策略", overlay=true)
// ===== 参数设置 =====
// 趋势参数
trendLength = input.int(50, title="趋势周期", minval=20, maxval=100)
atrLength = input.int(14, title="ATR周期", minval=5, maxval=30)
trendFilter = input.float(1.5, title="趋势过滤倍数", minval=1.0, maxval=3.0, step=0.1)
// 相对强度参数
rsPeriod = input.int(30, title="相对强度周期", minval=10, maxval=100)
rsThreshold = input.float(70, title="相对强度阈值", minval=50, maxval=90)
// 成交量参数
volumeMultiplier = input.float(1.5, title="成交量放大阈值", minval=1.0, maxval=3.0, step=0.1)
// 风险管理参数
stopLossMultiplier = input.float(1.0, title="止损ATR倍数", minval=0.5, maxval=2.0, step=0.1)
profitTargetPct = input.float(20.0, title="止盈目标百分比", minval=10.0, maxval=50.0, step=0.5) / 100
// ===== 核心逻辑 =====
// 1. 趋势判断
atr = ta.atr(atrLength)
trendUp = close > ta.sma(close, trendLength) + atr * trendFilter
trendDown = close < ta.sma(close, trendLength) - atr * trendFilter
// 2. 相对强度(RS)计算
marketIndex = request.security("SH000001", timeframe.period, close) // 上证指数
stockReturn = (close - close ) / close
marketReturn = (marketIndex - marketIndex ) / marketIndex
relativeStrength = (stockReturn - marketReturn) * 100
rsValid = relativeStrength >= rsThreshold
// 3. 成交量放大条件
volumeAvg = ta.sma(volume, 50)
volumeSpike = volume > volumeAvg * volumeMultiplier
// 4. 买入条件:趋势向上 + 相对强度强 + 成交量放大
buyCondition = trendUp and rsValid and volumeSpike
// 5. 卖出条件:趋势向下或触发止盈止损
var float entryPrice = na
var bool positionActive = false
if buyCondition and not positionActive
entryPrice := close
positionActive := true
takeProfitLevel = entryPrice * (1 + profitTargetPct)
stopLossLevel = entryPrice * (1 - stopLossMultiplier * atr / entryPrice)
sellCondition = positionActive and (trendDown or close >= takeProfitLevel or close <= stopLossLevel)
// ===== 可视化 =====
// 绘制趋势线
plot(ta.sma(close, trendLength), color=color.blue, title="趋势线")
// 绘制相对强度
hline(rsThreshold, "RS阈值", color=color.orange)
plot(relativeStrength, color=color.purple, title="相对强度")
// 绘制买卖信号
plotshape(series=buyCondition, title="买入信号", location=location.belowbar,
color=color.green, style=shape.labelup, text="买入",
textcolor=color.white, size=size.normal)
plotshape(series=sellCondition, title="卖出信号", location=location.abovebar,
color=color.red, style=shape.labeldown, text="卖出",
textcolor=color.white, size=size.normal)
// ===== 警报 =====
alertcondition(buyCondition, title="买入信号",
message="趋势向上 + 相对强度强 + 成交量放大")
alertcondition(sellCondition, title="卖出信号",
message="趋势向下或触发止盈止损")
Eshal Bollinger HLC3Indikator SAHAM INDONESIA
Untuk Swing Trading.
Gunakan Dengan TIME Frame Weekly dan daily untuk menhgambil keputusan
BB% Crossing Bollinger Bands AlertsThis script focuses exclusively on the behavior of the BB% indicator. It signals a SELL alert when the BB% value crosses upward through 1.0 (meaning it has breached the top Bollinger Band) and a BUY alert when the BB% crosses downward through 0.0 (meaning it has fallen below the bottom Bollinger Band). The script is fully customizable through its inputs and provides clear visual indicators alongside conditions you can use to trigger alerts on TradingView.
VWAP + OBV + MACD Custom Indicator//@version=5
indicator("VWAP + OBV + MACD Custom Indicator", overlay=true)
// 1️⃣ VWAP Calculation
vwap_value = ta.vwap
// 2️⃣ OBV Calculation
obv_value = ta.obv
// 3️⃣ MACD Calculation
= ta.macd(close, 12, 26, 9)
// 🎯 **Buy Signal Conditions**
buy_signal = close > vwap_value and ta.change(obv_value) > 0 and macd_line > signal_line
// 🎯 **Sell Signal Conditions**
sell_signal = close < vwap_value and ta.change(obv_value) < 0 and macd_line < signal_line
// 📊 Plot VWAP
plot(vwap_value, title="VWAP", color=color.blue, linewidth=2)
// ✅ Plot Buy Signal
plotshape(buy_signal, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
// ❌ Plot Sell Signal
plotshape(sell_signal, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")
// 🔔 **Alerts for Buy/Sell Signals**
alertcondition(buy_signal, title="Buy Alert", message="Buy Signal Triggered!")
alertcondition(sell_signal, title="Sell Alert", message="Sell Signal Triggered!")
Beginner-Friendly AI Trade Analysis (1-Hour)My first trade I have no idea what I am doing I do not recommend you using the until I get results
XAUUSD Reversal Indicator (EMA + SND) - Fixed//@version=5
indicator("XAUUSD Reversal Indicator (EMA + SND) - Fixed", overlay=true)
// Exponential Moving Averages
ema50 = ta.ema(close, 50)
ema100 = ta.ema(close, 100)
ema200 = ta.ema(close, 200)
// Store EMA values at confirmed candles to prevent shifting
var float storedEMA50 = na
var float storedEMA100 = na
var float storedEMA200 = na
if bar_index % 1 == 0
storedEMA50 := ema50
storedEMA100 := ema100
storedEMA200 := ema200
// Identify Supply & Demand Zones
lengthSND = 50
demandZone = ta.lowest(low, lengthSND)
supplyZone = ta.highest(high, lengthSND)
// Store SND values at confirmed candles to prevent shifting
var float storedDemand = na
var float storedSupply = na
if bar_index % 1 == 0
storedDemand := demandZone
storedSupply := supplyZone
// Draw Supply & Demand Zones as Bands (Fixed)
plot(storedDemand, title="Demand Zone", color=color.green, linewidth=2, style=plot.style_stepline)
plot(storedSupply, title="Supply Zone", color=color.red, linewidth=2, style=plot.style_stepline)
// Buy Entry: Price Pulls Back to EMA 50 & Demand Zone
buyEntry = ta.crossover(close, storedEMA50) and close > storedDemand and storedEMA50 > storedEMA100 and storedEMA50 > storedEMA200
// Sell Entry: Price Pulls Back to EMA 50 & Supply Zone
sellEntry = ta.crossunder(close, storedEMA50) and close < storedSupply and storedEMA50 < storedEMA100 and storedEMA50 < storedEMA200
// Buy/Sell Entry Arrows
plotshape(series=buyEntry, location=location.belowbar, color=color.green, style=shape.labelup, title="Buy Entry")
plotshape(series=sellEntry, location=location.abovebar, color=color.red, style=shape.labeldown, title="Sell Entry")
// Alerts
alertcondition(buyEntry, title="Buy Entry Signal", message="Buy Entry Detected at Demand Zone")
alertcondition(sellEntry, title="Sell Entry Signal", message="Sell Entry Detected at Supply Zone")
// Background Highlighting (Fixed)
bgcolor(buyEntry ? color.new(color.green, 80) : sellEntry ? color.new(color.red, 80) : na)
// Plot EMAs (Fixed)
plot(storedEMA50, title="EMA 50", color=color.blue, linewidth=2)
plot(storedEMA100, title="EMA 100", color=color.purple, linewidth=2)
plot(storedEMA200, title="EMA 200", color=color.orange, linewidth=2)
4EMA_3826_Manh Luan_VN✅ Giữ nguyên logic hiện tại: Khi có tín hiệu BUY hoặc SELL, prevTrend sẽ cập nhật thành 1 hoặc -1.
✅ Reset prevTrend về 0 khi EMA không theo thứ tự: Nếu emaBuy == false và emaSell == false, nghĩa là các đường EMA không thỏa mãn điều kiện sắp xếp theo trend, prevTrend sẽ trở về 0.
✅ Giữ tính năng hiển thị tín hiệu BUY/SELL đúng với thay đổi của trend.
Giờ bạn có thể thử lại trên TradingView! 🚀
Time Classification# Time Classification Indicator
This indicator displays important time zones on your chart with customizable vertical lines and labels. It helps traders identify key market sessions and potential high-activity periods.
## Features
- **90-Minute Cycle Lines:** Highlights the important NY AM 90-minute cycles (07:53, 08:38, 09:23, 10:08)
- **Session Markers:** Clearly marks important time periods (3-4 AM, 10-11 AM, 2-3 PM)
- **Customizable Appearance:** Adjust colors and line styles for each time marker
- **Time Labels:** Optional time labels that show the exact time of each vertical line
- **Flexible Configuration:** Enable/disable different time lines based on your trading strategy
## How to Use
1. Add the indicator to your chart
2. Customize the colors and styles to match your chart theme
3. Use the time markers to identify potential market turning points or high-volatility periods
4. Adjust label settings for optimal visibility on your particular chart setup
The indicator uses your chart's timezone setting to ensure times are displayed correctly for your location.
## Trading Applications
- Identify potential reversal points that align with time-based market structures
- Plan entries and exits around known high-volatility periods
- Combine with price action strategies for enhanced trading decisions
- Track intraday cycles that may influence market movements
Perfect for day traders and swing traders who incorporate time-based analysis into their trading strategy.
[GrandAlgo] ATR Trend MatrixThe ATR Trend Matrix is a dynamic trendline indicator designed to help traders visualize market structure using ATR-based trend projections. This tool adapts to price action and highlights potential support and resistance zones based on Average True Range (ATR) calculations.
Key Features
ATR-Based Trendlines – Calculates and plots dynamic trendlines using an adjustable ATR factor.
Multi-Level Matrix System – Provides up to four matrix levels, each customizable with different ATR multipliers.
Swing High & Low Detection – Automatically detects market pivots to serve as anchor points for trendlines.
Adjustable Trend Length – Fine-tune the sensitivity of trendlines using the Swing Length and Trend-Line Length Multiplier.
Auto-Adjustment Mode – When enabled, trendlines update dynamically as ATR evolves.
Buy & Sell Signals – Marks potential trade setups when price crosses below or above Matrix Level 1.
How It Works
Detects Swing Points – Identifies key highs and lows in the market using the length setting.
Plots ATR-Based Trendlines – Calculates trendlines using ATR with user-defined multipliers for four matrix levels.
Adjusts Dynamically – If Auto Adjust is enabled, trendlines shift with ATR movements.
Identifies Trade Signals – Highlights potential buy/sell zones when price interacts with Matrix Level 1 trendlines.
Manages Active Trendlines – Automatically updates and removes trendlines based on price interaction.
User Settings
General Settings
ATR Factor – Controls the ATR multiplier for trendline calculation.
Swing Length – Defines the number of bars for swing high/low detection.
Trend-Line Length Multiplier – Adjusts the extension length of trendlines.
Auto Adjust Trendlines – Enables real-time adjustment of trendlines as ATR changes.
Matrix Settings
Matrix Level 1-4 – Enable or disable individual trendline levels.
Matrix Factors – Customize the ATR multipliers for each matrix level.
Trading Applications
Trend Confirmation – Use the primary trendline and matrix levels to gauge trend strength.
Support & Resistance Zones – ATR-based trendlines can act as dynamic support/resistance.
Breakout & Rejection Signals – Identify potential breakouts or reversals when price interacts with matrix levels.
Volatility-Based Trading – ATR helps adjust trendlines based on market volatility.
The ATR Trend Matrix is a powerful tool for traders who want a dynamic, adaptive trendline system that reacts to market structure and volatility. With customizable settings, multi-level ATR projections, and trade signal detection, this indicator provides a comprehensive approach to price action analysis.
Price Action Strategy with 9, 15, 50 EMAs and VWAPPrice Action Strategy with 9, 15, 50 EMAs and VWAP
Ultimate Buy Sell Signal with Stoploss at Candle High/LowUltimate Buy Sell Signal with Stoploss at Candle High/Low
Gold shalyDescription générale :
L'indicateur vise à offrir des signaux d'achat et de vente basés sur une combinaison d'indicateurs techniques populaires, tout en fournissant des informations supplémentaires comme les lignes de tendance, les niveaux de support et de résistance. L'objectif est de réduire le nombre de trades tout en augmentant la précision des points d'entrée et de sortie.
Composants de l'indicateur :
RSI (Relative Strength Index) :
Le RSI est utilisé pour identifier les conditions de surachat et de survente du marché.
Un signal d'achat est généré lorsque le RSI atteint un plus bas sur les 10 dernières périodes, suggérant une zone de survente. Cela signifie que le marché pourrait être sur le point de rebondir.
Un signal de vente est généré lorsque le RSI atteint un plus haut sur les 10 dernières périodes, indiquant une zone de surachat. Cela signifie que le marché pourrait être sur le point de corriger ou de revenir en arrière.
Lignes de tendance :
Les lignes de tendance sont tracées automatiquement en fonction des moyennes mobiles exponentielles (EMA) 100 et 200 périodes. Ces lignes de tendance montrent la direction générale du marché.
Si l'EMA 100 est au-dessus de l'EMA 200, une tendance haussière est indiquée, et une ligne de tendance haussière (verte) est tracée.
Si l'EMA 100 est en dessous de l'EMA 200, une tendance baissière est indiquée, et une ligne de tendance baissière (rouge) est tracée.
Support et Résistance (1H et 30min) :
Les niveaux de support et de résistance sont calculés en fonction des plus hauts et des plus bas des 60 dernières périodes sur les graphiques 1H et 30min.
Ces niveaux sont essentiels pour identifier les zones où le prix pourrait rebondir ou rencontrer une forte pression.
Les lignes de support (en vert) et de résistance (en rouge) sont tracées pour visualiser ces zones critiques.
Signaux d'achat et de vente :
Signal d'achat : Lorsque le RSI atteint son point le plus bas (indiquant une survente) et que les conditions du marché montrent une possibilité de retournement à la hausse.
Signal de vente : Lorsque le RSI atteint son point le plus haut (indiquant un surachat) et que les conditions du marché montrent une possibilité de retournement à la baisse.
Ces signaux sont affichés sous forme de labels sur le graphique, avec des flèches vertes pour l'achat et des flèches rouges pour la vente.
ATR (Average True Range) :
Le ATR est utilisé pour déterminer la volatilité du marché et calculer les niveaux de stop-loss et de take-profit.
Le stop-loss est placé à un certain multiple de l'ATR en dessous du prix d'entrée, et le take-profit est placé à un certain multiple de l'ATR au-dessus du prix d'entrée. Cela permet de définir des niveaux de gestion du risque basés sur la volatilité du marché.
Fonctionnement de l'indicateur :
Lorsque le RSI est faible (survente) et qu'il atteint un plus bas sur les dernières périodes (en fonction de la période définie, ici 10 périodes), cela génère un signal d'achat.
Lorsque le RSI est élevé (surachat) et atteint un plus haut, cela génère un signal de vente.
Les lignes de tendance sont tracées automatiquement en fonction des EMA, indiquant la direction du marché à court terme et fournissant un contexte supplémentaire pour les décisions de trading.
Les niveaux de support et de résistance sont affichés pour les périodes de 1 heure et 30 minutes, afin d'identifier les zones clés où les prix pourraient rebondir ou inverser leur direction.
Des alertes sont disponibles pour informer l'utilisateur des signaux d'achat et de vente.
Objectif de la stratégie :
Cette stratégie cherche à réduire le nombre de trades tout en augmentant leur précision. En se basant sur des points de surachat et de survente via le RSI, et en combinant cela avec des lignes de tendance et des niveaux de support/résistance, l'indicateur permet de prendre des décisions de trading plus éclairées et de mieux gérer les risques grâce à l'utilisation de l'ATR pour définir des stop-loss et take-profit.
Cela permet une approche plus structurée et moins impulsive, avec un meilleur timing pour les entrées et sorties de marché.