Anchored VWAP with Buy/Sell SignalsAnchored VWAP Calculation:
The script calculates the AVWAP starting from a user-defined anchor point (anchor_date).
The AVWAP is calculated using the formula:
AVWAP
=
∑
(
Volume
×
Average Price
)
∑
Volume
AVWAP=
∑Volume
∑(Volume×Average Price)
where the average price is
(
h
i
g
h
+
l
o
w
+
c
l
o
s
e
)
/
3
(high+low+close)/3.
Buy Signal:
A buy signal is generated when the price closes above the AVWAP (ta.crossover(close, avwap)).
Sell Signal:
A sell signal is generated when the price closes below the AVWAP (ta.crossunder(close, avwap)).
Plotting:
The AVWAP is plotted on the chart.
Buy and sell signals are displayed as labels on the chart.
Background Highlighting:
The background is highlighted in green for buy signals and red for sell signals (optional).
Analisis Tren
Support and Resistance with Buy/Sell SignalsSwing Highs and Lows:
The script identifies swing highs and lows using the ta.highest and ta.lowest functions over a user-defined swing_length period.
Swing highs are treated as resistance levels.
Swing lows are treated as support levels.
Buy Signal:
A buy signal is generated when the price closes above the resistance level (ta.crossover(close, swing_high)).
Sell Signal:
A sell signal is generated when the price closes below the support level (ta.crossunder(close, swing_low)).
Plotting:
Support and resistance levels are plotted on the chart.
Buy and sell signals are displayed as labels on the chart.
Background Highlighting:
The background is highlighted in green for buy signals and red for sell signals (optional).
Advanced Trend Strength Indicator✅ Features & Fixes
✔ EMA 21 & EMA 50-Based Trend Direction
✔ Adaptive Background Highlighting:
• 🟢 Green (Bullish Trend Zone) – Strong Buy Momentum
• 🔴 Red (Bearish Trend Zone) – Strong Sell Momentum
✔ Buy & Sell Signals (Scalping & Positional Trading)
✔ Normalized Trend Strength (0-100) for Market Confidence
✔ Trend Strength Indicator in a Separate Panel for Clarity
📊 How to Use for Trading
1. Intraday Traders – Use Buy & Sell markers for quick scalps.
2. Positional Traders – Follow EMA Crossovers + RSI Confirmation.
3. Trend Confirmation – Watch for strong RSI & MACD Signals.
4. Check Background – Trade only when a strong trend is detected.
SnR+Candlestick+MSSupport/Resistance Strategy with Candlestick Confirmation, Market Structure, and 1:3 R:R
High-Impact News Events with ALERTHigh-Impact News Events with ALERT
This indicator is builds upon the original by adding alert capabilities, allowing traders to receive notifications before and after economic events to manage risk effectively.
This indicator is updated version of the Live Economic Calendar by @toodegrees ( ) which allows user to set alert for the news events.
Key Features
Customizable Alert Selection: Users can choose which impact levels to restrict (High, Medium, Low).
User-Defined Restriction Timing: Set alerts to X minutes before or after the event.
Real-Time Economic Event Detection: Fetches live news data from Forex Factory.
Multi-Event Support: Detects and processes multiple news events dynamically.
Automatic Trading Restriction: user can use this script to stop trades in news events.
Visual Markers:
Vertical dashed lines indicate the start and end of restriction periods.
Background color changes during restricted trading times.
Alerts notify traders during the news events.
How It Works
The user selects which news impact levels should restrict trading.
The script retrieves real-time economic event data from Forex Factory.
Trading can be restricted for X minutes before and after each event.
The script highlights restricted periods with a background color.
Alerts notify traders all time during the news events is active as per the defined time to prevent unexpected volatility exposure.
Customization Options
Choose which news impact levels (High, Medium, Low) should trigger trading restrictions.
Define time limits before and after each news event for restriction.
Enable or disable alerts for restricted trading periods.
How to Use
Apply the indicator to any TradingView chart.
Configure the news event impact levels you want to restrict.
Set the pre- and post-event restriction durations as needed.
The indicator will automatically apply restrictions, plot visual markers, and trigger alerts accordingly.
Limitations
This script relies on Forex Factory data and may have occasional update delays.
TradingView does not support external API connections, so data is updated through internal methods.
The indicator does not execute trades automatically; it only provides visual alerts and restriction signals.
Reference & Credit
This script is based on the Live Economic Calendar by @toodegrees ( ), adding enhanced pre- and post-event alerting capabilities to help traders prepare for market-moving news.
Disclaimer
This script is for informational purposes only and does not constitute financial advice. Users should verify economic data independently and exercise caution when trading around news events. Past performance is not indicative of future results.
MTF (multi-timeframe) Moving Average Convergence Divergence MACDI couldn't find a simple but effective multi-timeframe MACD, so I asked ChatGPT.
It works great!
I hope it will be useful to others!
RSI + MACD📈 Features:
✅ RSI (14): Helps identify overbought and oversold conditions.
✅ MACD (12, 26, 9): Shows trend direction and momentum.
✅ Buy & Sell Signals: Uses MACD crossovers and RSI levels to indicate potential entry points.
✅ Zero Line & Overbought/Oversold Levels: Helps traders visualize key support and resistance areas.
📌 How It Works
RSI Interpretation:
RSI above 70 = Overbought (potential price drop).
RSI below 30 = Oversold (potential price rise).
MACD Interpretation:
MACD Line crosses above Signal Line = Bullish (Buy).
MACD Line crosses below Signal Line = Bearish (Sell).
Open Interest (Multiple Exchanges for Crypto)On some cryptocurrencies and exchanges the OI data is nonexistent or deplorable. With this indicator you can see OI data from multiple exchanges (or just the best one) from USD,USDT, or USD+USDT pairs whether you are using a perpetuals chart or not.
Hope you all like it!
SuperIchi Pro – The Ultimate Smart Trading Bot for Bitcoin!The SuperIchi Pro bot takes Ichimoku trading to the next level, blending trend-following precision with powerful trade filters for maximum profitability. Built for TradingView, this automated strategy identifies high-probability trades, dynamically manages risk, and lets your winners run with a cutting-edge trailing stop system.
🔹 Smart Ichimoku Signals – Enter only the strongest trends with confirmed crossovers!
🔹 RSI & Volume Boost – Avoid false breakouts with smart momentum filters.
🔹 ATR-Based Stop & Trailing Stop – Adapt to market volatility & lock in profits!
🔹 Dynamic Position Sizing – Trade with a consistent risk strategy to grow your capital.
🔹 Automation Ready – Get real-time alerts or connect it to a crypto exchange for hands-free trading!
🔥 67% Win Rate | 1:3 Risk-Reward Ratio | Optimized for BTC/USD
Perfect for trend traders, swing traders, and crypto investors looking to automate BTC trading like a pro! 📈💎
💡 Backtest it, tweak it, and trade smarter – because in crypto, the edge matters. 🚀
AUrum Electron LevelsBreakout - Pullback - Retrace, strategy and method
Visual on GOLD ( XAUUSD ) - Look and observe - then decide
The basis of analysis is to determine the Break and Closed prices.
If it is above the +0.2% level, follow the direction of the momentum to take a BUY position with a target objective at the +0.8% level and with a risk target at the -0.2% level
If it is below the -0.2% level, follow the direction of the momentum to take a SELL position with a target objective at the -0.8% level and with a risk target at the +0.2% level
Disclaimer:
Do you own Back/Foward test
Do your own research
New Daily Low with Offset Alert FeatureThis indicator plots the current day’s low as a horizontal line on your chart and provides an optional offset line above it. It’s designed for traders who want to monitor when price is near or breaking below the daily low. You can set alerts based on the built-in alert conditions to be notified whenever the market approaches or crosses below these key levels.
How to Use With Alerts:
1. Add the indicator to your chart and choose a timeframe (e.g., 15 minutes).
2. In the script inputs, enable or adjust the daily low line and any offset percentage if desired.
3. Open the “Alerts” menu in TradingView and select the corresponding alert condition:
• Cross Below Daily Low to detect when price dips below the day’s low.
• Cross Below Daily Low + Offset if you prefer a small cushion above the actual low.
4. Configure the alert’s frequency and notifications to stay updated on potential breakdowns.
This setup helps you catch new lows or near-breakdowns quickly, making it useful for both intraday traders and swing traders watching key support levels.
Ichimoku Trend Change Signals (Optimized for Ranges)📢 Nuovo Indicatore Ichimoku Trend Change Signals (Ottimizzato per Range) 🔥
Questo indicatore, progettato per TradingView e MetaTrader 5, utilizza la strategia Ichimoku per identificare segnali di acquisto e vendita con filtri aggiuntivi per evitare falsi segnali durante le fasi di lateralizzazione del mercato.
💡 Come Funziona:
1. Acquisto: Un segnale BUY viene generato quando il prezzo supera la linea Tenkan-Sen e si trova sopra la Kijun-Sen.
2. Vendita: Un segnale SELL viene generato quando il prezzo scende al di sotto della Tenkan-Sen e si trova sotto la Kijun-Sen.
3. Nuvola Ichimoku: Funziona come supporto/resistenza dinamica e segnala tendenze rialziste o ribassiste a seconda della posizione del prezzo rispetto alla nuvola.
4. Filtri Lateralizzazione: I segnali vengono filtrati per ridurre falsi positivi nelle fasi laterali.
5. Segnali di Inversione: Rilevazione di potenziali inversioni di trend al superamento della nuvola.
👉 Ideale per i trader daily che desiderano una strategia Ichimoku ottimizzata per evitare rumori di mercato e consolidamenti!
SE TI PIACE FAI UNA DONAZIONE PayPal @danieleiacoponi
200MA x3 Investor Tool with Undervaluation LineThis indicator gives a very simple 200 period moving average along with a 3x overvalued line and a -2x undervalued line. These lines have been good predictors of times where crypto will retrace back to its mean.
MT-Trend Zone IdentifierTrend Zone Identifier – A Dynamic Market Trend Mapping Tool
Overview
The Trend Zone Identifier is an advanced TradingView indicator that helps traders visualize different market trend phases. By leveraging Pivot Points, Moving Averages (MA), ADX (Average Directional Index), and Retest Confirmation, this tool identifies uptrend, downtrend, and ranging (sideways) conditions dynamically.
This indicator is designed to segment the market into clear trend zones, allowing traders to distinguish between confirmed trends, trend transitions (pending zones), and ranging markets. It provides an intuitive visual overlay to enhance market structure analysis and assist in decision-making.
Key Features
✔ Trend Zone Identification – Classifies price action into Uptrend (Green), Downtrend (Red), Pending Confirmation (Light Colors), and Sideways Market (Gray/Neutral)
✔ Pivot-Based Breakout & Breakdown Detection – Uses pivot highs/lows to determine trend shifts
✔ Moving Average & ADX Validation – Ensures the trend is backed by MA structure and ADX trend strength
✔ Pullback Confirmation – Allows trend confirmation based on price retesting key levels
✔ Extreme Volatility & Gaps Filtering – Optional ATR-based extreme movement filtering to avoid false signals
✔ Multi-Timeframe Support – Option to integrate higher timeframe trend validation
✔ Customizable Sensitivity – Fine-tune MA smoothing, ADX thresholds, pivot detection, and pullback range
How It Works
1. Trend Classification
• Uptrend (Green): Price is above a key MA, ADX confirms strength, and a pivot breakout occurs
• Downtrend (Red): Price is below a key MA, ADX confirms strength, and a pivot breakdown occurs
• Pending Trend (Light Colors): Initial trend breakout or breakdown is detected but requires further confirmation
• Sideways/Ranging (Gray): ADX signals a weak trend, and price remains within a neutral zone
2. Retest & Confirmation Logic
• A trend is only confirmed after a breakout or breakdown followed by a successful retest
• If the market fails the retest, the indicator resets to a neutral state
3. Custom Filters for Optimization
• Enable or disable volume filtering for confirmation
• Adjust pivot sensitivity to detect major or minor swing points
• Choose to require consecutive bars confirming the breakout/breakdown
Ideal Use Cases
🔹 Swing traders who want to capture trend transitions early
🔹 Trend-following traders who rely on confirmed market cycles
🔹 Range traders looking to identify sideways market zones
🔹 Algorithmic traders who need clean trend segmentation for automated strategies
Final Thoughts
The Trend Zone Identifier is a versatile market structure indicator that helps traders define trend cycles visually and avoid trading against weak trends. By providing clear breakout, breakdown, and retest conditions, it enhances market clarity and reduces decision-making errors.
➡ Add this to your TradingView workspace and start analyzing market trends like a pro! 🚀
Recurring Dotted Vertical LinesI want recurring vertical lines on the 00:00 and 18:00 times throughout the graph
Friday High and Low RangeThe Friday High Low Range Candle Indicator is a custom-built tool used in technical analysis to evaluate the market's weekly volatility and trend strength. This indicator focuses on the high and low price range of the last trading day of the week, typically Friday, to give traders valuable insights into potential market behavior.
Key Features:
Weekly Volatility Insight: The indicator helps traders understand the weekly price range and volatility by highlighting the high and low levels achieved on Fridays. This is particularly useful for swing traders looking for weekly trends.
Trend Strength Measurement: By focusing on the range between the high and low prices on Fridays, the indicator can provide clues about the strength of prevailing trends and potential reversals.
Visual Representation: The indicator visually marks the high and low prices on a candlestick chart, making it easy for traders to spot key levels and make informed decisions.
Customization Options: Traders can customize the appearance and settings of the indicator to fit their trading strategies and preferences. This includes adjusting the colors, line thickness, and other visual elements.
Usage:
Breakout Trading: Traders can use the Friday High Low Range Candle Indicator to identify potential breakout levels. If the price moves significantly beyond the high or low of the Friday range, it may signal a strong directional move.
Support and Resistance: The high and low levels marked by the indicator can act as important support and resistance levels. Traders can use these levels to set entry and exit points for their trades.
Trend Confirmation: By observing how the price interacts with the Friday high and low levels, traders can confirm the strength of ongoing trends or anticipate possible reversals.
10 EMA Indicator ( Murod Khamidov )Quyidagi qisqacha maʼlumot indikatorning asosiy funksiyalarini tushuntiradi:
10 EMA Indikatori
Koʻp vaqt oraligʻidagi hisoblash: Indikator TradingView’da 10 ta eksponentsial harakatlanuvchi o‘rtacha (EMA) ni hisoblaydi, har biri uchun alohida timeframe (vaqt oraligʻi) tanlash imkoniyati mavjud.
Moslashtiriladigan parametrlar: Har bir EMA uchun mustaqil ravishda parametrlar belgilanishi mumkin:
Length: Hisoblash davri (period) aniqlanadi.
Source: Hisoblash uchun asosiy narx (masalan, close) tanlanadi.
Offset: Chizma siljishi uchun qiymat.
Vizual ajratish: Har bir EMA turli rang bilan chiziladi, bu esa grafikda ularni oson aniqlash imkonini beradi.
Tahlil va strategiya: Indikator yordamida bozor tendensiyalari, trend yo‘nalishlari va potentsial signal nuqtalari tezda aniqlanishi mumkin.
Ushbu indikator turli strategiyalar va tahlillar uchun qulaylik yaratib, bozordagi o‘zgarishlarni tezda kuzatib borishga yordam beradi.
Power Trend with Tight Price ActionI've combined Mike Webster's Power Trend with a Tight Price Action detector. This script:
✅ Identifies Power Trends (green background when active)
✅ Marks Tight Price Action (blue bars when range is tight + volume dries up)
✅ Plots Buy Points on Breakouts (green triangles for breakouts on high volume)
Pine Script: Power Trend + Tight Price Action
pinescript
Copy
Edit
//@version=5
indicator("Power Trend with Tight Price Action", overlay=true)
// Moving Averages
ema21 = ta.ema(close, 21)
sma50 = ta.sma(close, 50)
// === Power Trend Conditions ===
// 1. Low above 21 EMA for 10 days
low_above_ema21 = ta.lowest(low, 10) >= ta.lowest(ema21, 10)
// 2. 21 EMA above 50 SMA for 5 days
ema21_above_sma50 = ta.barssince(ema21 < sma50) >= 5
// 3. 50 SMA is in an uptrend
sma50_uptrend = sma50 > sma50
// 4. Market closes higher than the previous day
close_up = close > close
// Start & End Power Trend
startPowerTrend = low_above_ema21 and ema21_above_sma50 and sma50_uptrend and close_up
endPowerTrend = close < ema21 or sma50 < sma50
// Track Power Trend Status
var bool inPowerTrend = false
if (startPowerTrend)
inPowerTrend := true
if (endPowerTrend)
inPowerTrend := false
// === Tight Price Action (Low Volatility + Volume Dry-Up) ===
range10 = ta.highest(high, 10) - ta.lowest(low, 10)
tightBase = (range10 / close) < 0.07 // Price range is less than 7% of closing price
volAvg50 = ta.sma(volume, 50)
lowVolume = volume < (volAvg50 * 0.75) // Volume is 25% below 50-day avg
tightPriceAction = inPowerTrend and tightBase and lowVolume // Tight price inside Power Trend
// === Breakout on High Volume ===
breakoutHigh = ta.highest(high, 10)
breakout = close > breakoutHigh and volume > (volAvg50 * 1.5) // Price breaks out with 50%+ volume surge
// === Plot Features ===
// Background for Power Trend
bgcolor(inPowerTrend ? color.green : na, transp=85)
// Highlight Tight Price Action
barcolor(tightPriceAction ? color.blue : na)
// Mark Breakouts
plotshape(series=breakout, location=location.belowbar, color=color.green, style=shape.triangleup, title="Buy Point on Breakout")
// Power Trend Start/End Markers
plotshape(series=startPowerTrend, location=location.belowbar, color=color.green, style=shape.labelup, title="Power Trend Start")
plotshape(series=endPowerTrend, location=location.abovebar, color=color.red, style=shape.triangledown, title="Power Trend End")
// Alerts
alertcondition(startPowerTrend, title="Power Trend Started", message="Power Trend has started!")
alertcondition(endPowerTrend, title="Power Trend Ended", message="Power Trend has ended!")
alertcondition(breakout, title="Breakout on High Volume", message="Stock has broken out on high volume!")
How This Works:
🔹 Green Background = Power Trend is active
🔹 Blue Bars = Tight Price Action inside Power Trend (low volatility + volume dry-up)
🔹 Green Triangles = Breakout on High Volume
Pullback Indicator with Trend and SMC Logic By NileshGThe error occurs because in Pine Script version 6, when you define a variable without specifying a type, you cannot assign `na` to it directly. You need to specify the type of the variable explicitly.
In Pine Script v6, you should define the type of the variable when declaring it, especially when initializing it with `na`. For this case, you need to declare the variables as `float` or another appropriate type.
Let's fix that issue by properly defining the types of the variables for `entryLevel`, `stopLoss`, `tp1`, `tp2`, and `tp3`.
### Updated Code with Proper Variable Types in Pine Script v6:
```pinescript
//@version=6
indicator("Pullback Indicator with Trend and SMC Logic", overlay=true)
// Trend Identification
length = input.int(14, title="Trend Length")
maType = input.string("SMA", title="Moving Average Type", options= )
ma = maType == "SMA" ? ta.sma(close, length) : ta.ema(close, length)
upTrend = close > ma
downTrend = close < ma
bgcolor(upTrend ? color.new(color.green, 90) : na, title="Uptrend")
bgcolor(downTrend ? color.new(color.red, 90) : na, title="Downtrend")
// Pullback Detection
pullbackThreshold = input.float(0.382, title="Pullback Threshold (Fibonacci)")
upTrendHigh = ta.highest(high, length) // Using ta.highest for highest value
downTrendLow = ta.lowest(low, length) // Using ta.lowest for lowest value
pullbackUp = high < upTrendHigh * (1 - pullbackThreshold)
pullbackDown = low > downTrendLow * (1 + pullbackThreshold)
bgcolor(pullbackUp ? color.new(color.yellow, 90) : na, title="Pullback Up")
bgcolor(pullbackDown ? color.new(color.yellow, 90) : na, title="Pullback Down")
// Entry, Stop Loss (SL), Trailing SL, and Take Profits (TP)
var float entryLevel = na
var float stopLoss = na
var float tp1 = na
var float tp2 = na
var float tp3 = na
if pullbackUp
entryLevel := high
stopLoss := low - (high - low) * 0.1 // 10% below the pullback high
tp1 := entryLevel + (high - low) * 0.5 // 50% of the risk distance for TP1
tp2 := entryLevel + (high - low) * 1 // 1x risk for TP2
tp3 := entryLevel + (high - low) * 1.5 // 1.5x risk for TP3
plot(entryLevel, color=color.blue, title="Entry Level", linewidth=2)
plot(stopLoss, color=color.red, title="Stop Loss", linewidth=2)
plot(tp1, color=color.green, title="TP1", linewidth=2)
plot(tp2, color=color.green, title="TP2", linewidth=2)
plot(tp3, color=color.green, title="TP3", linewidth=2)
// Smart Money Concept (SMC) Liquidity Zones (for simplicity)
liquidityZoneHigh = ta.highest(high, 50)
liquidityZoneLow = ta.lowest(low, 50)
plotshape(close > liquidityZoneHigh, color=color.purple, style=shape.labelup, title="Liquidity Zone Breakout", location=location.belowbar)
plotshape(close < liquidityZoneLow, color=color.purple, style=shape.labeldown, title="Liquidity Zone Breakdown", location=location.abovebar)
```
### Key Changes:
1. **Variable Types Defined Explicitly**:
- `var float entryLevel = na`
- `var float stopLoss = na`
- `var float tp1 = na`
- `var float tp2 = na`
- `var float tp3 = na`
These variables are now explicitly defined as `float` types, which is required for handling numerical values, including `na`.
2. **No More Implicit Type Assignment**: By defining the types explicitly, we avoid errors related to assigning `na` to a variable that doesn't have a specified type.
### What this Code Does:
- **Trend Identification**: Highlights the background green for an uptrend and red for a downtrend.
- **Pullback Detection**: Highlights yellow when a pullback is detected based on Fibonacci levels.
- **Entry, Stop Loss, and Take Profits**: Calculates entry levels, stop losses, and multiple take-profit levels when a pullback is detected.
- **Liquidity Zones**: Marks liquidity zone breakouts and breakdowns using horizontal levels based on recent highs and lows.
This should now work properly in Pine Script v6. Let me know if you encounter any other issues!
Percent % Change Since Specific Date / Time (Low Price)On candlestick mark low of specific date by giving input one day ago in date range
EMAs y Bandas de BollingerDescripción del Script:
Este script de Pine Script v5 muestra dos medias móviles exponenciales (EMAs) y las Bandas de Bollinger en el gráfico.
🔹 EMA de 10 períodos (color azul, trazo fino) para identificar tendencias de corto plazo.
🔹 EMA de 55 períodos (color amarillo, trazo más grueso) para visualizar tendencias de mayor alcance.
🔹 Bandas de Bollinger con configuración estándar (20 períodos, desviación de 2):
Banda superior en color verde para indicar niveles de sobrecompra.
Banda inferior en color rojo para señalar niveles de sobreventa.
Este indicador es útil para identificar tendencias, zonas de sobrecompra/sobreventa y posibles puntos de entrada o salida en el mercado. ¡Úsalo en combinación con otras herramientas de análisis técnico para mejorar tu operativa! 📈🚀
Simple Base Screener with PowerTrend & AlertsSimple Base Screener with PowerTrend & Alerts
To integrate the PowerTrend indicator with your existing Simple Base Screener script, we can add the conditions from the IBD PowerTrend strategy, which relies on moving averages and price action to confirm a strong uptrend.
Here’s how to combine both the Simple Base Screener and the PowerTrend conditions:
Steps:
Add PowerTrend conditions to the script.
Combine the PowerTrend conditions with the existing Simple Base conditions.
Plot the buy signal when both conditions are met.
Updated Script:
pinescript
Copy
Edit
//@version=5
indicator("Simple Base Screener with PowerTrend & Alerts", overlay=true)
// --- Simple Base Screener Conditions ---
// Moving Averages
ema21 = ta.ema(close, 21)
sma50 = ta.sma(close, 50)
sma200 = ta.sma(close, 200)
// Tight Price Action (Low Volatility)
range10 = ta.highest(high, 10) - ta.lowest(low, 10)
tightBase = (range10 / close) < 0.07
// Volume Dry-Up
volAvg50 = ta.sma(volume, 50)
lowVolume = volume < (volAvg50 * 0.75)
// Strong Uptrend (Already in the script)
uptrend = ema21 > sma50 and sma50 > sma200
// Near 52-Week High
high52 = ta.highest(high, 252)
nearHigh = close > (0.85 * high52)
// Simple Base Confirmation
simpleBase = tightBase and lowVolume and uptrend and nearHigh
// --- PowerTrend Indicator Conditions ---
// PowerTrend Condition 1: The low is above the 21-day EMA for at least 10 days
condition1 = ta.lowest(low, 10) >= ta.lowest(ema21, 10)
// PowerTrend Condition 2: The 21-day EMA is above the 50-day SMA for at least five days
condition2 = ta.barssince(ema21 < sma50) >= 5
// PowerTrend Condition 3: The 50-day SMA is in an uptrend (one day is sufficient)
condition3 = sma50 > sma50
// PowerTrend Condition 4: The market closes up for the day
condition4 = close > close
// Combine all PowerTrend conditions
start_trend = condition1 and condition2 and condition3 and condition4
// --- Final Combined Condition ---
// Buy Signal when both Simple Base and PowerTrend conditions are met
finalCondition = simpleBase and start_trend
// --- Plotting ---
// Plot Simple Base Signal (Blue Label)
plotshape(series=simpleBase, location=location.belowbar, color=color.blue, style=shape.labelup, title="Simple Base Signal")
// Plot Buy Signal (Green Triangle) when both conditions are met
plotshape(series=finalCondition, location=location.belowbar, color=color.green, style=shape.triangleup, title="Buy Signal")
// Highlight Bars with Simple Base Condition
barcolor(simpleBase ? color.blue : na)
// Background Highlight for Simple Base Condition
bgcolor(simpleBase ? color.blue : na, transp=90)
// Alerts for Buy Signal
alertcondition(finalCondition, title="Buy Signal", message="Buy signal based on Simple Base and PowerTrend confirmation.")
Key Changes:
PowerTrend Conditions:
Condition 1: The low price must be above the 21-day EMA for at least 10 days.
Condition 2: The 21-day EMA must be above the 50-day SMA for at least 5 days.
Condition 3: The 50-day SMA must be in an uptrend (compared to the previous day).
Condition 4: The market must close higher than the previous day.
Combining Simple Base and PowerTrend:
A final buy signal is generated when both the Simple Base and PowerTrend conditions are true.
Plotting:
Blue label below bars to indicate a Simple Base.
Green triangle below bars when the buy signal (both Simple Base and PowerTrend) occurs.
Alerts:
An alert condition is added to notify when the buy signal is triggered based on both the Simple Base and PowerTrend conditions.
Summary:
This combined script will:
Identify Simple Base conditions such as low volatility, low volume, and a strong uptrend.
Confirm the PowerTrend conditions indicating a solid market trend.
Mark buy signals with a green triangle when both conditions are met, helping you spot strong breakout opportunities in uptrending stocks.
Let me know if you need further adjustments or additional features!