Gold Trading SignalThis indicator is a trading strategy for Gold (XAU/USD) on TradingView, based on the crossover of two Exponential Moving Averages (EMA) and using Average True Range (ATR) to determine Stop Loss and Take Profit levels.
Key Features of the Indicator:
1. Buy and Sell Signals: The indicator generates buy and sell signals based on the crossover of the 9-period short EMA and the 21-period long EMA.
2. ATR Calculation: The ATR (14) is used to calculate Stop Loss and Take Profit levels, which helps in measuring market volatility.
3. Stop Loss and Take Profit Levels:
Stop Loss for Buy: The low of the previous candle minus ATR.
Stop Loss for Sell: The high of the previous candle plus ATR.
Take Profit for Buy: The closing price plus ATR multiplied by a factor.
Take Profit for Sell: The closing price minus ATR multiplied by a factor.
4. Chart Display: Buy signals are displayed as green arrows below bars, and sell signals are shown as red arrows above bars.
5. Alerts: Alerts are triggered when buy or sell signals are activated.
Strategy Objective:
This strategy is designed to identify entry and exit points using EMA crossovers and ATR, helping traders determine optimal Stop Loss and Take Profit levels.
Chart patterns
wuyx 59 imbGiải thích:
alertcondition: Hàm này được sử dụng để tạo các điều kiện cảnh báo trên TradingView. Khi điều kiện được đáp ứng, cảnh báo sẽ được kích hoạt.
breakFlyingCandleUp: Điều kiện phá vỡ nến bay tăng, xảy ra khi giá đóng cửa cao hơn high của nến bay trước đó.
breakFlyingCandleDown: Điều kiện phá vỡ nến bay giảm, xảy ra khi giá đóng cửa thấp hơn low của nến bay trước đó.
Cách sử dụng:
Khi bạn thêm các cảnh báo này vào script, bạn có thể thiết lập cảnh báo trên TradingView để nhận thông báo khi các điều kiện này được đáp ứng.
Bạn có thể tùy chỉnh thông báo cảnh báo để phù hợp với nhu cầu của mình.
Ví dụ hoàn chỉnh:
Dưới đây là đoạn mã hoàn chỉnh với các cảnh báo đã được thêm vào:
D@bhi's short hello guys
this signal for seller who try with 5 ema strategy for trend change in intraday
so try with stick SL and as per your risk appetite
go with 1:3,4 ratio its very help full and good rewards
ema 59 Giải thích mã:
Thêm biến buyLabel và sellLabel:
buyLabel và sellLabel được sử dụng để xác định khi nào label Buy hoặc Sell xuất hiện trên biểu đồ.
Cảnh báo khi label Buy xuất hiện:
Sử dụng alertcondition với điều kiện outsideBarCrossAbove để thông báo khi label Buy xuất hiện.
Cảnh báo khi label Sell xuất hiện:
Sử dụng alertcondition với điều kiện outsideBarCrossBelow để thông báo khi label Sell xuất hiện.
Thông báo chi tiết:
Thông báo sẽ hiển thị giá tại thời điểm label xuất hiện.
Ví dụ thông báo:
Khi label Buy xuất hiện: "Label Buy xuất hiện tại giá: 1.1050".
Khi label Sell xuất hiện: "Label Sell xuất hiện tại giá: 1.1000".
Lưu ý:
Đảm bảo rằng bạn đã bật cảnh báo trong TradingView để nhận thông báo khi label xuất hiện.
Kiểm tra kỹ lưỡng chiến lược trên dữ liệu lịch sử trước khi sử dụng trong giao dịch thực tế.
Nếu bạn muốn thông báo chi tiết hơn (ví dụ: thêm thông tin về số lượng hợp đồng hoặc vị thế), bạn có thể sử dụng alert trong strategy thay vì alertcondition. Tuy nhiên, alert chỉ hoạt động với strategy, không hoạt động với indicator.
image.png
PNG 11.25KB
Lỗi "Void expression cannot be assigned to a variable" xảy ra khi bạn cố gắng gán một biểu thức không trả về giá trị (void) vào một biến. Trong Pine Script, hàm plotshape không trả về giá trị nào, vì vậy bạn không thể gán nó vào một biến như buyLabel hoặc sellLabel.
Nguyên nhân:
Bạn đang cố gắng gán kết quả của plotshape vào biến buyLabel và sellLabel, nhưng plotshape không trả về giá trị.
Cách sửa lỗi:
Bạn không cần gán plotshape vào biến. Thay vào đó, bạn có thể sử dụng trực tiếp điều kiện outsideBarCrossAbove và outsideBarCrossBelow để tạo cảnh báo.
Dưới đây là đoạn mã đã được sửa:
pinescript
Copy
//@version=5
strategy(title="Outside Bar EMA Crossover Strategy with EMA Shift", shorttitle="Outside Bar EMA Cross", overlay=true)
// Input for EMA lengths
lenEMA1 = input.int(5, title="EMA 5 Length")
lenEMA2 = input.int(9, title="EMA 9 Length")
// Input for EMA 9 shift
emaShift = input.int(1, title="EMA 9 Shift", minval=0)
// Calculate EMAs
ema1 = ta.ema(close, lenEMA1)
ema2 = ta.ema(close, lenEMA2)
// Apply shift to EMA 9
ema2Shifted = na(ema2 ) ? na : ema2 // Dịch chuyển EMA 9 bằng cách sử dụng offset
// Plot EMAs
plot(ema1, title="EMA 5", color=color.blue, linewidth=2)
plot(ema2Shifted, title="EMA 9 Shifted", color=color.red, linewidth=2)
// Outside Bar condition
outsideBar() => high > high and low < low
// Cross above EMA 5 and EMA 9 (shifted)
crossAboveEMA = close > ema1 and close > ema2Shifted
// Cross below EMA 5 and EMA 9 (shifted)
crossBelowEMA = close < ema1 and close < ema2Shifted
// Outside Bar cross above EMA 5 and EMA 9 (shifted)
outsideBarCrossAbove = outsideBar() and crossAboveEMA
// Outside Bar cross below EMA 5 and EMA 9 (shifted)
outsideBarCrossBelow = outsideBar() and crossBelowEMA
// Plot shapes for visual signals
plotshape(series=outsideBarCrossAbove, title="Outside Bar Cross Above", location=location.belowbar, color=color.green, style=shape.labelup, text="Buy", textcolor=color.white)
plotshape(series=outsideBarCrossBelow, title="Outside Bar Cross Below", location=location.abovebar, color=color.red, style=shape.labeldown, text="Sell", textcolor=color.white)
// Calculate Outside Bar height
outsideBarHeight = high - low // Chiều cao của nến Outside Bar
// Calculate TP and SL levels
tpRatio = 0.5 // TP = 50% chiều cao nến Outside Bar
slRatio = 1.0 // SL = 100% chiều cao nến Outside Bar
tpLevelLong = close + outsideBarHeight * tpRatio // TP cho lệnh mua
slLevelLong = close - outsideBarHeight * slRatio // SL cho lệnh mua
tpLevelShort = close - outsideBarHeight * tpRatio // TP cho lệnh bán
slLevelShort = close + outsideBarHeight * slRatio // SL cho lệnh bán
// Strategy logic
if (outsideBarCrossAbove)
strategy.entry("Buy", strategy.long)
strategy.exit("Take Profit/Stop Loss", "Buy", stop=slLevelLong, limit=tpLevelLong) // Thêm TP và SL
if (outsideBarCrossBelow)
strategy.entry("Sell", strategy.short)
strategy.exit("Take Profit/Stop Loss", "Sell", stop=slLevelShort, limit=tpLevelShort) // Thêm TP và SL
// Logic: Nếu lệnh Buy bị Stop Loss => Vào lệnh Sell
if (strategy.position_size > 0 and close <= slLevelLong)
strategy.close("Buy")
strategy.entry("Sell After Buy SL", strategy.short)
// Logic: Nếu lệnh Sell bị Stop Loss => Vào lệnh Buy
if (strategy.position_size < 0 and close >= slLevelShort)
strategy.close("Sell")
strategy.entry("Buy After Sell SL", strategy.long)
// Cảnh báo khi label Buy xuất hiện
alertcondition(condition=outsideBarCrossAbove, title="Label Buy Xuất Hiện", message="Label Buy xuất hiện tại giá: {{close}}")
// Cảnh báo khi label Sell xuất hiện
alertcondition(condition=outsideBarCrossBelow, title="Label Sell Xuất Hiện", message="Label Sell xuất hiện tại giá: {{close}}")
Giải thích sửa lỗi:
Loại bỏ gán plotshape vào biến:
Bạn không cần gán plotshape vào biến buyLabel hoặc sellLabel. Thay vào đó, bạn có thể sử dụng trực tiếp điều kiện outsideBarCrossAbove và outsideBarCrossBelow để tạo cảnh báo.
Sử dụng alertcondition:
alertcondition được sử dụng để tạo cảnh báo khi điều kiện outsideBarCrossAbove hoặc outsideBarCrossBelow được đáp ứng.
Kết quả:
Khi label Buy xuất hiện, cảnh báo "Label Buy xuất hiện tại giá: X" sẽ được kích hoạt.
Khi label Sell xuất hiện, cảnh báo "Label Sell xuất hiện tại giá: X" sẽ được kích hoạt.
Lưu ý:
Đảm bảo rằng bạn đã bật cảnh báo trong TradingView để nhận thông báo khi label xuất hiện.
Kiểm tra kỹ lưỡng chiến lược trên dữ liệu lịch sử trước khi sử dụng trong giao dịch thực tế.
New chat
Support and Resistance, Breakouts, and Trendlines Support and Resistance, Breakouts, and Trendlines. this indicator is not to be solely used, it should be used with other indicators and technical analysis.
Porcentaje Paridad Bonos ARSSe compraran bonos globales con ley argentica para sacar la paridad segun time frema selkeccionado
Porcentaje Paridad Bonos ARSSe compraran bonos globales con ley argentica para sacar la paridad segun time frema selkeccionado
ZigzagGGChỉ báo xác định xu hướng dựa trên lý thuyết dow.
màu xanh là xu hướng tăng
màu đỏ là xu hướng giảm
Wick Strategy AnalyzerOverview
This indicator analyzes candle wick patterns and evaluates their outcomes over a user-definable range (default is 1 year). Labels are rendered on the chart to mark events that meet the specified wick condition.
Features
Customizable Bar Range - users can specify the range of bars to include in the analysis. Default is 365 bars back from the most recent bar (bar 0)
Visual Indicators - labels are rendered to mark conditions & outcomes.
Wick Condition Met - an Orange label below the wick candle displaying the wick’s percentage size.
Outcome Labels - rendered above the candle after wick condition met candles
P (Green): Pass
F (Red): Fail
N (Navy): Neutral
I (Blue): Indicates the current candle has not yet closed, so the outcome is undetermined.
Input Parameters
Wick Threshold - minimum wick size required to qualify as a wick condition.
Success Margin - Defines the margin for classifying outcomes as Pass, Fail, or Neutral. E.g., a success margin of 0.01 requires the next candle's close to exceed the wick candle's close by 1% in order to be a Pass.
Bar Offset Start - starting offset from the last bar for analysis. A value of -1 will include all bars.
Bar Offset End - ending offset from the last bar for analysis. Bars outside this range are excluded.
Example Scenario
Goal: Analyze how candles with a wick size of at least 3.5% perform within a success margin of 1% over the past 540 days.
Setup:
Set Wick Threshold to 0.035
Set Success Margin to 0.01
Set Bar Range Start to 0
Set Bar Range End to 540.
Expected Output
Candles with a wick of at least 3.5% are labeled.
Outcome labels (P, F, or N) indicate performance.
Order Block Zones with Pin Bar & Engulfing SignalsThis strategy gives buy and sell signals based on a pin bar in the 1-minute timeframe, within supply and demand zones in the 15-minute timeframe.
4th Day Performance After 3 Down DaysThis Pine Script indicator analyzes market performance on the 4th day following 3 consecutive down days. It identifies when the close price is lower than the open for three consecutive days and calculates the price change from the 3rd day's close to the 4th day's close.
Key features include:
Entry and Exit Tracking: The script records the entry price (3rd day's close) and the exit price (4th day's close).
Performance Metrics: The script calculates and displays:
Total Profit/Loss (PnL) over all trades.
Total number of trades.
Count of positive and negative 4th-day outcomes.
Customizable Start Date: The user can set a start date to analyze historical data.
Interactive Table: A table on the chart displays all key metrics for easy reference.
Use Case:
This script is useful for traders and analysts who want to study historical patterns and determine if the 4th day's performance presents opportunities following three consecutive down days. It helps identify potential reversal or continuation patterns in market behavior.
Disclaimer:
This script is for educational and research purposes only and should not be considered financial advice. Past performance does not guarantee future results. Always conduct thorough analysis and consult a professional before trading.
Move greater than %ADRThis indicator will show a mark whenever a scrip is moving on a close to close basis more than the %ADR of 14day period.
High-Low Breakout Strategy (Long Only)This script is a simple yet effective breakout strategy designed for long-only trades. The logic is straightforward:
- ** Entry Condition **: Enter long when the close price exceeds the previous high.
- ** Exit Condition **: Exit the position when the close price drops below the previous low.
Features:
- Automatically identifies the previous high and low for every bar.
- Displays these levels on the chart for easy reference.
Use this script for backtesting and exploring breakout opportunities in various markets. Let us know your thoughts and how it works for you in the comments!
Disclaimer : This script is for educational purposes only and is not financial advice. Past performance does not guarantee future results.
- Perfect for trend-following traders looking for a mechanical, rule-based approach.
INDICADOR COM ALARMESAlarme soa 30 segundos antes do fechamento e troca de cor do candle. Basea-se em RSI e divergências.
Outside Bar Alert4hr Daily and Weekly Outside Engulfing Bar Indicator
Help spot tops and bottoms, trend changes, etc
Adaptive Trend Flow [SignalSenseAI]The Adaptive Trend Flow by SignalSenseAI is a sophisticated technical indicator that harnesses the power of volatility-adjusted EMAs to navigate market trends with precision. By seamlessly integrating a dynamic dual-EMA system with adaptive volatility bands, this premium tool enables traders and investors to identify and capitalize on sustained market moves while effectively filtering out noise. The indicator's unique approach to trend detection combines classical technical analysis with modern adaptive techniques, providing traders and investors with clear, actionable signals across various market conditions and asset class.
Advanced Price Action Dashboard🚀 Advanced Price Action Dashboard
Welcome to the Advanced Price Action Dashboard, a powerful tool that helps you analyze market behavior clearly and visually in real-time. This table displays key price action signals, volume analysis, RSI, and other indicators to help you make informed decisions. Let’s break it down!
🛠️ What does this indicator do?
This indicator is a dashboard of signals that shows you various market factors such as:
Reversal Signals 🌀
Continuation Signals 🔁
RSI Analysis 📊
Volume Conditions 📈
Support and Resistance on a Higher Timeframe 🏔️
📅 Table Components
📝 Indicator Title:
"Advanced Price Action Dashboard" is the title at the top of the table. It's your go-to table to see market analysis at a glance.
📈 Reversal Signals Section:
Bullish Reversal: Indicates a potential change from a downtrend to an uptrend. A ✅ means the condition is met, and ❌ means it’s not.
Bearish Reversal: Indicates a potential change from an uptrend to a downtrend. A ✅ means the condition is met, and ❌ means it’s not.
🔄 Continuation Signals Section:
Bullish Continuation: Indicates the uptrend may continue. A ✅ means the condition is met, and ❌ means it’s not.
Bearish Continuation: Indicates the downtrend may continue. A ✅ means the condition is met, and ❌ means it’s not.
📊 RSI Conditions Section:
RSI (Relative Strength Index): Shows the current RSI value. If RSI is above 70 (overbought), it’s marked in red, and if it’s below 30 (oversold), it’s marked in green.
📊 Volume Conditions:
Volume Spike: If the current volume is significantly higher than the average, it’s marked with a ✅, indicating a potential trend change.
🔒 Support and Resistance on a Higher Timeframe:
Near Higher TF Resistance: Indicates if the price is near a resistance zone on a higher timeframe chart. It’s marked in red.
Near Higher TF Support: Indicates if the price is near a support zone on a higher timeframe chart. It’s marked in green.
🏅 Trend Direction:
Trend Direction: If the price is above the moving average (MA), it’s marked "Bullish" in green; if it’s below, it’s marked "Bearish" in red.
🔥 Large Body Candle:
Large Body Candle: Shows if the current candle has a large body, which could indicate a strong price movement.
🔍 How to Use This Indicator
Quick Setup:
This indicator is ready to use as soon as you add it to your TradingView chart. No complex configurations are needed.
Interpret the Signals:
The table checkboxes will clearly show whether reversal or continuation signals are present, and if the volume or RSI conditions are met.
Actions to Take:
If you see a ✅ in Bullish Reversal and RSI Oversold (RSI < 30), you might consider a buy.
If you see a ✅ in Bearish Reversal and RSI Overbought (RSI > 70), you might consider a sell.
Continuation signals help you identify if a trend is ongoing and may continue.
📈 Visual Overview of the Table
The Dashboard is displayed at the top right of your chart so you can see all the relevant information without losing sight of the price in real-time.
Colors: The table’s colors help you quickly identify the current market condition:
✅ = Condition met (good signal).
❌ = Condition not met (avoid action).
Green = Bullish, good time to buy.
Red = Bearish, good time to sell.
Blue and Gray to highlight trend and volume analysis.
🛠️ Customization
You can adjust the settings according to your preferences:
Moving Average (MA) length 🧮
Volume multiplier 📊
RSI (with adjustable overbought and oversold levels) 📉
Multi-timeframe analysis 🕒
🏁 Conclusion
The Advanced Price Action Dashboard is a great tool for traders who want a quick and efficient market analysis. With clear reversal and continuation signals, volume and RSI analysis, it helps you make informed decisions while staying in tune with the market flow.
Happy trading! 🚀📈
Order Block & Liquidity Sweep Scalping//@version=6
indicator("Order Block & Liquidity Sweep Scalping", overlay=true)
// Input Parameters
orderBlockLength = input.int(5, "Order Block Length", minval=1) // Length of consolidation to detect order blocks
showLiquidityLevels = input.bool(true, "Show Liquidity Levels")
// Define Highs and Lows for Order Block
highs = ta.highest(high, orderBlockLength)
lows = ta.lowest(low, orderBlockLength)
// Detect Potential Order Blocks
isOrderBlockBullish = (ta.valuewhen(high == highs, close, 0) < high) and ta.valuewhen(high == highs, close, 1) > high
isOrderBlockBearish = (ta.valuewhen(low == lows, close, 0) > low) and ta.valuewhen(low == lows, close, 1) < low
// Draw Order Block Zones
var line bullishOBZone = na
var line bearishOBZone = na
if isOrderBlockBullish
bullishOBZone := line.new(x1=bar_index , y1=lows, x2=bar_index , y2=lows, color=color.green, width=2)
line.new(x1=bar_index , y1=highs, x2=bar_index , y2=highs, color=color.green, width=1, style=line.style_dotted)
if isOrderBlockBearish
bearishOBZone := line.new(x1=bar_index , y1=highs, x2=bar_index , y2=highs, color=color.red, width=2)
line.new(x1=bar_index , y1=lows, x2=bar_index , y2=lows, color=color.red, width=1, style=line.style_dotted)
// Highlight Liquidity Sweeps
liquiditySweepBullish = showLiquidityLevels and low < ta.lowest(low, orderBlockLength) and close > ta.highest(high, orderBlockLength)
liquiditySweepBearish = showLiquidityLevels and high > ta.highest(high, orderBlockLength) and close < ta.lowest(low, orderBlockLength)
// Plot liquidity sweep signals
plotshape(series=liquiditySweepBullish, title="Bullish Liquidity Sweep", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
plotshape(series=liquiditySweepBearish, title="Bearish Liquidity Sweep", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Strategy Alerts
alertcondition(liquiditySweepBullish, title="Bullish Liquidity Sweep Alert", message="Bullish Liquidity Sweep detected")
alertcondition(liquiditySweepBearish, title="Bearish Liquidity Sweep Alert", message="Bearish Liquidity Sweep detected")
Simple 5-8-13 StrategyThe Simple 5-8-13 SMA Strategy is a trend-following trading system that uses three Simple Moving Averages (SMA) with periods of 5, 8, and 13. The strategy generates buy signals when the shorter-term moving averages cross above the longer-term ones (specifically when SMA5 > SMA8 > SMA13), indicating an upward trend. Sell signals are generated when the shortest moving average falls below both longer averages (SMA5 < SMA8 and SMA5 < SMA13), suggesting a downward trend. This strategy is designed to work on 15-minute timeframes and aims to capture medium-term price movements. Like all trading strategies, it should be used in conjunction with proper risk management and other technical analysis tools.