3 Consecutive Same Color CandlesThis TradingView Pine Script detects when three consecutive candlesticks are either all bullish (green) or all bearish (red). It plots a triangle marker above or below the candle to visually signal the pattern and optionally triggers alerts.
How It Works:
A green signal (triangle up) appears below the third candle if the last 3 candles closed higher than they opened (bullish).
A red signal (triangle down) appears above the third candle if the last 3 candles closed lower than they opened (bearish).
Alerts can be set up to notify you immediately when the pattern forms.
Use Case on the 10-Minute Chart:
On the 10-minute chart, this script helps you spot short-term momentum buildups in either direction.
Bullish Signal (3 Green Candles):
Suggests buyers are gaining control.
Can be used to:
Enter breakout trades
Confirm trend continuation
Prepare for scalp entries or momentum trades
Bearish Signal (3 Red Candles):
Indicates sellers are applying pressure.
Can help:
Spot pullbacks or trend reversals
Set up for short positions
Warn of potential breakdowns
Example Trading Ideas:
Pair with EMA or support/resistance for confirmation.
Use as a momentum filter in scalping systems.
Combine with volume or RSI divergence to gauge strength or exhaustion.
指標和策略
Auto Intelligence Selective Moving Average(AI/MA)# 🤖 Auto Intelligence Moving Average Strategy (AI/MA)
**AI/MA** is a state-adaptive moving average crossover strategy designed to **maximize returns from golden cross / death cross logic** by intelligently switching between different MA types and parameters based on market conditions.
---
## 🎯 Objective
To build a moving average crossover strategy that:
- **Adapts dynamically** to market regimes (trend vs range, rising vs falling)
- **Switches intelligently** between SMA, EMA, RMA, and HMA
- **Maximizes cumulative return** under realistic backtesting
---
## 🧪 materials amd methods
- **MA Types Considered**: SMA, EMA, RMA, HMA
- **Parameter Ranges**: Periods from 5 to 40
- **Market Conditions Classification**:
- Based on the slope of a central SMA(20) line
- And the relative position of price to the central line
- Resulting in 4 regimes: A (Bull), B (Pullback), C (Rebound), D (Bear)
- **Optimization Dataset**:
- **Bybit BTCUSDT.P**
- **1-hour candles**
- **2024 full-year**
- **Search Process**:
- **Random search**: 200 parameter combinations
- Evaluated by:
- `Cumulative PnL`
- `Sharpe Ratio`
- `Max Drawdown`
- `R² of linear regression on cumulative PnL`
- **Implementation**:
- Optimization performed in **Python (Pandas + Matplotlib + Optuna-like logic)**
- Final parameters ported to **Pine Script (v5)** for TradingView backtesting
---
## 📈 Performance Highlights (on optimization set)
| Timeframe | Return (%) | Notes |
|-----------|------------|----------------------------|
| 6H | +1731% | Strongest performance |
| 1D | +1691% | Excellent trend capture |
| 12H | +1438% | Balance of trend/range |
| 5min | +27.3% | Even survives scalping |
| 1min | +9.34% | Robust against noise |
- Leverage: 100x
- Position size: 100%
- Fees: 0.055%
- Margin calls: **none** 🎯
---
## 🛠 Technology Stack
- `Python` for data handling and optimization
- `Pine Script v5` for implementation and visualization
- Fully state-aware strategy, modular and extendable
---
## ✨ Final Words
This strategy is **not curve-fitted**, **not over-parameterized**, and has been validated across multiple timeframes. If you're a fan of dynamic, intelligent technical systems, feel free to use and expand it.
💡 The future of simple-yet-smart trading begins here.
SMCX Morning Signal (v6) - Previous Day Confirmed (non-repaint)Paints (no repaint) either a buy or not buy signal for every day based on 3 conditions that pretty accurately predict a green candle day, and it's been tested accurate on just about anything. The 3 conditions are price above 4 hour vwap, price above 8 hour vwap, and 4 hour rvol > 1. We can change the title but I labeled it SMCX morning signal because I was originally trying to shark big moves for SMCX, but then when I got the indicator to work, I saw how rare a green signal was, which I suppose it should be, I needed to backtest it across a wide range of stocks and ETFs. The results were incredible (have stats in a spreadsheet that ranks which leveraged ETFs I should check a signal for by day of the week). Would be great to have this officially published. We could call it VWAP and RVOL market structure confirmation signal.
CandelaCharts - HTF Sweeps📝 Overview
This indicator lets you overlay a higher timeframe (HTF) onto your current chart, giving you a clearer view of broader market movements without switching timeframes.
This indicator also detects liquidity sweeps and plots them on both the higher timeframe (HTF) and the current lower timeframe (LTF), helping traders clearly spot potential reversal points. It adds LTF dividers for better structure clarity, making it easier to align with HTF shifts and refine entry timing with greater precision.
📦 Features
This indicator identifies price sweeps and their invalidations, helping traders spot potential liquidity grabs and failed breakout attempts.
Overlay a configurable higher timeframe (HTF) on the current chart
Detects and plots liquidity sweeps on both HTF and LTF
Adds lower timeframe (LTF) dividers for improved structure clarity
Ideal for ICT-style top-down analysis and precision entries without switching charts
⚙️ Settings
Customize the indicator to suit your strategy. Alert options are also available, so you can stay informed when key market events are triggered.
Timeframes: Select the higher timeframe (HTF) to overlay on your current chart.
HTF Coloring: Customize the color scheme for HTF candles.
HTF Offset: Space of HTF Candles and current chart.
HTF Size: Adjust the size of HTF candles.
HTF Labels: Toggle labels for HTF.
LTF H/L Line: Show or hide high/low lines from the lower timeframe.
LTF O/C Line: Display open/close lines from the lower timeframe.
Sweep: Enable detection and plotting of liquidity sweeps.
I-sweep: Toggle invalidated sweep detection.
Alerts: Enable Sweep Formation or Invalidation alerts
⚡️ Showcase
See the indicator applied in live market scenarios, illustrating how sweep detections and invalidations unfold on various charts.
HTF Candles
HTF Sweeps
LTF Sweeps
Invalidated Sweeps
🚨 Alerts
This indicator includes built-in alert functionality to keep you informed of key market events in real time. It supports the following customizable alerts on TradingView:
Sweep Detection: Notifies you when a price sweep is detected—either a liquidity sweep above recent highs or below recent lows. This can be a strong signal of potential reversals or liquidity grabs by larger market participants.
Sweep Invalidation: Alerts you when a previously detected sweep becomes invalidated due to price action moving beyond a defined threshold. This helps traders stay adaptive and avoid acting on outdated signals.
These alerts are fully integrated with TradingView’s native alert system, so you can receive notifications via app, email, or pop-up—ensuring you're always up to date, even when you're away from the chart.
⚠️ Disclaimer
Trading involves significant risk, and many participants may incur losses. The content on this site is not intended as financial advice and should not be interpreted as such. Decisions to buy, sell, hold, or trade securities, commodities, or other financial instruments carry inherent risks and are best made with guidance from qualified financial professionals. Past performance is not indicative of future results.
CandleTrack Pro | Pure Price Action Trend Detection CandleTrack Pro | Pure Price Action Trend Detection with Smart Candle Coloring
📝 Description:
CandleTrack Pro is a clean, lightweight trend-detection tool that uses only candle structure and ATR-based logic to determine market direction — no indicators, no overlays, just pure price action.
🔍 Features:
✅ Smart Candle-Based Trend Detection
Uses dynamic ATR thresholds to identify trend shifts with precision.
✅ Doji Protection Logic
Automatically filters indecision candles to avoid whipsaws and false signals.
✅ Dynamic Bull/Bear Color Coding
Bullish candles are colored green, bearish candles are colored red — see the trend instantly.
✅ No Noise, No Lag
No moving averages, no smoothing — just real-time decision-making power based on price itself.
📈 Ideal For:
Price action purists
Scalpers and intraday traders
Swing traders looking for clear visual bias
─────────────────────────────────────────────────────────────
Disclaimer:
This indicator is provided for educational and informational purposes only and should not be considered as financial or investment advice. The tool is designed to assist with technical analysis, but it does not guarantee any specific results or outcomes. All trading and investment decisions are made at your own risk. Past performance is not indicative of future results. Always do your own research and consult with a qualified financial advisor before making any trading decisions. The author accepts no liability for any losses or damages resulting from the use of this script. By using this indicator, you acknowledge and accept these terms.
─────────────────────────────────────────────────────────────
MA Signal IndicatorMA Signal Indicator
The MA Signal Indicator is a customizable designed to identify potential trading opportunities based on price interactions with a Simple Moving Average (SMA). It incorporates risk management features such as stop-loss (SL), take-profit (TP), and breakeven levels, calculated using the Average True Range (ATR). The indicator is visually intuitive, overlaying trade signals, price levels, and colored zones directly on the chart.
Key Features:
1. Moving Average-Based Signals:
• Generates buy (long) signals when the price crosses above a user-defined SMA (default: 55 periods).
• Generates sell (short) signals when the price crosses below the SMA.
• Long and short trades can be independently enabled or disabled via input settings.
2. Risk Management:
• Stop-Loss (SL): Set as a multiple of the ATR (default: 1x ATR) below the entry price for long trades or above for short trades.
• Take-Profit (TP): Set as a multiple of the ATR (default: 5x ATR) above the entry price for long trades or below for short trades.
• Breakeven Level: A trigger level (default: 2x ATR) where traders may choose to move their stop-loss to breakeven, optionally displayed on the chart.
3. Visual Feedback:
• SMA Line: Plotted in orange (default: 55-period SMA) for trend reference.
• Trade Zone: Highlights the area between the stop-loss and take-profit levels with a semi-transparent green (long) or red (short) background.
• Price Lines: Displays entry price (white), stop-loss (red), take-profit (green), and breakeven level (gray, optional) as horizontal lines during active trades.
• Signal Markers: Triangular markers indicate entry points (green triangle up for long, red triangle down for short).
• Exit Markers: Labels show when a trade hits the take-profit (green checkmark) or stop-loss (red cross).
4. Trade Logic:
• Only one trade is active at a time (long or short).
• Trades are exited when either the stop-loss or take-profit is hit, resetting the indicator for the next signal.
• Ensures signals are only triggered when not already in a trade, avoiding duplicate entries.
Inputs:
• MA Period: Length of the SMA (default: 55).
• ATR Period: Period for ATR calculation (default: 5).
• SL Multiplier: ATR multiplier for stop-loss (default: 1.0).
• TP Multiplier: ATR multiplier for take-profit (default: 5.0).
• Move to Breakeven After: ATR multiplier for breakeven trigger (default: 2.0).
• Show Break Even Line: Option to display the breakeven level (default: true).
• Allow Long Trades: Enable/disable long signals (default: true).
• Allow Short Trades: Enable/disable short signals (default: true).
Use Case:
This indicator is ideal for trend-following traders who want a clear, visual system for entering and exiting trades based on SMA crossovers, with predefined risk and reward levels. It suits both manual and automated trading strategies, providing flexibility to adjust parameters for different markets or timeframes.
Notes:
• The indicator is overlaid on the price chart for easy integration with other analysis tools.
• Users should test and adjust parameters (e.g., MA length, ATR multipliers) to suit their trading style and market conditions.
• The breakeven line is a visual guide; manual adjustment of stops is required as the indicator does not automatically modify trade positions.
This indicator provides a robust framework for disciplined trading with clear entry, exit, and risk management visuals.
ATR Trend Strategy + KAMA FilterATR Trend Strategy with XMA KAMA Filter
Strategy Description
This strategy combines a dynamic ATR trailing stop with an XMA KAMA filter to precisely detect trends and generate reliable entry signals.
It uses a two-step trend confirmation system:
1️⃣ ATR Trailing Stop
Based on the Average True Range (ATR), this trailing stop automatically adapts to market volatility.
It determines whether the market is in a bullish or bearish phase by comparing the current price to the ATR trailing stop level.
2️⃣ KAMA Filter (XMA Version)
KAMA (Kaufman Adaptive Moving Average) provides an additional trend filter.
This XMA version of KAMA avoids the traditional fast/slow parameters and instead dynamically calculates the ratio of signal to market "noise", helping to reduce false signals and over-sensitivity.
How It Works
Long Signal:
Price is above both the ATR trailing stop and the KAMA (XMA) line.
Short Signal:
Price is below both the ATR trailing stop and the KAMA (XMA) line.
What Makes This Strategy Different?
Unlike many classic strategies that rely on simple moving averages, this system uses an adaptive KAMA filter that responds better to changing market conditions and volatility.
The ATR trailing stop automatically adjusts to current market volatility, providing an extra layer of protection against false breakouts.
By combining these tools, this strategy offers:
Precise trend filtering
Avoidance of false breakouts and noise
Dynamic adjustment to market conditions
How to Use
Apply the strategy to any market chart (Forex, stocks, crypto, indices, etc.)
Adjust the ATR and KAMA parameters to match your trading plan
Use the TradingView Strategy Tester to evaluate performance before live trading
Who Is This For?
Swing traders and trend followers
Traders looking for clean, filtered signals with reduced noise
Medium-term traders seeking a system that adapts to market dynamics
Additional Info: Heikin Ashi Compatibility
This strategy is fully compatible with Heikin Ashi candles.
By applying it to a chart with Heikin Ashi candles, traders can further reduce market noise and enhance trend visualization.
The combination of ATR trailing stop + XMA KAMA filter + Heikin Ashi smoothing provides an even cleaner trend-following system, minimizing false signals and improving decision-making clarity.
SCPEM - Socionomic Crypto Peak Model (0-85 Scale)SCPEM Indicator Overview
The SCPEM (Socionomic Crypto Peak Evaluation Model) indicator is a TradingView tool designed to approximate cycle peaks in cryptocurrency markets using socionomic theory, which links market behavior to collective social mood. It generates a score from 0-85 (where 85 signals extreme euphoria and high reversal risk) and plots it as a blue line on the chart for visual backtesting and real-time analysis.
#### How It Works
The indicator uses technical proxies to estimate social mood factors, as Pine Script cannot fetch external data like sentiment indices or social media directly. It calculates a weighted composite score on each bar:
- Proxies derive from price, volume, and volatility data.
- The raw sum of factor scores (max ~28) is normalized to 0-85.
- The score updates historically for backtesting, showing mood progression over time.
- Alerts trigger if the score exceeds 60, indicating high peak probability.
Users can adjust inputs (e.g., lengths for RSI or pivots) to fine-tune for different assets or timeframes.
Metrics Used (Technical Proxies)
Crypto-Specific Sentiment
Approximated by RSI (overbought levels indicate greed).
Social Media Euphoria
Based on volume relative to its SMA (spikes suggest herding/FOMO).
Broader Social Mood Proxies
Derived from ATR volatility (high values signal uncertain/mixed mood).
Search and Cultural Interest Proxied by OBV trend (rising accumulation implies growing interest).
Socionomic Wildcard
Uses Bollinger Band width (expansion for positive mood, contraction for negative).
Elliott Wave Position
Counts recent price pivots (more swings indicate later wave stages and exhaustion).
LiliALHUNTERSystem_v2📚 **Library: LiliALHUNTERSystem_v2**
This library provides a powerful target management system for Pine Script developers.
It includes advanced calculators for EMA, RMA, and Supertrend, and introduces a central `createTargets()` function to dynamically render target lines and labels based on long/short trade logic.
🛠️ **Main Features:**
– Dynamic horizontal & vertical target lines
– Dual target configuration (Target 1 & Target 2)
– Directional logic via `isLong1`, `isLong2`
– Integrated Supertrend validation
– Visual dashboard and label display
– Works seamlessly with custom indicators
🎯 **Purpose:**
The `LiliALHUNTERSystem_v2` Library enables Pine coders to manage and visualize targets consistently across all trading strategies and indicators. It simplifies target logic while maintaining visual clarity and modular usage.
⚠️ **Disclaimer:**
This script is intended for educational and analytical purposes only. It does not constitute financial advice.
Library "LiliALHUNTERSystem_v2"
ema_calc(len, source)
Parameters:
len (simple int)
source (float)
rma_calc(len, source)
Parameters:
len (simple int)
source (float)
supertrend_calc(length, factor)
Parameters:
length (simple int)
factor (float)
createTargets(config, state, source1A, source1B, source2A, source2B)
Parameters:
config (TargetConfig)
state (TargetState)
source1A (float)
source1B (float)
source2A (float)
source2B (float)
showDashboard(state, dashLoc, textSize)
Parameters:
state (TargetState)
dashLoc (string)
textSize (string)
TargetConfig
Fields:
enableTarget1 (series bool)
enableTarget2 (series bool)
isLong1 (series bool)
isLong2 (series bool)
target1Condition (series string)
target2Condition (series string)
target1Color (series color)
target2Color (series color)
target1Style (series string)
target2Style (series string)
distTarget1 (series float)
distTarget2 (series float)
distOptions1 (series string)
distOptions2 (series string)
showLabels (series bool)
showDash (series bool)
TargetState
Fields:
target1LineV (series line)
target1LineH (series line)
target2LineV (series line)
target2LineH (series line)
target1Lbl (series label)
target2Lbl (series label)
target1Active (series bool)
target2Active (series bool)
target1Value (series float)
target2Value (series float)
countTargets1 (series int)
countTgReached1 (series int)
countTargets2 (series int)
countTgReached2 (series int)
Price PivotsThis indicator tracks price pivots and displays the high / low value.
You can select the number of candles to look back.
You can select how many candles range before the next pivot is printed.
Text size and colours are user defined.
LANZ Strategy 5.0 [Backtest]🔷 LANZ Strategy 5.0 — Rule-Based BUY Logic with Time Filter, Session Limits and Auto SL/TP Execution
This is the backtest version of LANZ Strategy 5.0, built as a strategy script to evaluate real performance under fixed intraday conditions. It automatically places BUY and SELL trades based on structured candle confirmation, EMA trend alignment, and session-based filters. The system simulates real-time execution with precise Stop Loss and Take Profit levels.
📌 Built for traders seeking to simulate clean intraday logic with fully automated entries and performance metrics.
🧠 Core Logic & Strategy Conditions
✅ BUY Signal Conditions:
Price is above the EMA200
The last 3 candles are bullish (close > open)
The signal occurs within the defined session window (NY time)
Daily trade limit has not been exceeded
If all are true, a BUY order is executed at market, with SL and TP set immediately.
🔻 SELL Signal Conditions (Optional):
Exactly inverse to BUY (below EMA + 3 bearish candles). Disabled by default.
🕐 Operational Time Filter (New York Time)
You can fully customize your intraday window:
Start Time: e.g., 01:15 NY
End Time: e.g., 16:00 NY
The system evaluates signals only within this range, even across midnight if configured.
🔁 Trade Management System
One trade at a time per signal
Trades include a Stop Loss (SL) and Take Profit (TP) based on pip distance
Trade result is calculated automatically
Each signal is shown with a triangle marker (BUY only, by default)
🧪 Backtest Accuracy
This version uses:
strategy.order() for entries
strategy.exit() for SL and TP
strategy.close_all() at the configured manual closing time
This ensures realistic behavior in the TradingView strategy tester.
⚙️ Flow Summary (Step-by-Step)
On every bar, check:
Is the time within the operational session?
Is the price above the EMA?
Are the last 3 candles bullish?
If conditions met → A BUY trade is opened:
SL = entry – X pips
TP = entry + Y pips
Trade closes:
If SL or TP is hit
Or at the configured manual close time (e.g., 16:00 NY)
📊 Settings Overview
Timeframe: 1-hour (ideal)
SL/TP: Configurable in pips
Max trades/day: User-defined (default = 99 = unlimited)
Manual close: Adjustable by time
Entry type: Market (not limit)
Visuals: Plotshape triangle for BUY entry
👨💻 Credits:
💡 Developed by: LANZ
🧠 Strategy logic & execution: LANZ
✅ Designed for: Clean backtesting, clarity in execution, and intraday logic simulation
LANZ Strategy 5.0🔷 LANZ Strategy 5.0 — Intraday BUY Signals, Dynamic Lot Size per Account, Real-Time Dashboard and Smart Execution
LANZ Strategy 5.0 is a powerful intraday tool designed for traders who need a visual-first, data-backed BUY system, enhanced with risk-aware lot size calculation and a real-time performance dashboard. This indicator intelligently detects strong momentum setups and provides visual and statistical clarity throughout the session.
📌 This is an indicator, not a strategy — It does not place trades automatically but provides precise conditions, alerts, and visual guides to support execution.
🧠 Core Logic & Features
BUY Entry Conditions (Signal Engine)
A BUY signal is triggered when:
The current price is above the EMA200 (trend filter)
The last 3 candles are bullish (candle body close > open)
You are within the defined session window (NY time)
When all conditions are met and you haven’t reached the daily trade limit, a signal appears on the chart and an optional alert is triggered.
Operational Hours Filter (NY Time)
You define:
Start time (e.g., 01:15 NY)
End time (e.g., 16:00 NY)
The system only evaluates and executes signals within this period. If a BUY setup occurs outside the window, it’s ignored. The chart is also highlighted with a transparent teal background to visually show active trading hours.
Lot Size Panel with Per-Account Risk Management
Designed for traders managing multiple accounts or capital sources. You can enable up to 5 accounts, each with:
Its own capital
Its own risk percentage per trade
The system uses the defined SL in pips, plus the instrument’s pip value, to calculate the lot size per account. All values are shown in a dedicated panel at the bottom-right, automatically updating with each new trade.
The emojis (🐣🦊🦁🐲🐳) distinguish each account visually.
Trade Visualization with Customizable Lines
When a signal is triggered:
An Entry Point (EP) line is drawn at the candle’s close.
A Stop Loss (SL) line is placed X pips below the entry.
A Take Profit (TP) line is placed Y pips above the entry.
All three lines are fully customizable in style, color, and thickness. You define how many bars the lines should extend.
Outcome Tracking & Real-Time Dashboard
Each trade outcome is measured:
SL hit = –1.00%
TP hit = +3.00%
Manual close = calculated dynamically based on price at close time
Each result is labeled on the chart near its level, and stored.
The top-right dashboard updates in real time:
✅ Number of trades
📈 Cumulative % gain/loss of the day (color-coded)
Alerts You Can Trust:
You’ll get a Buy Alert when a valid signal is formed
You’ll get a Trade Executed Alert when the visual operation is plotted
You’ll get a SL/TP Hit Alert with price and result
You’ll get a Manual Close Alert if the configured time is reached and the trade is still active
⚙️ Step-by-Step Execution Flow
At every bar, the system checks:
Are we within the session time window?
Is price above EMA?
Are the last 3 candles bullish?
✅ If yes:
A BUY signal is plotted
Entry/SL/TP lines are drawn
Lot sizes are calculated and displayed
Trade is added to the daily count
🕐 At the configured Manual Close time (e.g., 16:00 NY):
If the trade is still open, it's closed
A label is added with the exact result in %
💡 Ideal For:
Intraday traders who operate within fixed time sessions
Traders managing multiple accounts or capital pools
Anyone who wants full visual clarity of every decision point
Traders who appreciate dynamic lot size calculation and clean execution tracking
👨💻 Credits:
💡 Developed by: LANZ
🧠 Strategy concept & execution model: LANZ
🧪 Tested on: 1H charts with visual-only execution
📈 Designed for: Clarity, adaptability, and full intraday control
Apex Edge - VantageApex Edge – Vantage
Quarter-Wick Reversal System | Price Action Based | Non-Repainting | Visual Confirmation Tool
Overview:
Apex Edge – Vantage is a precision price action indicator built to assist traders in identifying high-probability reversal entries — not based on indicators, but on how candles behave at their extremes.
This tool implements a clean, repeatable framework that reflects how I personally trade:
Spot a candle that closes with strong directional intent,
Then wait for a controlled pullback into the outer quarter,
And strike — only if price respects that line.
There’s no magic here — just raw, tactical logic visualized clearly on your chart. It's not designed to predict the market — it's built to respond when price offers you Vantage.
Core Logic:
Dot Detection – Final Quarter Close Candles
A green dot prints below a bullish candle if it closes within the top 25% of its wick-to-wick range.
A red dot prints above a bearish candle if it closes within the bottom 25% of its range.
These dots signify candles that made a strong, deliberate move in one direction — where price was pushed to an extreme and held that extreme into the close. These candles often signal institutional intent or momentum imbalance.
Entry Confirmation – Controlled Wick Rebalance
On the very next candle only, price must wick into the prior dot candle's outer quarter — but must not pass beyond it.
For buy entries, the wick must enter the bottom 25% of the previous green dot candle, but not dip below it.
For sell entries, the wick must reach into the top 25% of the red dot candle, but not exceed it.
This wick into the quarter is seen as a controlled rebalancing — a tactical reaction back into the origin zone before potential continuation.
Arrow Printing – Visual Entry Signal
Once the entry criteria are confirmed, an arrow is printed after the candle closes.
This arrow continues to print on each new candle as long as price does not violate the original entry zone — giving visual confirmation that the trade thesis is still valid.
If price breaks above/below the quarter range, the arrow disappears.
This ongoing confirmation is useful for staying in trades, managing risk, or spotting failed setups early.
Automatic Stop Loss Level
A horizontal Stop Loss line is drawn from the extreme wick of the original dot candle.
For buy entries, SL is placed below the green dot candle's low.
For sell entries, SL is placed above the red dot candle's high.
This provides immediate risk context — perfect for traders using limit orders or looking to scale in.
Coding Logic:
This script uses plotshape() and plot() functions for all visual elements.
Dot candles are identified using quarter-range logic via:
pinescript
Copy
Edit
close >= high - (high - low) * 0.25 // for bullish
close <= low + (high - low) * 0.25 // for bearish
Entry validation logic triggers only on the next candle, using:
pinescript
Copy
Edit
low >= quarterLine and low <= high // for buy entries
high <= quarterLine and high >= low // for sell entries
Arrows and SL lines are plotted only on closed candles, ensuring non-repainting behavior.
alertcondition() is used for real-time alerts on valid buy/sell triggers.
How I Personally Use It:
I wait for a dot to print — this shows directional conviction.
On the next candle, I watch for a tap into the outer quarter.
If the wick meets the criteria and the candle closes, I’ll execute manually at the close of that candle.
As long as the arrow remains on the chart, I know the setup hasn’t been invalidated.
I combine this with market structure, session timing, and liquidity context to build confluence around each trade.
Alerts Included:
Buy Entry Alert: When a green arrow prints (entry confirmed)
Sell Entry Alert: When a red arrow prints (entry confirmed)
These fire once per confirmed signal, allowing you to react in real-time or automate if desired.
Who This Is For:
Manual traders who want clean price-based entries
Anyone who uses market structure, SMC, or liquidity concepts
Traders looking to replace indicators with pure candle logic
Discretionary or semi-systematic traders who want visual tools to guide their decisions
Final Word
Apex Edge – Vantage doesn’t predict price — it shows you where price is offering you control.
This is a surgical tool designed to help you act only when the market gives you a measurable edge — and to stay in the trade as long as that edge holds.
If you're ready to stop chasing trades and start striking from a position of Vantage, then this tool belongs on your chart.
N-Pattern Detector (Advanced Logic)Introduction
The N-Pattern Detector (Advanced Logic) is a powerful Pine Script-based tool designed to identify a specific price structure known as the "N-pattern", which often indicates trend continuation or potential breakout points in the market. This pattern combines zigzag pivot logic, retracement filters, volume confirmation, and trend alignment, offering high-probability trading signals.
It is ideal for traders who want to automate pattern detection while applying smart filters to reduce false signals in various markets — including stocks, forex, crypto, and indices.
What is the N-Pattern?
The N-pattern is a 3-leg price formation consisting of points A-B-C-D. It typically follows this structure:
Bullish N-Pattern:
A → Low Pivot
B → Higher High (Impulse)
C → Higher Low (Retracement)
D → Breakout above B (Confirmation)
Bearish N-Pattern:
A → High Pivot
B → Lower Low (Impulse)
C → Lower High (Retracement)
D → Breakdown below B (Confirmation)
The pattern essentially reflects a trend–pullback–breakout structure, making it suitable for continuation trades.
Key Features
1. Intelligent ZigZag Pivot Detection
Uses pivot highs/lows to define key swing points (A, B, C).
Adjustable ZigZag depth to control pattern sensitivity.
Filters noise and avoids false signals in volatile markets.
2. Retracement Validation
Validates the B→C leg as a proper pullback using Fibonacci-based thresholds.
User-defined min and max retracement settings (e.g., 38.2% to 78.6% of A→B leg).
3. Trend Filter via EMA
Filters patterns based on trend direction using a customizable EMA (e.g., 200 EMA).
Only detects bullish patterns above EMA and bearish patterns below EMA (optional).
4. Volume Confirmation
Ensures that impulse legs (A→B, C→D) are supported by stronger volume than the correction leg (B→C).
Adds another layer of confirmation and reliability to detected patterns.
5. Target Projections
Automatically draws 100% A→B projected target from point C.
Optional Fibonacci extensions at 1.272 and 1.618 levels for take-profit planning.
Visually plotted on the chart with colored dashed/dotted lines.
6. Clear Visuals & Labels
Connects all pattern points with colored lines.
Clearly labels points A, B, C, D on the chart.
Uses customizable colors for bullish and bearish patterns.
Includes real-time alerts when a valid pattern is detected.
How to Use It
Add to Chart
Apply the indicator to any chart and time frame. It works across all asset classes.
Adjust Inputs (Optional)
Set ZigZag Depth to control pivot detection sensitivity.
Define Min/Max Retracement levels to match your trading style.
Enable or disable Trend and Volume filters for cleaner signals.
Customize EMA length (default: 200) for trend validation.
Wait for Pattern Confirmation
The indicator constantly scans for valid N-patterns.
A pattern is confirmed only after point D forms (breakout or breakdown).
You’ll see the full pattern drawn with target levels.
Set Alerts
Alerts trigger automatically on confirmation of a bullish or bearish pattern.
You can customize these in TradingView’s alerts panel.
Option Auto Anchored VWAPThis indicator automatically shows two Anchored VWAP lines.
The first gets placed on the very first candle of the chart.
The second is set on the last or current day you select in the settings.
TeeLek-BestPositionThis indicator is used to indicate the best buying and selling points.
This indicator will calculate the best buying points (blue) and selling points (orange). The working principle is that the blue point is the point where the RSI is Over Sold, the orange point is the point where the RSI is Over Bought. After that, we will use the Highest Line 100 and Lowest Line 100 to filter the points another layer. And because when Over Bought/Over Sold occurs, there will be continuous signals that are repeated, causing confusion. Therefore, there is a feature to leave a time frame. Set the default value to 24 hours. If a signal occurs, it will be left out.
The appropriate point for buying is:
The point where Over Sold occurs and Closes lower than the Lowest Line 100.
Leave a time frame for 24 hours before a new signal occurs.
The appropriate point for selling is:
The point where Over Bought occurs and Closes higher than the Highest Line 100.
Leave a time frame for 24 hours before a new signal occurs.
It helps us to gradually buy and collect/sell for profit easily without confusion.
อินดิเคเตอร์นี้ใช้ สำหรับบอกจุดซื้อจุดขายที่ดีที่สุด
อินดิเคเตอร์นี้ จะคำนวณจุดซื้อ (สีฟ้า) และจุดขาย (สีส้ม) ที่ดีที่สุดมาให้ โดยหลักการทำงาน คือ จุดสีฟ้า คือจุดที่ RSI Over Sold จุดสีส้ม คือจุดที่ RSI Over Bought หลังจากนั้นเราจะใช้เส้น Highest Line 100 และ Lowest Line 100 เพื่อกรองจุดอีกชั้นหนึ่ง และเนื่องจากเมื่อเกิด Over Bought/Over Sold แล้ว มันจะเกิดสัญญาณต่อเนื่องซ้ำๆ ทำให้สับสน จึงได้มีฟีเจอร์ในการเว้นระยะเวลา ตั้งค่าไว้เริ่มต้นที่ 24 ชั่วโมง ถ้าเกิดสัญญาณแล้วก็จะเว้นระยะออกไป
จุดที่เหมาะสมกับการซื้อ คือ
จุดที่เกิด Over Sold และ Close ต่ำกว่าเส้น Lowest Line 100
เว้นระยะไป 24 ชั่วโมงจึงจะเกิดสัญญาณใหม่อีกครั้ง
จุดที่เหมาะสมกับการขาย คือ
จุดที่เกิด Over Bought และ Close สูงกว่าเส้น Highest Line 100
เว้นระยะไป 24 ชั่วโมงจึงจะเกิดสัญญาณใหม่อีกครั้ง
ช่วยให้เราสามารถ ทยอยซื้อเก็บสะสม/ทยอยขายทำกำไร ได้ง่ายไม่สับสน
Sesión Asiatica 5-10 PM México + EMAs + Cruces# Asian Session EMA Crossover Indicator
## Overview
This Pine Script indicator is designed specifically for trading during the Asian session (5-10 PM Mexico time) and focuses on EMA crossover signals with visual markers.
## Key Features
### 1. **Multiple EMAs Display**
- **EMA 8** (Blue line) - Short-term trend
- **EMA 13** (Green line) - Medium-term trend
- **EMA 21** (Yellow line) - Intermediate trend
- **EMA 55** (Red line) - Long-term trend
- Toggle option to show/hide all EMAs
### 2. **Asian Session Focus**
- Configured for Mexico timezone (America/Mexico_City)
- Active trading window: 5:00 PM - 10:00 PM Mexico time
- Crossover signals only trigger during this session
### 3. **EMA 8/13 Crossover Detection**
- **Bullish Signal**: Green triangle (↑) appears below price when EMA 8 crosses above EMA 13
- **Bearish Signal**: Red triangle (↓) appears above price when EMA 8 crosses below EMA 13
- Signals only occur during Asian session hours
### 4. **Alert System**
- Real-time alerts for bullish crossovers
- Real-time alerts for bearish crossovers
- Alerts only fire during Asian session
## Configuration Options
- Customizable EMA periods (default: 8, 13, 21, 55)
- Show/hide EMAs toggle
- Show/hide crossover signals toggle
- Timezone selection (Mexico City, GMT-6, GMT-5)
- Session time adjustment
## Use Case
Ideal for traders who focus on Asian market hours and use EMA crossover strategies for entry signals. The indicator helps identify momentum shifts during the Asian session while filtering out noise from other trading sessions.
MA Deviation
This indicator visualizes the percentage deviation between up to 3 configurable moving averages (MA), helping traders assess trend momentum and potential overextension.
✅ Key Features
Supports multiple MA types: Choose from SMA, EMA, WMA, RMA, VWMA, and HMA.
Set up to 3 custom MAs with different periods.
Plots the deviation (%) between each pair of selected MAs.
Background color highlights extreme deviations (green = strong positive deviation, red = strong negative deviation).
Data Window flag (1 or 0) shows whether background highlight is active.
⚠️ Notes
Deviation percentages are not predictive, but useful for identifying trend strength or market overheating.
Especially useful for trend analysis, not for exact entry signals.
Even if not all lines are shown, the background color may still appear based on the enabled MA comparisons.
このインジケーターは、3本の移動平均線(MA)の乖離率を視覚化し、相場の過熱感やトレンドの強さを判定するためのツールです。
✅ 主な機能
複数の移動平均タイプに対応:SMA, EMA, WMA, RMA, VWMA, HMAから選択可能。
最大3本の移動平均を自由に設定可能。
それぞれのMA間の乖離率(%)をチャートにプロット。
指定した閾値を超えた時に背景色を表示(緑=乖離が正方向に大きい、赤=負方向に大きい)。
データウィンドウ上で「背景表示フラグ」も確認可能(サインが出ているかどうかが数値で確認できます)。
⚠️ 注意事項
乖離率は過去の価格と比較したものであり、将来の価格を保証するものではありません。
短期トレードよりも、トレンドの強弱や過熱感の把握に適しています。
複数のMAを使用しない場合でも、背景色は他の設定されたMAペアで判定されることにご注意ください。
z-score-calkusi-v1.143z-scores incorporate the moment of N look-back bars to allow future price projection.
z-score = (X - mean)/std.deviation ; X = close
z-scores update with each new close print and with each new bar. Each new bar augments the mean and std.deviation for the N bars considered. The old Nth bar falls away from consideration with each new historical bar.
The indicator allows two other options for X: RSI or Moving Average.
NOTE: While trading use the "price" option only.
The other two options are provided for visualisation of RSI and Moving Average as z-score curves.
Use z-scores to identify tops and bottoms in the future as well as intermediate intersections through which a z-score will pass through with each new close and each new bar.
Draw lines from peaks and troughs in the past through intermediate peaks and troughs to identify projected intersections in the future. The most likely intersections are those that are formed from a line that comes from a peak in the past and another line that comes from a trough in the past. Try getting at least two lines from historical peaks and two lines from historical troughs to pass through a future intersection.
Compute the target intersection price in the future by clicking on the z-score indicator header to see a drag-able horizontal line to drag over the intersection. The target price is the last value displayed in the indicator's status bar after the closing price.
When the indicator header is clicked, a white horizontal drag-able line will appear to allow dragging the line over an intersection that has been drawn on the indicator for a future z-score projection and the associated future closing price.
With each new bar that appears, it is necessary to repeat the procedure of clicking the z-score indicator header to be able to drag the drag-able horizontal line to see the new target price for the selected intersection. The projected price will be different from the current close price providing a price arbitrage in time.
New intermediate peaks and troughs that appear require new lines be drawn from the past through the new intermediate peak to find a new intersection in the future and a new projected price. Since z-score curves are sort of cyclical in nature, it is possible to see where one has to locate a future intersection by drawing lines from past peaks and troughs.
Do not get fixated on any one projected price as the market decides which projected price will be realised. All prospective targets should be manually updated with each new bar.
When the z-score plot moves outside a channel comprised of lines that are drawn from the past, be ready to adjust to new market conditions.
z-score plots that move above the zero line indicate price action that is either rising or ranging. Similarly, z-score plots that move below the zero line indicate price action that is either falling or ranging. Be ready to adjust to new market conditions when z-scores move back and forth across the zero line.
A bar with highest absolute z-score for a cycle screams "reversal approaching" and is followed by a bar with a lower absolute z-score where close price tops and bottoms are realised. This can occur either on the next bar or a few bars later.
The indicator also displays the required N for a Normal(0,1) distribution that can be set for finer granularity for the z-score curve.This works with the Confidence Interval (CI) z-score setting. The default z-score is 1.96 for 95% CI.
Common Confidence Interval z-scores to find N for Normal(0,1) with a Margin of Error (MOE) of 1:
70% 1.036
75% 1.150
80% 1.282
85% 1.440
90% 1.645
95% 1.960
98% 2.326
99% 2.576
99.5% 2.807
99.9% 3.291
99.99% 3.891
99.999% 4.417
9-Jun-2025
Added a feature to display price projection labels at z-score levels 3, 2, 1, 0, -1, -2, 3.
This provides a range for prices available at the current time to help decide whether it is worth entering a trade. If the range of prices from say z=|2| to z=|1| is too narrow, then a trade at the current time may not be worth the risk.
Added plot for z-score moving average.
28-Jun-2025
Added Settings option for # of Std.Deviation level Price Labels to display. The default is 3. Min is 2. Max is 6.
This feature allows likelihood assessment for Fibonacci price projections from higher time frames at lower time frames. A Fibonacci price projection that falls outside |3.x| Std.Deviations is not likely.
Added Settings option for Chart Bar Count and Target Label Offset to allow placement of price labels for the standard z-score levels to the right of the window so that these are still visible in the window.
Target Label Offset allows adjustment of placement of Target Price Label in cases when the Target Price Label is either obscured by the price labels for the standard z-score levels or is too far right to be visible in the window.
9-Jul-2025
z-score 1.142 updates:
Displays in the status line before the close price the range for the selected Std. Deviation levels specified in Settings and |z-zMa|.
When |z-zMa| > |avg(z-zMa)| and zMa rising, |z-zMa| and zMa displays in aqua.
When |z-zMa| > |avg(z-zMa)| and zMa falling, |z-zMa| and zMa displays in red.
When |z-zMa| <= |avg(z-zMa)|, z and zMa display in gray.
z usually crosses over zMa when zMa is gray but not always. So if cross-over occurs when zMa is not gray, it implies a strong move in progress.
Practice makes perfect.
Use this indicator at your own risk
Price over VolumeVersion 0.1
Price over Volume Indicator
Description
The Price over Volume indicator calculates the ratio of the closing price to the trading volume (price / volume) for the current chart's symbol and displays it as a histogram in a separate pane. A horizontal zero line is included as a reference to highlight positive and negative values or periods of undefined data (e.g., zero volume). The indicator is designed to help traders analyze the relationship between price movements and trading volume.
Insights Provided
Price-Volume Dynamics: The indicator shows how price per unit of volume fluctuates, offering insights into market efficiency and liquidity. High ratios may indicate low volume relative to price, suggesting potential volatility or thin markets, while low ratios may reflect high volume supporting price stability.
Trend and Momentum Analysis: Spikes or trends in the price-to-volume ratio can signal significant market events, such as buying/selling pressure or low liquidity periods, helping traders identify potential reversals or continuations.
Zero Line Reference: The zero line helps identify periods where the ratio is undefined (e.g., zero volume) or negative (if applicable), aiding in the interpretation of market conditions.
Volume Sensitivity: By normalizing price by volume, the indicator highlights how volume influences price movements, which is useful for assessing the strength of trends or breakouts.
How to Use
Setup: Apply the indicator to any chart with price and volume data (e.g., stocks, cryptocurrencies like BINANCE:BTCUSDT). The histogram appears in a separate pane below the main chart.
Interpretation :
High Ratios: Indicate low trading volume relative to price, potentially signaling overbought conditions or low liquidity. Use with caution in thin markets.
Low Ratios: Suggest high volume supporting price levels, indicating stronger market participation or stability.
Spikes: Watch for sudden increases in the ratio, which may precede volatility or significant price moves.
Zero Line: Periods where the histogram is absent (due to zero volume) indicate no trading activity, useful for identifying illiquid periods.
Trading Applications:
Confirmation Tool: Combine with other indicators (e.g., RSI, MACD) to confirm trend strength. A rising price-to-volume ratio with a price uptrend may indicate weakening volume support, suggesting a potential reversal.
Volume Analysis: Use alongside volume-based indicators (e.g., OBV, VWAP) to assess whether price movements are backed by sufficient volume.
Scalping/Day Trading: Monitor intraday ratio changes to identify high-impact periods with low volume, which may offer short-term trading opportunities.
Customization: Adjust the histogram color or style (e.g., change to line plot) via the Pine Editor to suit your preferences. Consider adding smoothing (e.g., moving average) for cleaner signals.
Notes
Data Requirements: Ensure the chart’s symbol has valid volume data. Symbols with no volume (e.g., some forex pairs) will result in undefined (na) values.
Limitations: The indicator is sensitive to zero-volume periods, which may cause gaps in the histogram. Use on high-liquidity symbols for best results.
Performance: Lightweight and efficient, suitable for all timeframes.
This indicator is ideal for traders seeking to understand the interplay between price and volume, offering a unique perspective on market dynamics for informed trading decisions.
IU Martingale StrategyDESCRIPTION
This strategy is a Martingale-based trading system that enters a long position based on simple candle patterns and doubles the position size after each loss. It tracks the worst-case drawdown using a live risk matrix table to help traders visualize the downside. With clear profit and loss points, auto position sizing, and a risk visualization table, it’s perfect for backtesting the Martingale concept directly on charts.
WHAT IS MARTINGALE SYSTEM?
The Martingale system is a position-sizing strategy where you double your trade size after every loss, aiming to recover all previous losses with a single profitable trade. It assumes that a winning trade will eventually occur. While it can be high-risk, it’s often used in controlled environments or with high probability setups.
USER INPUTS
📦 Starting Position: Initial position size for the first trade
📈 Profit Points: Target profit in price points
📉 Loss Points: Stop loss in price points
📊 Show Risk Matrix Table: Enable or disable a live table showing current streak and risk stats
LONG CONDITION
A long trade is triggered when the current candle closes higher than it opened, and no open position exists. The condition is simple and used to simulate market entry for testing the Martingale logic.
// Entry Condition:
close > open and no existing position
LONG EXIT
Each trade has a fixed stop-loss and take-profit, based on the user's input:
Stop Loss = Entry Price − Loss Points
Take Profit = Entry Price + Profit Points
The exit is handled using strategy.exit() with these dynamic values.
WHY IT IS UNIQUE
🔁 Implements a dynamic Martingale position sizing system
📊 Includes a visual Risk Matrix Table tracking losing streaks, max size, and risk
📈 Automatically resets position size after a win
🧠 Smart use of array to manage loss history and control logic
🎯 Customizable SL and TP for each entry
🎨 Beautiful chart visuals for entry, stop loss, and target levels
HOW USER CAN BENEFIT FROM IT
🧪 Test the sustainability of a Martingale system with real chart data
👁️ Visualize the risks and impact of consecutive losses
📈 Explore risk vs. reward scenarios before deploying in real markets
🧰 Use it as a base template to build more advanced Martingale or grid-based systems
📚 Great for educational purposes to understand the mathematical drawdowns involved in doubling strategies
Disclaimer :
This Video is not financial advice, it's for educational purposes only highlighting the power of coding( pine script) in TradingView, I am not a SEBI-registered advisor. Trading and investing involve risk, and you should consult with a qualified financial advisor before making any trading decisions. I do not guarantee profits or take responsibility for any losses you may incur.
MACD + RSI + SMA Strategy with TP/SLThis strategy combines three technical indicators: MACD, RSI, and Simple Moving Average (SMA) to identify high-probability entry points. It enters trades in the direction of the trend (filtered by SMA), confirms momentum shifts (via MACD crossover), and validates signals with RSI to avoid overbought/oversold conditions.
Key Features:
Directional filter using SMA to align trades with the broader trend.
Momentum validation with MACD crossovers.
Risk control through RSI thresholds and fixed percentage-based Take Profit and Stop Loss levels.
Works for both long and short positions.
Disclaimer: This is a sample strategy for educational purposes only.
Trading involves risk. Use at your own discretion.
You bear full responsibility for any profit or loss.
Trading session High/Low (Lumiere)Trading session High/Low
What it does:
Plots the High and Low for each session (Asia, London, New York) as horizontal zones that “snap” to the first true extreme of the session and then extend right.
Key points:
Snap‑to‑extreme only: Lines don’t draw at the open; they appear only once price makes a new session high or low, and anchor exactly at that bar.
Persistent until next session: Once drawn, each session’s lines stay on the chart after the session ends, and are cleared only when that same session next opens (or when you hide it).
Three configurable sessions:
Asia: 18:00–03:00 (UTC‑4)
London: 03:00–09:30 (UTC‑4)
New York: 09:30–16:00 (UTC‑4)
Customizable appearance:
You can toggle each session on/off, choose its color, and set line width.
The time that is already set on the different sessions is based on the standard session open/close. If you want to change it, it will refer to the NY time, UTC -4.