Buy/Sell on Second Candle after EMA BreakoutHow to use this EMA Breakout Strategy and how it works:
This strategy can be used to scalp quick 1:1 or 2:1 trades or take longer time frame trades.
Use higher time frames that being the 1day and 1 hour to confirm the direction of the market
trend and then execute trades on the 5 min or 15 min time frame.
Based on the higher time frame analysis filter out signals on 5 or 15 min time frame based on the direction of the market. So if the market is bullish based on higher time frames put signals only to show buy signals and same for sell signals if the market is bearish.
You will get a buy signal on second candle that breaks and closes above the ema and you will get sell signals on second candles that forms and closes below the ema.
Only take trades on buy signals when there is a clear upward direction
or downward movement for sell signals.
Don't take buy or sell signals when the market is consolidating.
When taking long positions aim for previous day highs
and when taking short positions aim for previous day lows.
Candlestick analysis
Thien ThienFair Value Gap indicator: Paints FVGs and their midlines (CEs). Stops painting when CE is hit, or when fully filled; user choice of threshold. This threshold is also used in the Alert conditions.
~~Plotted here on ES1! (CME), on the 15m timeframe~~
-A FVG represents a 'naked' body where the wicks/tails on either side do not meet. This can be seen as a type of 'gap', which price will have a tendency to want to re-fill (in part or in full).
-The midline (CE, or 'Consequent encroachment') of FVGs also tend to show price sensitivity.
-This indicator paints all FVGs until priced into, and should give an idea of which are more meaningful and which are best ignored (based on context: location, Time of day, market structure, etc).
-This is a simpler and more efficient method of painting Fair value gaps which auto-stop painting when price reaches them.
//Aims of Publishing:
-Education of ICT concepts of Fair Value Gaps and their midlines (CEs): To easily see via forward testing or backtesting, the sensitivity that price shows to these areas & levels.
-Demonstration of a much more efficient way of plotting FVGs which terminate at price, thanks to a modification of @Bjorgums's clever looping method referenced below.
//Settings:
-Toggle on/off upward and downward FVGs independe
TR FVG & Swing High Low FinderTR FVG & Swing Level Finder
Overview:
The TR FVG & Swing Level Finder is a powerful Pine Script indicator designed for traders who want to identify Fair Value Gaps (FVGs) and Swing Highs/Lows on their charts. This indicator combines two essential technical analysis tools into one, helping traders spot potential areas of support, resistance, and trend reversals. FVGs are price gaps that often act as areas of interest for price to return to, while swing highs and lows help identify key turning points in the market. The indicator is highly customizable, allowing users to adjust colors, limits, and display options to suit their trading style.
Key Features:
1: Fair Value Gap (FVG) Detection:
- Identifies Bullish FVGs: Occur when the high of two candles ago is lower than the low of the current candle, indicating a potential upward price movement.
- Identifies Bearish FVGs: Occur when the low of two candles ago is higher than the high of the current candle, indicating a potential downward price movement.
- Displays FVGs as colored boxes on the chart, with customizable border and fill colors based on the timeframe.
- Labels each FVG box with the corresponding timeframe (e.g., "1m FVG", "1h FVG", "Daily FVG").
2: Swing High and Swing Low Detection:
- Detects Swing Highs: A 3-candle pattern where the middle candle's high is higher than the highs of the candles on either side.
- Detects Swing Lows: A 3-candle pattern where the middle candle's low is lower than the lows of the candles on either side.
- Draws a solid black line with 50% opacity at each swing high and low, extending 5 bars to the right for better visibility.
- Adds a small Swing High or Swing Low label at the right end of each line, colored according to user-defined settings.
3: Timeframe-Specific FVG Visualization:
- FVGs are color-coded based on the chart's timeframe, making it easy to distinguish between FVGs on different timeframes.
- Each timeframe has its own fill color for bullish and bearish FVGs, with adjustable transparency for better chart clarity.
- A dashed black line is drawn in the middle of each FVG box to highlight the midpoint of the gap.
4: Customizable Display Options:
- FVG Limit: Control the maximum number of FVGs displayed on the chart (from 1 to 20).
- Extend Options for FVG Boxes:
- "None": FVG boxes extend only 2 bars to the right.
- "Limited": FVG boxes extend a user-defined number of candles to the right (1 to 100 candles).
- "Default": FVG boxes extend 3 bars to the right of the current bar.
- Color Customization:
- Set border colors for bullish and bearish FVGs.
- Adjust fill colors for FVGs on different timeframes (1m, 5m, 15m, 30m, 1h, 4h, Daily, Weekly, Monthly).
- Customize the colors of swing high and swing low labels.
5: Performance Optimization:
- The indicator only plots FVGs and swings on the last confirmed bar (barstate.islastconfirmedhistory), ensuring efficient performance and reducing chart clutter.
- Limits the number of displayed FVGs and swings to the user-defined fvgLimit, keeping the chart clean and focused on the most recent price action.
6: Inputs and Customization:
- Number of FVGs to Show (fvgLimit): Set the maximum number of FVGs and swings to display (default: 3, range: 1 to 20).
- Bullish FVG Border Color (bullishColor): Choose the border color for bullish FVGs (default: green).
- Bearish FVG Border Color (bearishColor): Choose the border color for bearish FVGs (default: red).
- Swing High Color (swingHighColor): Set the color for swing high labels (default: blue).
- Swing Low Color (swingLowColor): Set the color for swing low labels (default: purple).
- Extend Options:
- Extend Option (extendOption): Choose how far FVG boxes extend to the right ("None", "Limited", or "Default"; default: "Default").
- Extend Candles (extendCandles): If "Limited" is selected, specify the number of candles to extend FVG boxes (default: 8, range: 1 to 100).
- Timeframe-Specific Fill Colors:
- Customize fill colors for bullish and bearish FVGs on various timeframes (1m, 5m, 15m, 30m, 1h, 4h, Daily, Weekly, Monthly).
- Each fill color has a default transparency (e.g., 93% for most timeframes, 90% for 30m), which can be adjusted as needed.
How to Use:
1: Add the Indicator to Your Chart:
- Open TradingView, go to the Pine Editor, and paste the script.
- Click "Add to Chart" to apply the indicator to your current chart.
2: Adjust Settings:
- Open the indicator settings by clicking the gear icon next to the indicator name on your chart.
- Modify the inputs to suit your preferences:
- Set the number of FVGs and swings to display.
- Choose your preferred colors for FVGs and swings.
- Adjust the extend options for FVG boxes.
3: Interpret the Indicator:
- FVG Boxes: Look for colored boxes on the chart, which represent Fair Value Gaps. Bullish FVGs (green borders by default) suggest potential buying opportunities, while bearish FVGs (red borders by default) suggest potential selling opportunities. The label inside each box indicates the timeframe of the FVG.
- Swing Highs and Lows: Identify key turning points with solid black lines (50% opacity) at swing highs and lows. Each line extends 5 bars to the right, with an "SH" (Swing High) or "SL" (Swing Low) label at the end. Swing highs can act as resistance levels, while swing lows can act as support levels.
4: Combine with Your Strategy:
- Use FVGs to identify areas where price might return to fill the gap, often acting as support or resistance.
- Use swing highs and lows to spot potential trend reversals or to set stop-loss and take-profit levels.
- Combine the indicator with other tools (e.g., trendlines, moving averages) for a more comprehensive trading strategy.
Notes:
- The indicator works on all timeframes, but the appearance of FVGs and swings will vary depending on the chart's timeframe.
- For best results, use the indicator on a clean chart to avoid visual clutter, especially if you increase the fvgLimit.
- The swing high/low lines are drawn with 50% opacity to ensure they don’t overpower other chart elements, but they are still clearly visible.
Author’s Note:
This script was developed to help traders identify key price levels with ease. I hope it adds value to your trading! If you have any feedback or suggestions for improvement, feel free to leave a comment. Happy trading!
NY Midnight Strategy with Advanced OptionsThe purpose of this script was originally to test one of ICT 's statements and check where it works best. In this case it was to set positions towards the direction of the New York midnight opening price inside ICT Killzones .
The default settings of this script work best with S&P E-mini futures (ES!), but can work just as well with other instruments. Often the parameters need to be adjusted.
To see results, use the 1h chart in the Tradingview strategy tester.
Day Trading Trend & Candle Predictor with AIThe table first entry is the actual accuracy of the algorithm. Second one is the trend continuation %. Second row shows the next 1 and 2 candles %.
The arrow shows the most probable continuation for the chart.
Works on any timeframe,
Try it out and let me know what you think!
IU Bigger than range strategyDESCRIPTION
IU Bigger Than Range Strategy is designed to capture breakout opportunities by identifying candles that are significantly larger than the previous range. It dynamically calculates the high and low of the last N candles and enters trades when the current candle's range exceeds the previous range. The strategy includes multiple stop-loss methods (Previous High/Low, ATR, Swing High/Low) and automatically manages take-profit and stop-loss levels based on user-defined risk-to-reward ratios. This versatile strategy is optimized for higher timeframes and assets like BTC but can be fine-tuned for different instruments and intervals.
USER INPUTS:
Look back Length: Number of candles to calculate the high-low range. Default is 22.
Risk to Reward: Sets the target reward relative to the stop-loss distance. Default is 3.
Stop Loss Method: Choose between:(Default is "Previous High/Low")
- Previous High/Low
- ATR (Average True Range)
- Swing High/Low
ATR Length: Defines the length for ATR calculation (only applicable when ATR is selected as the stop-loss method) (Default is 14).
ATR Factor: Multiplier applied to the ATR to determine stop-loss distance(Default is 2).
Swing High/Low Length: Specifies the length for identifying swing points (only applicable when Swing High/Low is selected as the stop-loss method).(Default is 2)
LONG CONDITION:
The current candle’s range (absolute difference between open and close) is greater than the previous range.
The closing price is higher than the opening price (bullish candle).
SHORT CONDITIONS:
The current candle’s range exceeds the previous range.
The closing price is lower than the opening price (bearish candle).
LONG EXIT:
Stop-loss:
- Previous Low
- ATR-based trailing stop
- Recent Swing Low
Take-profit:
- Defined by the Risk-to-Reward ratio (default 3x the stop-loss distance).
SHORT EXIT:
Stop-loss:
- Previous High
- ATR-based trailing stop
- Recent Swing High
Take-profit:
- Defined by the Risk-to-Reward ratio (default 3x the stop-loss distance).
ALERTS:
Long Entry Triggered
Short Entry Triggered
WHY IT IS UNIQUE:
This strategy dynamically adapts to different market conditions by identifying candles that exceed the previous range, ensuring that it only enters trades during strong breakout scenarios.
Multiple stop-loss methods provide flexibility for different trading styles and risk profiles.
The visual representation of stop-loss and take-profit levels with color-coded plots improves trade monitoring and decision-making.
HOW USERS CAN BENEFIT FROM IT:
Ideal for breakout traders looking to capitalize on momentum-driven price moves.
Provides flexibility to customize stop-loss methods and fine-tune risk management parameters.
Helps minimize drawdowns with a strong risk-to-reward framework while maximizing profit potential.
ICT/SMC XAUUSD Scalper v6This indicator combines **ICT (Inner Circle Trader)** and **SMC (Smart Money Concepts)** strategies for **3-minute XAUUSD scalping**. Key features:
1. **Liquidity Zones**
- Plots recent high/low levels as horizontal lines (red/green).
2. **Order Blocks (OB)**
- Labels bullish (green "OB" ▼) and bearish (red "OB" ▲) zones with 70% transparency.
- Auto-removes after 20 bars.
3. **Fair Value Gaps (FVG)**
- Highlights price imbalances with semi-transparent boxes (green=bullish, red=bearish).
- Cleans up after 9 bars (3x FVG length).
4. **Market Structure Shift (MSS)**
- Detects trend reversals via swing breaks.
5. **Signals**
- **Buy**: ▲ below price on bullish MSS + OB/FVG reaction + liquidity break.
- **Sell**: ▼ above price on bearish MSS + OB/FVG reaction + liquidity break.
**Optimized For**: Quick scalps (3-10 pips) during high liquidity sessions (London/NY overlap). Includes real-time alerts and clean visual hierarchy.
Hareketli Ortalama ve Fibonacci KanalYour TradingView Pine Script code looks good overall! You've integrated a moving average with a volatility channel based on standard deviation, and you've also added Fibonacci levels as dynamic support and resistance areas. Additionally, you've implemented buy and sell conditions based on the price crossing these levels.
kanal uzunluğu = 31
kanal çarpanı =1
hareketli ortalama = 11
olarak ayarlanıcaktır
Blackflag FTSInputs:
trailType: A string input allowing the user to choose between "modified" or "unmodified" trail type for calculating the True Range.
ATRPeriod: The period used for calculating the Average True Range (ATR).
ATRFactor: A multiplier for the ATR used to determine stop loss levels.
show_fib_entries: A boolean input that controls whether Fibonacci levels are shown for potential trade entries.
True Range Calculation:
The script calculates a modified or unmodified True Range (TR) based on the ATR period and the previous highs, lows, and closes of the asset. This value is used to determine the trailing stop levels.
Trend Calculation:
The script uses a "Wild Moving Average" (Wild_ma) to smooth the True Range over the given period (ATRPeriod) and determine the stop loss levels. These are referred to as TrendUp and TrendDown.
TrendUp: The level above the current price, acting as the upper stop loss.
TrendDown: The level below the current price, acting as the lower stop loss.
The trend is set to 1 (bullish) or -1 (bearish) based on price action relative to these levels.
Fibonacci Levels:
Fibonacci levels are calculated between the trailing stop (trail) and the exit point (ex).
Fib1 (61.8%), Fib2 (78.6%), and Fib3 (88.6%) are plotted to provide potential entry levels during up or down trends.
The Fibonacci levels are filled with colors depending on whether the trend is bullish (green) or bearish (red).
Entry/Exit Signals:
The script tracks when the price crosses above or below these Fibonacci levels. Specifically:
l1, l2, l3 are conditions when the price crosses below the Fibonacci levels (long entries).
s1, s2, s3 are conditions when the price crosses above the Fibonacci levels (short entries).
Buy and Sell Indicators:
The script detects when the trend changes (from bullish to bearish or vice versa) and plots indicators using shapes (shape.triangledown for a trend change to red/bearish, and shape.triangleup for a trend change to green/bullish).
Plotting:
Fibonacci levels are plotted on the chart with different colors depending on whether the trend is bullish or bearish.
Additional shapes are plotted at entry points and trend changes, with options to show or hide these shapes via the show_fib_entries boolean.
Summary of Key Features:
Trailing Stop Levels: Uses a dynamic trailing stop based on ATR and price movement.
Fibonacci Entry/Exit Levels: Shows key Fibonacci retracement levels for trade entries.
Trend Detection: Uses price action and trailing stops to determine if the market is in an uptrend or downtrend.
Custom Entry Signals: Generates entry signals based on Fibonacci level crossovers.
9:30 & 9:45 Candle Analysis with Extended LinesAnalyze the 9:30 AM and 9:45 AM candles on 15 minute chart and marks the higher high and lower low between these two candles
ICT Trading Concepts - Nasdaq OptimizedIct concept, with Optimizated skills. Plese try diverse option with the filters-
Optimized WPR Strategy with Filters (Debug)Identifying Market Trends:
The 200-period EMA is used to determine the short-term trend of the market.
When the price is above the 200-period EMA, it suggests a potential bullish market and an uptrend, and the strategy will only look for buying opportunities.
When the price is below the 200-period EMA, it suggests a potential bearish market and a downtrend, and the strategy will only look for selling opportunities.
When the 200-period EMA intersects with the price, it indicates that the market may be in a directionless consolidation phase.
Identifying Potential Reversal Points:
The strategy employs two Williams %R (WPR) indicators: one with a 9-period (fast WPR) and another with a 28-period (slow WPR).
WPR is a momentum indicator used to identify overbought and oversold conditions in the market. Its value oscillates between -100 and 0, with values near -100 indicating oversold conditions and values near 0 indicating overbought conditions.
In an uptrend (when the price is above the 200 EMA), the strategy seeks buying opportunities when both WPR indicators cross above -80 (the oversold zone) from below. This is considered a bullish signal, suggesting the market may be about to rebound. Sell signals are ignored at this time.
In a downtrend (when the price is below the 200 EMA), the strategy seeks selling opportunities when both WPR indicators cross below -20 (the overbought zone) from above. This is considered a bearish signal, suggesting the market may be about to reverse downward. Buy signals are ignored at this time.
Summary:
In summary, this strategy first uses the 200-period EMA to determine the overall trend direction of the market. Then, within the confirmed trend direction, it utilizes the simultaneous crossing of the overbought or oversold zones by the dual WPR indicators to identify potential reversal points as entry signals for trading. The strategy emphasizes that trading signals are only valid when both WPR indicators meet the conditions.
BTST Strategy//@version=5
strategy("BTST Strategy", overlay=true)
// --- 1. Initial Screening at 3 PM (Identify 2-3% gain) ---
is3pm = (hour == 15 and minute == 0) // Check if it's 3 PM
priceChangePercentage = (close - close ) / close * 100 // Calculate percentage change from previous close
// Stocks with a gain of 2-3% by 3 PM
isSelectedStock = is3pm and priceChangePercentage >= 2 and priceChangePercentage <= 3
plotshape(series=isSelectedStock, title="Selected Stock", location=location.belowbar, color=color.green, style=shape.labelup, text="Selected")
// --- 2. Daily Candle Analysis (Bullish Patterns) ---
// Bullish Engulfing pattern
bullishEngulfing = close > open and open > close and close > open and open < close
// Morning Star pattern
morningStar = close < open and close < open and close > open and close > open
// Three White Soldiers pattern
threeWhiteSoldiers = close > open and close > open and close > open and close > close and close > close
// Combine the patterns for bullish confirmation
bullishPattern = bullishEngulfing or morningStar or threeWhiteSoldiers
plotshape(series=bullishPattern, title="Bullish Pattern", location=location.belowbar, color=color.green, style=shape.labelup, text="Bullish")
// --- 3. 30-Minute Candle Breakout ---
var float resistanceLevel = na
// Capture the highest point every 30 minutes
if (minute == 30 or minute == 0)
resistanceLevel := high
// Check for breakout above resistance level
breakoutAboveResistance = close > resistanceLevel
plotshape(series=breakoutAboveResistance, title="Breakout Above Resistance", location=location.abovebar, color=color.blue, style=shape.labelup, text="Breakout")
// --- 4. Avoid Over-Extended Stocks (5-10% intraday gains) ---
// Calculate the percentage gain from the open price
percentageGain = (close - open) / open * 100
// Avoid stocks that are up more than 5-10% intraday
avoidOverExtendedStocks = percentageGain > 5 or percentageGain < -10
plotshape(series=avoidOverExtendedStocks, title="Avoid Over-Extended Stocks", location=location.abovebar, color=color.red, style=shape.labeldown, text="Over-Extended")
// --- 5. Second-Day Watchlist (Add shortlisted stocks to watchlist) ---
// We will skip implementing a watchlist in Pine Script because it isn't supported for direct interaction with external systems, but we will mark it in the script visually.
watchlistCondition = isSelectedStock and bullishPattern and not avoidOverExtendedStocks
plotshape(series=watchlistCondition, title="Second Day Watchlist", location=location.belowbar, color=color.purple, style=shape.triangledown, text="Watchlist")
// --- 6. Exit Strategy - Pre-Market & Opening Observation ---
// This part requires real-time data and pre-market data, which isn't supported directly in Pine Script
// But, we can simulate exit strategy by showing potential exit points based on the gap-up opening:
gapUpOpening = open > close * 1.02 // If the stock opens 2% above the previous close
hold15Min = gapUpOpening and close > low // Hold if price doesn't break the previous low
plotshape(series=hold15Min, title="Gap-Up Hold for 15 Minutes", location=location.abovebar, color=color.blue, style=shape.triangledown, text="Hold")
// --- 7. Buy and Sell Triggers (Strategy) ---
// Define conditions for the buy trigger
buySignal = bullishPattern and isSelectedStock and not avoidOverExtendedStocks
// Buy when the conditions are met
if buySignal
strategy.entry("Buy", strategy.long)
// Define conditions for the sell trigger
sellSignal = breakoutAboveResistance and not avoidOverExtendedStocks
// Sell when the breakout above resistance condition is met
if sellSignal
strategy.close("Buy")
// --- Alerts ---
// Alerts for Buy Signal based on 0.5% price movement
alertcondition(buySignal, title="Buy Signal", message="Buy Signal: Confirmed Bullish Pattern and 2-3% price increase by 3 PM!")
// Alerts for Sell Signal based on Breakout and other conditions
alertcondition(sellSignal, title="Sell Signal", message="Sell Signal: Breakout above resistance!")
TheStrat: Failed 2's TheStrat: Failed 2's
Description:
This indicator identifies Failed 2-Up and Failed 2-Down patterns based on The Strat methodology. A Failed 2-Up (2uF) occurs when a candle breaks the previous high but closes below its open, indicating potential bearish reversal. A Failed 2-Down (2dF) occurs when a candle breaks the previous low but closes above its open, signaling a possible bullish reversal.
🔹 Features:
✅ Real-time Signal Plots:
Failed 2-Up: Orange downward label above bars.
Failed 2-Down: Blue upward label below bars.
✅ Alerts:
Get notified when a Failed 2-Up or Failed 2-Down is confirmed.
✅ Customizable Settings:
Color: Modify the colors of the signals to match your chart style.
Character Shape: Adjust shape styles for better visibility.
This tool is useful for traders following The Strat principles to spot potential trend reversals and execute trades with confidence. 🚀
#TheStrat #Failed2s #TradingView #PriceAction #Reversals
Close/ATR Filter//@version=5
indicator("Close/ATR Filter", overlay=false)
// تنظیمات ورودی
atrPeriod = input.int(14, title="ATR Period")
minRatio = input.float(10, title="Minimum Close/ATR Ratio")
maxRatio = input.float(50, title="Maximum Close/ATR Ratio")
// محاسبه ATR
atrValue = ta.atr(atrPeriod)
// محاسبه نسبت Close/ATR
closeAtrRatio = close / atrValue
// اعمال فیلتر
filterCondition = closeAtrRatio >= minRatio and closeAtrRatio <= maxRatio
// نمایش سیگنالها
plot(closeAtrRatio, title="Close/ATR Ratio", color=color.blue)
plotshape(series=filterCondition, title="Filtered Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
Highest High & Lowest Low of 2nd/3rd Candle - Every DayHighest High & Lowest Low of 2nd/3rd Candle - Every Day
Vinod's Indicator//@version=5
indicator("Vinod's Indicator", overlay=true)
// User Input to Show/Hide Candlestick Pattern Names
showPatternNames = input(true, title="Show Pattern Names")
// Define different thresholds for stocks and indices
stockThreshold = 0.38 // Percentage for stocks
niftyThreshold = 20 // Points for Nifty
bankNiftyThreshold = 100 // Points for Bank Nifty
sensexThreshold = 200 // Points for Sensex
// Identify if the symbol is an index or stock
isNifty = syminfo.ticker == "NIFTY"
isBankNifty = syminfo.ticker == "BANKNIFTY"
isSensex = syminfo.ticker == "SENSEX"
isStock = not (isNifty or isBankNifty or isSensex)
// Determine price movement thresholds based on symbol type
threshold = isNifty ? niftyThreshold : isBankNifty ? bankNiftyThreshold : isSensex ? sensexThreshold : close * stockThreshold / 100
// Calculate price movement condition
priceChange = close - close
validBuyCondition = priceChange >= threshold
validSellCondition = priceChange <= -threshold
// --- 2. Candlestick Patterns ---
bullishEngulfing = close > open and open > close and close > open and open < close
morningStar = close < open and close < open and close > open and close > open
threeWhiteSoldiers = close > open and close > open and close > open and close > close and close > close
bearishEngulfing = close < open and open < close and close < open and open > close
eveningStar = close > open and close > open and close < open and close < open
threeBlackCrows = close < open and close < open and close < open and close < close and close < close
shootingStar = (high - close) > 2 * (close - open) and (close - open) / (high - low) < 0.3
// Combine bullish and bearish patterns only when threshold condition is met
bullishPatternValid = validBuyCondition and (bullishEngulfing or morningStar or threeWhiteSoldiers)
bearishPatternValid = validSellCondition and (bearishEngulfing or eveningStar or threeBlackCrows or shootingStar)
// --- 3. Buy and Sell Signals Based on Threshold Condition & Candlestick Pattern ---
buySignal = bullishPatternValid
sellSignal = bearishPatternValid
// Plot Candlestick Patterns when threshold condition is met with optional pattern names
plotshape(series=bullishEngulfing and validBuyCondition and showPatternNames, title="Bullish Engulfing", location=location.belowbar, color=color.green, style=shape.labelup, size=size.tiny, text="BE")
plotshape(series=morningStar and validBuyCondition and showPatternNames, title="Morning Star", location=location.belowbar, color=color.green, style=shape.labelup, size=size.tiny, text="MS")
plotshape(series=threeWhiteSoldiers and validBuyCondition and showPatternNames, title="Three White Soldiers", location=location.belowbar, color=color.green, style=shape.labelup, size=size.tiny, text="TWS")
plotshape(series=bearishEngulfing and validSellCondition and showPatternNames, title="Bearish Engulfing", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.tiny, text="BE")
plotshape(series=eveningStar and validSellCondition and showPatternNames, title="Evening Star", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.tiny, text="ES")
plotshape(series=threeBlackCrows and validSellCondition and showPatternNames, title="Three Black Crows", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.tiny, text="TBC")
plotshape(series=shootingStar and validSellCondition and showPatternNames, title="Shooting Star", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.tiny, text="SS")
// Plot Buy and Sell Signals when both conditions align
plotshape(series=buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.arrowup, size=size.large)
plotshape(series=sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.arrowdown, size=size.large)
// --- Alerts ---
alertcondition(buySignal, title="Buy Signal", message="Buy Signal: Price closed above threshold with a bullish pattern!")
alertcondition(sellSignal, title="Sell Signal", message="Sell Signal: Price dropped below threshold with a bearish pattern!")
CZ Basic Strategy V11. Indicator Components & Features
This indicator includes:
Buy/Sell Signals using ATR-based trailing stop.
Linear Regression Candles (Optional smoothing of price data).
Market Sentiment Dashboard displaying biases across multiple timeframes.
Multiple Moving Averages (MA) with customizable settings.
2. How to Use the Indicator
A. Configuring Buy/Sell Signals
Signal Smoothing: Adjust the "Signal Smoothing" input to control signal sensitivity.
Heikin Ashi Option: Enable “Signals from Heikin Ashi Candles” if you want signals to be based on Heikin Ashi data.
ATR Period: Adjust the ATR period to fine-tune the trailing stop.
Key Value: Increases or decreases sensitivity for trade signals.
🔹 BUY Signal: Appears when the price moves above the ATR trailing stop.
🔻 SELL Signal: Appears when the price moves below the ATR trailing stop.
B. Market Sentiment Dashboard
This dashboard helps you see market trends across different timeframes (1min, 3min, 5min, etc.).
Green = Bullish trend (Upward momentum)
Red = Bearish trend (Downward momentum)
Blue = Neutral (Sideways market)
You can adjust:
Panel Position (Top, middle, or bottom of the chart)
Sentiment Colors (Customizable bullish/bearish colors)
Label Size (Adjust text size for better visibility)
C. Customizing Moving Averages
The script includes four customizable moving averages:
Choose the MA Type: SMA, EMA, WMA, VWMA, etc.
Adjust the Length: Shorter MAs react faster; longer ones smooth out trends.
Set the Color: Differentiate each MA visually.
You can enable or disable each MA as needed.
3. Alerts & Notifications
The script provides buy/sell alerts whenever a new signal is detected.
Alerts are also set for market sentiment changes on multiple timeframes.
To activate:
Go to Alerts in TradingView.
Select "CZ Basic Strategy Signal" to get notified of buy/sell conditions.
Set alerts for sentiment shifts in different timeframes.
4. Recommended Trading Approach
Trend Confirmation: Use MAs and sentiment dashboard to validate trades.
Avoid False Signals: Increase the ATR period for better filtering.
Timeframe Selection: The strategy works on all timeframes but is best tested on 15m, 1H, and 4H.
5. Summary
✅ Use Buy/Sell signals to identify trade entries.
✅ Monitor the Market Sentiment Dashboard for trend direction across timeframes.
✅ Utilize customizable Moving Averages for trend confirmation.
✅ Set up alerts to receive real-time notifications of trade opportunities.
HSI Futures Big CandleThis Pine Script indicator is designed to help traders identify and highlight significant candlestick patterns at specific times during the Hong Kong Time (HKT) market sessions. It focuses on detecting large bullish or bearish candles based on user-defined criteria, such as price gaps and volume thresholds, and provides clear visual markers and detailed labels to make key market movements easy to spot.
這個 Pine Script 指標專為交易者設計,旨在幫助識別香港時間(HKT)市場時段內特定時間點的重要燭台模式。它能檢測大陽燭或大陰燭,並根據用戶設定的條件(如價格差距和成交量)進行篩選,同時提供視覺標記和詳細標籤,讓交易者輕鬆掌握市場的關鍵動向。
Time-Based Filtering
the options in the "Select Time to Filter" dropdown menu:
"0915": Only show large bullish and bearish candles at HKT 09:15.
"0930": Only show large bullish and bearish candles at HKT 09:30.
"0915 & 0930": Show large bullish and bearish candles at both HKT 09:15 and 09:30.
"Day Session": Show large bullish and bearish candles during the Day Session (HKT 09:15 to 16:29).
"Night Session": Show large bullish and bearish candles during the Night Session (HKT 17:30 to 02:59).
"All Day": Show large bullish and bearish candles at all times.
時間篩選
"Select Time to Filter" 下拉選單,提供以下選項:
"0915":僅顯示 HKT 09:15 的大陽燭和大陰燭。
"0930":僅顯示 HKT 09:30 的大陽燭和大陰燭。
"0915 & 0930":顯示 HKT 09:15 和 09:30 的大陽燭和大陰燭。
"Day Session":顯示 HKT 09:15 至 16:29 的大陽燭和大陰燭。
"Night Session":顯示 HKT 17:30 至 02:59 的大陽燭和大陰燭。
"All Day":顯示所有時間的大陽燭和大陰燭。
Visual Tools:
Plots a green upward triangle for large bullish candles and a red downward triangle for large bearish candles.
Adds a detailed label to each qualifying candle, showing:
Candle type (Bullish or Bearish)
Time in HKT (e.g., "09:15")
Open price
Price difference (Close - Open)
Close price
Midpoint price
Volume
視覺化工具
大陽燭:顯示綠色上三角形。
大陰燭:顯示紅色下三角形。
在符合條件的燭台上附加標籤,顯示以下資訊:
燭台類型(Bullish 或 Bearish)
HKT 時間(如「09:15」)
開盤價
價格差異(收盤價 - 開盤價)
收盤價
中間價
成交量
US Day Session Previous OHLCThis indicator is designed for US Market,
which shows the previous day session OHLC.
** Work ONLY in 1/3/5/15/30 minutes timeframe
** Default: Daylight Saving Time (DST)
** Untick the DST checkbox for Winter Time
CRT Strategy at Support and ResistanceSupport and Resistance Detection:
Detects support when the current low equals the 4-hour low and the previous low is higher.
Detects resistance when the current high equals the 4-hour high and the previous high is lower.
Horizontal Lines and Labels:
Small horizontal lines are plotted at support and resistance levels using line.new.
Labels ("S" for support and "R" for resistance) are added for better visibility.
Buy/Sell Signals:
Buy signals are generated at support levels.
Sell signals are generated at resistance levels.
Signals are marked on the chart using plotshape.
Alerts:
Optional alerts are added for buy and sell signals. You can enable these in TradingView to get notified when a signal is generated.
Imbalance DetectorThe code uses a simple method to detect a Fair Value Gap (FVG) or imbalance by analyzing three consecutive candles:
Candle 1 (two candles ago)
Candle 2 (previous candle)
Candle 3 (current candle)
The logic for identifying an imbalance is based on the gaps between the candles. Specifically, it checks for one of these conditions:
Bullish Imbalance (FVG Up)
If the low of Candle 2 is higher than the high of Candle 1 and the high of Candle 3.
This suggests aggressive buying pressure, leaving an imbalance to the upside.
Bearish Imbalance (FVG Down)
If the high of Candle 2 is lower than the low of Candle 1 and the low of Candle 3.
This indicates strong selling pressure, leaving an imbalance to the downside.
📊 Visual Representation on the Chart
When an imbalance is detected, a small red triangle (plotshape) will appear on the chart above or below the candle.
The alert will trigger when the imbalance condition is true.
🚀 How to Spot the Candle
When you receive an alert, check the time of the alert and locate the corresponding candle on your 15-minute chart.
The candle marked with a red triangle is the one that triggered the alert.
Verify if it formed a Fair Value Gap by looking at the gap between the first and third candles compared to the middle candle (Candle 2).
You may also observe if the market is likely to retrace to fill the gap, which is a common price behavior.
⚙️ Criteria Summary (Simple Explanation)
Bullish Imbalance → low2 > high1 && low2 > high3
Bearish Imbalance → high2 < low1 && high2 < low3
Where:
low2 and high2 = Previous candle (Candle 2)
low1 and high1 = Candle before that (Candle 1)
low3 and high3 = Current candle (Candle 3)
👉 Example Scenario:
Candle 1 High = 1.1200, Low = 1.1180
Candle 2 High = 1.1225, Low = 1.1210
Candle 3 High = 1.1230, Low = 1.1215
Imbalance Detected: Candle 2 has a low higher than both Candle 1’s high and Candle 3’s low.