Optimized Smart Money Concept for BTCUSDThis indicator is designed to detect breakouts based on a simplified version of the Smart Money Concept (SMC) for BTCUSD and uses risk/reward calculations for trade management. Here's how it works:
1. Input Parameters:
Risk/Reward Ratio: This determines the target profit relative to the stop loss. For BTCUSD, the default is set to a 2:1 ratio (i.e., for every dollar risked, the target profit is two dollars).
Lookback Period for Swing High/Low: This is the number of bars used to look back to identify the highest high and lowest low, which help in determining the stop-loss levels. A larger lookback is used to account for BTCUSD's volatility.
2. Breakout Pattern:
Bullish Breakout Condition:
The first candle (index 2) is bearish (close < open).
The second candle (index 1) is bullish (close > open).
The third candle is also bullish (close > open), and it closes higher than the second candle.
Bearish Breakout Condition:
The first candle (index 2) is bullish (close > open).
The second candle (index 1) is bearish (close < open).
The third candle is also bearish (close < open), and it closes lower than the second candle.
3. Swing Points for Stop Loss:
Lowest Low (Long Stop Loss): The lowest low over the defined lookback period.
Highest High (Short Stop Loss): The highest high over the defined lookback period.
4. Stop Loss and Take Profit Calculation:
For Long (Buy) Trades:
Stop Loss is placed at the lowest low over the lookback period.
Take Profit is calculated by adding the difference between the entry price (current close) and the stop loss, multiplied by the risk/reward ratio (e.g., 2:1).
For Short (Sell) Trades:
Stop Loss is placed at the highest high over the lookback period.
Take Profit is calculated by subtracting the difference between the entry price and the stop loss, multiplied by the risk/reward ratio.
5. Conditions for Buy and Sell:
A buy condition is triggered when the bullish breakout pattern occurs.
A sell condition is triggered when the bearish breakout pattern occurs.
6. Plotting Buy/Sell Signals:
When a long (buy) condition is met, a label is placed below the candlestick with the entry price, take-profit (TP), and stop-loss (SL) levels. A line is drawn connecting the label to the low of the candlestick.
When a short (sell) condition is met, a label is placed above the candlestick with the entry price, TP, and SL levels. A line is drawn connecting the label to the high of the candlestick.
7. Breakout Debugging:
The indicator uses plotshape() to visually mark where bullish and bearish breakout patterns are detected on the chart with green (bullish) and red (bearish) shapes, respectively.
In Summary:
The indicator looks for specific bullish and bearish breakout patterns, calculates the stop-loss and take-profit levels based on swing points and a risk/reward ratio, and then plots buy/sell labels on the chart with the corresponding entry, TP, and SL values. It also provides a visual marker for each breakout pattern detected for debugging or confirmation purposes.
Candlestick analysis
Three Bar Reversal & Pattern Signals with TP, SL This indicator identifies a "Three Bar Reversal" pattern and provides buy/sell signals along with stop-loss (SL), take-profit (TP), and entry prices based on mean reversion. Here’s a breakdown of how it works:
Inputs:
Text Size: The user can choose the size of the label text displayed on the chart, with options like tiny, small, normal, large, and huge.
Buy/Sell Label Colors: Users can set the colors for the buy and sell labels.
Buy/Sell Text Colors: The user can set the text color for the buy and sell labels.
Identifying Reversal Patterns:
Bullish Reversal: The indicator looks for a bullish reversal pattern where:
The first bar (index 2) is bullish (close > open).
The second bar (index 1) has a low price lower than the first bar.
The close of the current bar is higher than the high of the second bar.
Bearish Reversal: A bearish reversal is identified when:
The first bar (index 2) is bearish (close < open).
The second bar (index 1) has a high price higher than the first bar.
The close of the current bar is lower than the low of the second bar.
Mean Reversion (SMA) Calculation:
The script calculates a 20-period simple moving average (SMA) of the close prices (mean_price), which is used as a reference for setting stop-loss and take-profit levels.
Risk to Reward Ratio (1:1.5):
The risk-to-reward ratio is set at 1.5:1. This means the take-profit target is 1.5 times the distance from the entry price to the stop-loss.
Stop-Loss and Take-Profit Calculation:
Buy Signal:
Stop-Loss is placed 1% below the mean price.
Take-Profit is calculated based on the risk-to-reward ratio from the entry price.
Sell Signal:
Stop-Loss is placed 1% above the mean price.
Take-Profit is calculated similarly based on the risk-to-reward ratio.
Creating Labels:
When a bullish or bearish reversal pattern is detected:
A label is drawn on the chart showing the entry price, TP, and SL for the trade.
Alerts are triggered when a buy or sell signal is detected, displaying the relevant entry, TP, and SL levels.
Line Drawing:
A blue line is drawn at the low price of the reversal pattern to visually represent the reversal point.
In summary, the indicator combines a reversal pattern detection (Three Bar Reversal) with mean reversion, setting stop-loss and take-profit levels based on the 20-period moving average and a defined risk-to-reward ratio. Labels with the trade details (entry, TP, SL) are plotted, and alerts are triggered whenever a reversal pattern is identified.
4H Swing Trade EMA Trend StrategyThe XAUUSD EMA Trend Strategy indicator is designed to identify market trends and provide buy and sell signals for XAUUSD (gold) based on Exponential Moving Averages (EMAs) and candlestick analysis. Here's how it works, broken down:
1. EMA Setup
Exponential Moving Averages (EMAs) are used to help determine the market trend.
Blue EMA: Calculated using the high prices with a length of 20 periods (emaHigh).
Yellow EMA: Calculated using the low prices with a length of 20 periods (emaLow).
Both EMAs are plotted on the chart in blue (for the high-based EMA) and yellow (for the low-based EMA).
2. Trend Detection
The trend is determined based on the position of the current price relative to the EMAs:
Uptrend: When the closing price is above the blue EMA (high-based EMA).
Downtrend: When the closing price is below the yellow EMA (low-based EMA).
Sideways Trend: If neither the uptrend nor downtrend conditions are met, the market is considered sideways.
3. Buy and Sell Signal Conditions
Buy Signal:
The market is in an uptrend (price is above the blue EMA).
The close price is above the blue EMA, and the candlestick body (close > open) closes above the blue EMA.
Sell Signal:
The market is in a downtrend (price is below the yellow EMA).
The close price is below the yellow EMA, and the candlestick body (close < open) closes below the yellow EMA.
No Signal in Sideways Market: The strategy avoids generating buy or sell signals when the market is in a sideways trend.
4. Stop Loss (SL) and Take Profit (TP) Calculation
Risk-to-Reward Ratio: A ratio of 1.5 is used for setting the take profit (TP) and stop loss (SL).
For Buy Signals:
The stop loss (SL) is set at the previous swing low.
The take profit (TP) is calculated as the entry price plus 1.5 times the distance between the entry price and the previous swing low.
For Sell Signals:
The stop loss (SL) is set at the previous swing high.
The take profit (TP) is calculated as the entry price minus 1.5 times the distance between the entry price and the previous swing high.
5. Signal Labels
Buy and Sell Labels:
When a buy or sell signal is triggered, a label is displayed on the chart, either below or above the candlestick:
Buy label appears below the candlestick with the corresponding stop loss (SL) and take profit (TP) values.
Sell label appears above the candlestick with the corresponding stop loss (SL) and take profit (TP) values.
A line is drawn between the candlestick and the label for clarity.
6. Trend Table
A table is displayed in the upper-right corner of the chart showing the current market trend:
Uptrend: When the price is above the blue EMA.
Downtrend: When the price is below the yellow EMA.
Sideways: When neither of the above conditions are met.
7. Shape Plotting
Buy Signal Shape: A green label is plotted below the candlestick for a buy signal.
Sell Signal Shape: A red label is plotted above the candlestick for a sell signal.
Summary of How the Strategy Works:
Trend Identification: The strategy uses two EMAs (one based on the highs, and the other based on the lows) to identify whether the market is in an uptrend, downtrend, or sideways.
Entry Signals: Buy and sell signals are generated based on the price's position relative to the EMAs and the candlestick's closing price.
SL/TP Calculation: A risk-to-reward ratio of 1:1.5 is applied, with SL and TP set based on previous swings.
Trend Table: The strategy displays the current trend in the upper-right corner for easy tracking.
This setup allows you to track and trade trends effectively on XAUUSD with clear signals and a risk management strategy built-in.
Naive Bayes Candlestick Pattern Classifier v1.1 BETAAn intermezzo on why i made this script publication..
A : Candlestick Pattern took hours to backtest, why not using Machine Learning techniques?
B : Machine Learning, no that's gonna be really heavy bro!
A : Not really, because we use Naive Bayes.
B : The simplest, yet powerful machine learning algorithm to separate (a.k.a classify) multivariate data.
----------------------------------------------------------------------------------------------------------------------
Hello, everyone!
After deep research in extracting meaningful information from the market, I ended up building this powerful machine learning indicator based on the evolution of Bayesian Statistics. This indicator not only leverages the simplicity of Naive Bayes but also extends its application to candlestick pattern analysis, making it an invaluable tool for traders who are looking to enhance their technical analysis without spending countless hours manually backtesting each pattern on each market!.
What most interesting part is actually after learning all of likely useless methods like fibonacci, supply and demand, volume profile, etc. We always ended up back to basic like support and resistance and candlestick patterns, but with a slight twist on strategy algorithm design and statistical approach. Thus, the only reason why i made this, because i exactly know that you guys will ended up in this position as time goes by.
The essence of this indicator lies in its ability to automate the recognition and statistical evaluation of various candlestick patterns. Traditionally, traders have relied on visual inspection and manual backtesting to determine the effectiveness of patterns like Bullish Engulfing, Bearish Engulfing, Harami variations, Hammer formations, and even more complex multi-candle patterns such as Three White Soldiers, Three Black Crows, Dark Cloud Cover, and Piercing Pattern. However, these conventional methods are both time-consuming and prone to subjective bias.
To address these challenges, I employed Naive Bayes—a probabilistic classifier that, despite its simplicity, offers robust performance in various domains. Naive Bayes assumes that each feature is independent of the others given the class label, which, although a strong assumption, works remarkably well in practice, especially when the dataset is large like market data and the feature space is high-dimensional. In our case, each candlestick pattern acts as a feature that can be statistically evaluated based on its historical performance. The indicator calculates a probability that a given pattern will lead to a price reversal, by comparing the pattern’s close price to the highest or lowest price achieved in a lookahead window.
One of the standout features of this script is its flexibility. Each candlestick pattern is not only coded into the system but also comes with individual toggles to enable or disable them based on your trading strategy. This means you can choose to focus on single-candle patterns like Bullish Engulfing or more complex multi-candle formations such as Three White Soldiers, without modifying the core code. The built-in customization options allow you to adjust colors and labels for each pattern, giving you the freedom to tailor the visual output to your preference. This level of customization ensures that the indicator integrates seamlessly into your existing TradingView setup.
Moreover, the indicator isn’t just about pattern recognition—it also incorporates outcome-based learning. Every time a pattern is detected, it looks ahead a predefined number of bars to evaluate if the expected reversal actually materialized. This outcome is then stored in arrays, and over time, the script dynamically calculates the probability of success for each pattern. These probabilities are presented in a real-time updating table on your chart, which shows not only the percentage probability but also the count of historical occurrences. With this information at your fingertips, you can quickly gauge the reliability of each pattern in your chosen market and timeframe.
Another significant advantage of this approach is its speed and efficiency. While more complex machine learning models like neural networks might require heavy computational resources and longer training times, the Naive Bayes classifier in this script is lightweight, instantaneous and can be updated on the fly with each new bar. This real-time capability is essential for modern traders who need to make quick decisions in fast-paced markets.
Furthermore, by automating the process of backtesting, the indicator frees up your time to focus on other aspects of trading strategy development. Instead of manually analyzing hundreds or even thousands of candles, you can rely on the statistical power of Naive Bayes to provide you with insights on which patterns are most likely to result in profitable moves. This not only enhances your efficiency but also helps to eliminate the cognitive biases that often plague manual analysis.
In summary, this indicator represents a fusion of traditional candlestick analysis with modern machine learning techniques. It harnesses the simplicity and effectiveness of Naive Bayes to deliver a dynamic, real-time evaluation of various candlestick patterns. Whether you are a seasoned trader looking to refine your technical analysis or a beginner eager to understand market dynamics, this tool offers a powerful, customizable, and efficient solution. Welcome to a new era where advanced statistical methods meet practical trading insights—happy trading and may your patterns always be in your favor!
Note : On this current released beta version, you must manually adjust reversal percentage move based on each market. Further updates may include automated best range detection and probability.
Bollinger Band Breakout Signals **Bollinger Band Breakout Signals – Buy & Sell Alerts**
🚀 **Overview:**
This **Pine Script** generates **buy and sell signals** based on Bollinger Band breakouts. When the price crosses **below the lower Bollinger Band**, it triggers a **BUY signal** 📈. When the price crosses **above the upper Bollinger Band**, it triggers a **SELL signal** 📉.
🔔 **Key Features:**
✅ **Clear Buy & Sell Signals** – Visual markers on the chart for easy trading decisions.
✅ **Automatic Alerts** – Get notified instantly when breakouts occur.
✅ **Customizable Bollinger Bands** – Uses a 20-period moving average with 2 standard deviations (default settings).
✅ **Works on Any Market** – Use it on **stocks, crypto, forex, or commodities**.
📊 **How It Works:**
- **BUY Alert**: When price crosses **below** the lower Bollinger Band.
- **SELL Alert**: When price crosses **above** the upper Bollinger Band.
- Green **BUY arrows** appear below bars for buy signals.
- Red **SELL arrows** appear above bars for sell signals.
⚙️ **How to Set Up Alerts:**
1️⃣ Add the script to your TradingView chart.
2️⃣ Click the **Alerts (🔔) button** and select `"Bollinger Band Breakout Signals"`.
3️⃣ Choose **"Any alert function call"** to enable alerts.
4️⃣ Select your **preferred notification method** (popup, email, SMS, or webhook).
📢 **Perfect for traders looking to capitalize on momentum breakouts with precision!** 💰🔥
#TradingView #BollingerBands #BreakoutTrading #BuySellSignals #Crypto #Forex #Stocks
[EmreKb] Pinbar AnalysisDescription
The Pinbar Analyzer tool will count how many ltf candles are inside the wick and the total volume inside the wick.
How it works?
Calculate candle count of inside wick and volumes. Than display like below image
T/iW: Total Candle / Total inside Wick
ROiW: Rate of inside wick candle count
TV/WV: Total volume / Wick volume
NR7 Highlight (Day Timeframe Only) by rsavalagiNr7 Highlight by rsavalagi works in Daily time frame only
BullDozz MA-CandlesticksBullDozz MA-Candlesticks 🏗️📊
The BullDozz MA-Candlesticks indicator transforms traditional candlesticks by replacing their Open, High, Low, and Close values with various types of Moving Averages (MAs). This helps traders visualize market trends with smoother price action, reducing noise and enhancing decision-making.
🔹 Features:
✅ Choose from multiple MA types: SMA, EMA, WMA, DEMA, TEMA, LSMA
✅ Customizable MA period for flexibility
✅ Candlestick colors based on trend: Green for bullish, Red for bearish
✅ Works on any market and timeframe
This indicator is perfect for traders who want a clearer perspective on price movement using moving average-based candlesticks. 🚀 Try it now and refine your market analysis! 📈🔥
Bollinger Bands with EMA & SMA Bollinger Bands with customizable moving averages (SMA, EMA) and additional Exponential (EMA) & Simple Moving Averages (SMA) for trend analysis. It calculates Bollinger Bands using a user-defined moving average and standard deviation multiplier. The script also overlays 8, 13, 21, and 55-day EMAs and 50, 100, and 200-day SMAs
Custom MA Crossover (1-10min)//@version=5
indicator("Custom MA Crossover (1-10min)", overlay=true, shorttitle="CMA Cross 1-10min")
// Inputs
fast_length = input.int(5, title="Fast MA Length", minval=1) // Adjusted for shorter timeframes
slow_length = input.int(14, title="Slow MA Length", minval=1) // Adjusted for shorter timeframes
ma_type = input.string(title="MA Type", options= , defval="EMA")
use_timeframe_filter = input.bool(true, title="Restrict to 1-10min Timeframes?")
volume_filter = input.bool(true, title="Use Volume Filter?")
min_volume = input.float(1.5, title="Minimum Volume Multiplier", step=0.1) // Filter for higher volume candles
// Timeframe Check
is_allowed_timeframe = (timeframe.isminutes and timeframe.multiplier >= 1 and timeframe.multiplier <= 10) or not use_timeframe_filter
// Calculations
fast_ma = ma_type == "SMA" ? ta.sma(close, fast_length) : ta.ema(close, fast_length)
slow_ma = ma_type == "SMA" ? ta.sma(close, slow_length) : ta.ema(close, slow_length)
// Volume Filter
volume_avg = ta.sma(volume, 20) // 20-period average volume
is_high_volume = volume >= volume_avg * min_volume
// Crossover signals with filters
bullish = ta.crossover(fast_ma, slow_ma) and is_allowed_timeframe and (not volume_filter or is_high_volume)
bearish = ta.crossunder(fast_ma, slow_ma) and is_allowed_timeframe and (not volume_filter or is_high_volume)
// Plotting
plot(fast_ma, color=color.new(color.blue, 0), title="Fast MA")
plot(slow_ma, color=color.new(color.red, 0), title="Slow MA")
// Plot signals
plotshape(bullish, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Bullish Signal")
plotshape(bearish, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Bearish Signal")
// Alerts
alertcondition(bullish, title="Bullish Crossover", message="Fast MA crossed above Slow MA on a 1-10min chart")
alertcondition(bearish, title="Bearish Crossover", message="Fast MA crossed below Slow MA on a 1-10min chart")
[EmreKb] MTF FTRDescription
Multi time frame version of "Failed to Return by EmreKb" indicator.
What is FTR?
There is no definitive, fixed perspective on FTR. Some sources may choose the FTR zone differently. I will use the single bearish candle in an uptrend (or the single bullish candle in a downtrend) as the FTR in this indicator.
Settings
Update Last: Number of how many boxes will be updated in the new candle
Timeframes: Presets for timeframe option
Use Custom: For use custom timeframes
Custom Timeframes: Text area for write custom timeframes without space and separate with comma.
Last NR7 Highlight (Day Timeframe Only)This Indicator identifies and highlights the recent instances of NR7 (Narrowest Range 7) candles on your chart. NR7 candles are significant because they represent periods of consolidation, often preceding strong breakouts or trend reversals. The script makes it easy to spot these critical candles with clear visual cues, helping traders make informed decisions.
BODY WICK OF HIGHER TIME CANDLEDenotes the level of open and close of the body of the candle formed on a higher timeframe between the red and green dots with the line as the body, above the green is the upper shadow, and below the red is the lower shadow.
Fibonacci Reversal FinderPurpose of the indicator
This indicator is designed to identify potential reversal points on a price chart using Fibonacci retracement levels combined with price action confirmation. It generates buy and sell signals based on retracement levels and price action patterns, providing entry points along with stop-loss (SL) and take-profit (TP) targets.
How It Works
1. Input Settings for Fibonacci Levels
The script allows the user to input Fibonacci retracement levels (default: 0.618 and 0.786).
These levels are extracted from a string and converted into an array for later calculations.
2. Convert String to Fibonacci Retracement Values
The script retrieves the two selected Fibonacci levels and ensures they are correctly converted to float values.
3. Detect Swing High and Swing Low
Identifies swing high and swing low over the past 20 bars.
These values serve as reference points for Fibonacci retracement calculations.
4. Calculate Fibonacci Retracement Levels
Computes retracement levels based on swing high/low and the selected Fibonacci ratios.
5. Price Action Confirmation (Optional)
The indicator checks for bullish engulfing and bearish engulfing candlestick patterns as an additional confirmation method.
6. Define Buy & Sell Conditions
Buy Signal: If price touches the Fibonacci support levels AND (optionally) a bullish engulfing pattern appears.
Sell Signal: If price reaches the Fibonacci resistance levels AND (optionally) a bearish engulfing pattern appears.
7. Calculate Stop-Loss (SL) and Take-Profit (TP)
SL (Stop Loss): For buy trades, the SL is set to the previous swing low; for sell trades, it's set to the previous swing high.
TP (Take Profit): Uses a 1:2 risk-reward ratio.
8. Improve Label Visibility
Adds an offset to move labels away from the candlestick, improving visibility.
9. Plot Buy/Sell Labels & Connecting Lines
Labels: Display buy/sell signals, entry price, SL, and TP.
Lines: Draw dotted connectors from the candlestick to the label for better clarity.
What This Indicator Can Do
✅ Identifies Reversal Points using Fibonacci retracements (0.618 & 0.786)
✅ Confirms Reversals with bullish/bearish engulfing candlestick patterns (optional)
✅ Plots Buy/Sell Labels with entry price, SL, and TP values
✅ Draws Lines connecting labels to the candlestick for visibility
✅ Uses a 1:2 Risk-Reward Ratio to determine Take-Profit levels
How to Use This Indicator
Add the Indicator to your TradingView chart.
Look for Buy/Sell Labels:
Buy when price retraces to Fibonacci support and a bullish engulfing pattern appears.
Sell when price retraces to Fibonacci resistance and a bearish engulfing pattern appears.
Use the Stop-Loss (SL) & Take-Profit (TP) from the label to manage your trade.
Combine with Other Indicators (e.g., RSI, MACD) for additional confirmation.
Combined Indicator (Session, 3EMAs, Engulfing Candles)The Indicator combines session highlights, EMA indicators, and engulfing candle detection. It visually marks major forex sessions with background colors, plots three EMAs (9, 21, 50), and identifies bullish/bearish engulfing candles with alerts. Perfect for trend analysis and session-based trading insights!
Features:
✅ Session Highlights: Marks major forex sessions (London, New York, Tokyo, Sydney) with transparent background colors for easy visualization.
✅ EMA Indicators: Plots three Exponential Moving Averages (EMAs) (9, 21, 50) to help identify trends and potential reversals.
✅ Engulfing Candle Detection: Detects bullish and bearish engulfing patterns, plotting visual markers (triangles) on the chart.
✅ Alerts: Triggers notifications when an engulfing pattern appears, helping traders act quickly.
This script is ideal for traders who want to analyze trends, spot key price action patterns, and navigate different market sessions effectively!
Pin Bar Detector (open)The Pin Bar Detector script is designed to identify and highlight pin bars (reversal candles) on a price chart. It scans for bullish and bearish pin bars based on wick-to-body ratio, candle size, and price structure.
🔹 Features & How It Works
✅ Detects Both Bullish & Bearish Pin Bars
Bullish Pin Bar (Hammer): Long lower wick, small body near the top, and little to no upper wick.
Bearish Pin Bar (Shooting Star): Long upper wick, small body near the bottom, and little to no lower wick.
✅ Wick-to-Body Ratio Calculation
The wick must be at least 2x the size of the body to be considered a valid pin bar.
The script dynamically checks if the upper or lower wick dominates the candle to classify it.
✅ Key Level Filtering (Optional)
The script can be modified to only detect pin bars at VWAP, 50 EMA, Support/Resistance, or First 15-Min High/Low for stronger trade signals.
✅ Customizable Inputs
Users can adjust the minimum wick-to-body ratio to refine detection.
Option to show/hide pin bars that form in choppy or sideways markets.
✅ Pin Bar Confirmation (Optional)
Can include a volume filter to detect pin bars with significant market participation.
Can add ATR confirmation to check if the pin bar forms during high volatility periods.
🔹 How to Use It in Your Trading
1️⃣ Enable the script on your chart to automatically highlight pin bars.
2️⃣ Wait for confirmation (volume spike or key level rejection) before entering a trade.
3️⃣ Use stop-loss below/above the pin bar wick to control risk.
4️⃣ Target key resistance/support levels for take-profit.
🔹 Final Thoughts
Pin bars are powerful reversal signals, but they work best at strong support/resistance zones with volume confirmation.
This script helps eliminate false pin bars by ensuring the wick-to-body ratio is valid.
Can be combined with VWAP, 50 EMA, and ATR to create a high-probability trading system.
Bullish Engulfing with 150% Height//@version=5
indicator("Bullish Engulfing with 150% Height", overlay=true)
// Definisikan candle sebelumnya
previous_candle = close
previous_high = high
previous_low = low
previous_open = open
// Definisikan kondisi Bullish Engulfing
bullish_engulfing = close > open and close < open and close > open and open < close
// Definisikan kriteria tinggi candle sebelumnya lebih dari 150% dari tinggi candle sebelumnya
candle_height_criteria = (previous_high - previous_low) > 1.5 * (high - low )
// Gabungkan kedua kondisi
condition = bullish_engulfing and candle_height_criteria
// Plot sinyal pada chart
plotshape(condition, style=shape.labelup, location=location.belowbar, color=color.green, text="Bullish Engulfing", size=size.small)
Anchored VWAP- STKThis Pine Script (version 5) calculates and plots an **Anchored Volume Weighted Average Price (VWAP)** along with its **standard deviation bands** on a trading chart. The VWAP helps traders identify the average price of an asset, weighted by volume, starting from a specific date chosen by the user.
### Key Components:
1. **Indicator Setup:**
The script is set as an overlay indicator, meaning it will be displayed directly on the price chart.
2. **User Inputs:**
- **VWAP Start Date:** Allows the user to select the date from which the VWAP calculation should begin (default is January 1, 2022).
- **VWAP Data Source:** Users can choose which price data to use for the calculation (default is `hlc3`, which is the average of the high, low, and close prices).
3. **VWAP Calculation:**
- The script keeps track of the cumulative sum of (price × volume) and the cumulative volume starting from the selected date.
- The VWAP is calculated as:
\
4. **Standard Deviation Calculation:**
- The script calculates the variance using the formula:
\
This ensures the variance is not negative.
- The standard deviation is then derived by taking the square root of the variance.
5. **Plotting:**
- **VWAP Line:** Displayed in blue.
- **Upper Band:** Plotted in orange, representing VWAP + standard deviation.
- **Lower Band:** Also in orange, representing VWAP - standard deviation.
### Purpose:
This indicator helps traders analyze price movements relative to the VWAP, providing insights into potential support/resistance levels. The standard deviation bands help identify overbought or oversold conditions based on price volatility.
B!!7 wtf dp want itis not midne am dtired cant spellIf I rejected or deleted your annotation, it’s nothing personal. Just doing my job and keeping up with the current Genius standards. Please do not send me angry messages, demanding to know why your annotation was deleted, otherwise, you will be ignored and action may be taken on your account. Send me a constructive and calm message, then we can talk.