I_Heikin Ashi CandleWhen apply a strategy to Heikin Ashi Candle chart (HA candle), the strategy will use the open/close/high/low values of the Heikin Ashi candle to calculate the Profit and Loss, hence also affecting the Percent Profitable, Profit Factor, etc., often resulting a unrealistic high Percent Profitable and Profit Factor, which is misleading. But if you want to use the HA candle's values to calculate your indicator / strategy, but pass the normal candle's open/close/high/low values to the strategy to calculate the Profit / Loss, you can do this:
1) set up the main chart to be a normal candle chart
2) use this indicator script to plot a secondary window with indicator looks exactly like a HA-chart
3) to use the HA-candle's open/close/high/low value to calculate whatever indicator you want (you may need to create a separate script if you want to plot this indicator in a separate indicator window)
在腳本中搜尋"如何用wind搜索股票的发行价和份数"
[RS]Temporal Median Price V1EXPERIMENTAL: previous custom time window median price and current time window open price in a neat package :p
(JeanLouisHardy) added option for bar count system, also added a donchian average.
[RS]Temporal Median Price V0EXPERIMENTAL: previous custom time window median price and current time window open price in a neat package :p
ICT killzone essentialsICT Killzone Essentials is a comprehensive all-in-one indicator designed for intraday and swing traders who use ICT and SMT concepts. It combines several advanced tools into a single overlay to streamline your analysis and trading decisions.
Features:
- SMT Divergences: Detects and visually marks divergences between your chart and a comparison symbol using swing pivots. Customizable colors and labels make SMT signals clear and actionable.
- Daily Session Divider: Automatically draws daily session divider lines to help segment and analyze price action by day. Style, color, and thickness are fully adjustable.
- ICT Killzones with Pivots: Highlights key session windows (Asia, London, NY AM, NY Lunch, NY PM) with colored boxes, customizable text, and dynamic session pivots. Session visibility, color, and timeframe filters put you in control.
- Key Levels: Plots important daily, weekly, and monthly opens, previous highs/lows, and midpoints with configurable labeling, coloring, style, and anchoring. Global coloring and shorthand text options available.
This indicator overlays seamlessly and gives you the most essential ICT tools and market structure visuals in one place—making it easier to identify session moves, key levels, and smart money divergences for more informed trading.
Strategy Chameleon [theUltimator5]Have you ever looked at an indicator and wondered to yourself "Is this indicator actually profitable?" Well now you can test it out for yourself with the Strategy Chameleon!
Strategy Chameleon is a versatile, signal-agnostic trading strategy designed to adapt to any external indicator or trading system. Like a chameleon changes colors to match its environment, this strategy adapts to match any buy/sell signals you provide, making it the ultimate backtesting and automation tool for traders who want to test multiple strategies without rewriting code.
🎯 Key Features
1) Connects ANY external indicator's buy/sell signals
Works with RSI, MACD, moving averages, custom indicators, or any Pine Script output
Simply connect your indicator's signal output to the strategy inputs
2) Multiple Stop Loss Types:
Percentage-based stops
ATR (Average True Range) dynamic stops
Fixed point stops
3) Advanced Trailing Stop System:
Percentage trailing
ATR-based trailing
Fixed point trailing
4) Flexible Take Profit Options:
Risk:Reward ratio targeting
Percentage-based profits
ATR-based profits
Fixed point profits
5) Trading Direction Control
Long Only - Bull market strategies
Short Only - Bear market strategies
Both - Full market strategies
6) Time-Based Filtering
Optional trading session restrictions
Customize active trading hours
Perfect for day trading strategies
📈 How It Works
Signal Detection: The strategy monitors your connected buy/sell signals
Entry Logic: Executes trades when signals trigger during valid time periods
Risk Management: Automatically applies your chosen stop loss and take profit levels
Trailing System: Dynamically adjusts stops to lock in profits
Performance Tracking: Real-time statistics table showing win rate and performance
⚙️ Setup Instructions
0) Add indicator you want to test, then add the Strategy to your chart
Connect Your Signals:
imgur.com
Go to strategy settings → Signal Sources
1) Set "Buy Signal Source" to your indicator's buy output
2) Set "Sell Signal Source" to your indicator's sell output
3) Choose table position - This simply changes the table location on the screen
4) Set trading direction preference - Buy only? Sell only? Both directions?
imgur.com
5) Set your preferred stop loss type and level
You can set the stop loss to be either percentage based or ATR and fully configurable.
6) Enable trailing stops if desired
imgur.com
7) Configure take profit settings
8) Toggle time filter to only consider specific time windows or trading sessions.
🚀 Use Cases
Test various indicators to determine feasibility and/or profitability.
Compare different signal sources quickly
Validate trading ideas with consistent risk management
Portfolio Management
Apply uniform risk management across different strategies
Standardize stop loss and take profit rules
Monitor performance consistently
Automation Ready
Built-in alert conditions for automated trading
Compatible with trading bots and webhooks
Easy integration with external systems
⚠️ Important Notes
This strategy requires external signals to function
Default settings use 10% of equity per trade
Pyramiding is disabled (one position at a time)
Strategy calculates on bar close, not every tick
🔗 Integration Examples
Works perfectly with:
RSI strategies (connect RSI > 70 for sells, RSI < 30 for buys)
Moving average crossovers
MACD signal line crosses
Bollinger Band strategies
Custom oscillators and indicators
Multi-timeframe strategies
📋 Default Settings
Position Size: 10% of equity
Stop Loss: 2% percentage-based
Trailing Stop: 1.5% percentage-based (enabled)
Take Profit: Disabled (optional)
Trade Direction: Both long and short
Time Filter: Disabled
No Supply No Demand (NSND) – Volume Spread Analysis ToolThis indicator is designed for traders utilizing Volume Spread Analysis (VSA) techniques. It automatically detects potential No Demand (ND) and No Supply (NS) candles based on volume and price behavior, and confirms them using future price action within a user-defined number of lookahead bars.
Confirmed No Demand (ND): Detected when a bullish candle has volume lower than the previous two bars and is followed by weakness (next highs swept, close below).
Confirmed No Supply (NS): Detected when a bearish candle has volume lower than the previous two bars and is followed by strength (next lows swept, close above).
Adjustable lookahead bars parameter to control the confirmation window.
This tool helps identify potential distribution (ND) and accumulation (NS) areas, providing early signs of market turning points based on professional volume logic. The dot appears next to ND or NS.
Crypto Spot Volume Ratio**Overview**
This TradingView Pine Script v7 indicator computes and visualizes each exchange’s spot‐volume share relative to the average across ten major venues. By plotting ten “volume coefficients” around a baseline of 1, you immediately see which exchanges are trading above or below the aggregate average in each bar (timeframe period).
---
## 1. Data Sources
The script pulls spot trading volume for the current symbol (e.g. BTC/USDT, ETH/USDT, SOL/USDT, etc.) from these ten exchanges:
* Binance
* OKX
* Bybit
* KuCoin
* Gate.io
* HTX
* Kraken (USD pair)
* Coinbase (USD pair)
* Bitstamp (USD pair)
* Bitfinex (USD pair)
For USD-quoted venues (Coinbase, Kraken, Bitstamp, Bitfinex), it automatically converts the symbol suffix from “USDT” to “USD.”
---
## 2. Calculation Steps
1. **Fetch Volumes**
Using `request.security`, the script retrieves `volume` from each exchange’s contract at the chart’s timeframe.
2. **Sum and Average**
* **Total Volume (`sumVol`)** = sum of all ten exchanges’ volumes.
* **Average Volume (`avgVol`)** = `sumVol / 10‘.
3. **Compute Coefficients**
For each exchange *i*,
A coefficient > 1 means that exchange’s volume is above the ten‐exchange average; < 1 means below average.
4. **Rendering**
* **Table**: A horizontal row in the top‐right corner lists each enabled exchange’s coefficient (formatted to two decimals).
* **Plots**: Ten overlaid line plots show each exchange’s coefficient time series. A dashed horizontal line at **1** marks the average baseline.
---
## 3. Configuration Options
In the indicator’s settings panel, you can toggle **“Show …”** for any of the ten exchanges. Disabling an exchange will hide both its table entry and its plotted line—but does **not** change the average calculation (which always divides by 10).
---
## 4. Interpretation & Significance
* **Relative Activity**: By normalizing each venue to the ten‐exchange average, you spot shifts in where volume is concentrated.
* **Liquidity Insights**: Exchanges consistently above 1 may offer deeper liquidity, tighter spreads, or attract more order flow. Those below 1 may lag on volume, signaling lower activity or potential outages.
* **Arbitrage & Flow Monitoring**: Sudden spikes on a particular exchange (coefficient >> 1) can indicate localized buying/selling pressure, useful for spotting arbitrage windows, large order flows, or exchange-specific events.
* **Market Health**: Tracking the dispersion of these coefficients over time gives you a quick visual of how balanced or skewed the overall market activity is across venues.
---
## 5. How It Works in Practice
1. **Attach** this indicator to any USDT or USD spot chart (e.g., BTCUSDT, ETHUSDT).
2. **Observe** which exchange lines rise above the dashed **1** line—those venues are currently trading more volume than the average of the ten.
3. **Use** the table to see exact coefficient values each bar.
4. **Toggle** exchanges on/off to focus on specific venues without affecting the universal average baseline.
By comparing ten exchanges on a single pane, you gain real-time clarity on where crypto liquidity and activity are most intense—and where it temporarily wanes—empowering more informed trading, arbitrage strategies, and market‐structure analysis.
NY Open ATR System - Tick Range Filter### **New York Open ATR System - Brief Overview**
#### **🎯 Core Purpose**
Identifies **high-potential breakout setups** at the New York open (13:30 UTC) by combining:
1. **Volatility filters** (dual ATR periods)
2. **Tick-based range analysis**
3. **Time-specific triggers**
---
### **⚙️ Key Components**
| **Feature** | **Function** |
|---------------------------|-----------------------------------------------------------------------------|
| **ATR Filters** | Dual volatility checks (short + long periods) at 13:25 UTC |
| **Tick Range Limit** | Highlights candles with range < user-defined ticks (default: 150) |
| **Time Precision** | Focuses exclusively on 13:30 UTC weekday candles |
| **Visual Markers** | Yellow highlight + tick count label (e.g., "147/150 ticks") |
| **Info Panel** | Real-time display of settings and current tick count |
---
### **📊 How It Works**
1. **Pre-Open Check (13:25 UTC)**
- Verifies market volatility using 2 ATR values
- Requires both to exceed user-defined thresholds
2. **Open Analysis (13:30 UTC)**
- Measures exact tick count: `(high - low) / instrument_mintick`
- Compares against your max tick limit (adjustable 1-5000)
3. **Visual Trigger**
- Highlights candle yellow if:
```tick_count < your_set_limit```
- Labels show exact performance vs limit (e.g., "142/150 ticks")
---
### **⚡ Trading Signals**
| **Condition** | **Visual Feedback** |
|----------------------------|---------------------------------------------|
| High volatility + tight range | Yellow candle + tick count label |
| All other scenarios | No marking |
---
### **🛠️ Customization**
```pine
// Key Adjustable Parameters:
maxTicks = input.int(150) // Set 1-5000 ticks
atrPeriod1 = input.int(14) // Short ATR (2-5000)
atrPeriod2 = input.int(161) // Long ATR (2-5000)
candleColor = input.color(color.yellow) // Highlight color
```
---
### **💡 Practical Use Cases**
1. **Breakout Anticipation**
- Tight ranges after volatility spikes often precede strong moves
2. **Session Scalping**
- Identify low-range opens for mean-reversion plays
3. **Volatility Filtering**
- Avoid trading when ATR thresholds aren't met
---
### **📈 Suggested Settings**
| **Market** | **Max Ticks** | **ATR Periods** |
|------------------|--------------|----------------|
| Forex (EUR/USD) | 100-200 | 14/161 |
| Stocks (SPY) | 50-120 | 10/200 |
| Crypto (BTC) | 300-500 | 20/100 |
---
### **✅ Benefits**
- **Precision Timing**: Focused on NY open liquidity surge
- **Quantitative Filtering**: Exact tick measurement + volatility thresholds
- **Clean Visuals**: No chart clutter - only marks qualifying candles
- **Adaptable**: Works across all markets and timeframes
This system helps traders spot high-probability breakout setups by combining volatility anticipation with precise range measurement at the market's most liquid opening window.
Session VWAPsThis indicator plots volume-weighted average price (VWAP) lines for three major trading sessions: Tokyo, London, and New York. Each VWAP resets at the start of its session and tracks the average price weighted by volume during that window. You can choose the exact session times, turn individual sessions on or off, and optionally extend each VWAP line until the end of the trading day.
It’s designed to give you a clear view of how price is behaving relative to session-specific value areas. This can help in identifying session overlaps, shifts in price control, or whether price is holding above or below a particular session’s average. The indicator supports futures-style day rollovers and works across markets.
ICT All in One by GtraderICT All-in-One by GTrader – Description
This indicator is designed for traders who follow ICT or Smart Money Concepts. It helps you visualize key market sessions, time-based price levels, and structured macro behaviors in one clean and customizable tool.
The Killzone feature automatically draws session boxes for Asia, London, and New York (including AM, Lunch, and PM sessions). Each box can show the session name, high and low pivots, and can be customized with different colors, transparency levels, and labels.
You can also add horizontal lines at important times like the daily open or New York open. Up to five session open lines can be defined, each with customizable styles, colors, and optional text labels.
In addition, the indicator lets you display vertical time markers. These lines help you track key intraday moments such as killzone entries or important session changes. You can enable up to four of these, each with its own settings.
One of the most powerful features is the macro session tracker. This creates boxes during specific time windows where price action is monitored. It automatically draws the top and bottom price levels during that session and updates them live. It supports up to five macros and works best on lower timeframes like 1-minute, 3-minute, and 5-minute charts.
The entire script respects your selected timezone, so all sessions and times are adjusted accordingly. Everything is customizable—from label sizes and colors to how many days of drawings are shown on your chart.
This script is ideal for traders who rely on time-of-day behavior, structured price action, and ICT methodologies.
Simple DCA Strategy----
### 📌 **Simple DCA Strategy with Backtest Date Filter**
This strategy implements a **Dollar-Cost Averaging (DCA)** approach for long positions, including:
* ✅ **Base Order Entry:** Starts a position with a fixed dollar amount when no position is open.
* 🔁 **Safety Orders:** Buys additional positions when the price drops by a defined percentage, increasing position size with each new entry using a multiplier.
* 🎯 **Take Profit Exit:** Closes all positions when the price reaches a profit target (in % above average entry).
* 🗓️ **Backtest Date Range:** Allows users to specify a custom start and optional end date to run the strategy only within that time window.
* 📊 **Plots:** Visualizes average entry, take profit level, and safety order trigger line.
#### ⚙️ Customizable Inputs:
* Base Order Size (\$)
* Price Deviation for Safety Orders (%)
* Maximum Safety Orders
* Order Size Multiplier
* Take Profit Target (%)
* Start and End Dates for Backtesting
This is a **long-only strategy** and is best used for backtesting performance of DCA-style accumulation under different market conditions.
----
Institutional Sessions Overlay (Asia/London/NY)Institutional Sessions Overlay is a professional TradingView indicator that visually highlights the main trading sessions (Asia, London, and New York) directly on your chart.
Customizable: Easily adjust session start and end times (including minutes) for each market.
Timezone Alignment: Shift session boxes using the timezone offset parameter so sessions match your chart’s timezone exactly.
Clear Visuals: Colored boxes and optional labels display session opens and closes for fast institutional market structure reference.
Toggle Labels: Show or hide session open/close labels with a single click for a clean or detailed look.
Intuitive UI: User-friendly grouped settings for efficient configuration.
This tool is designed for day traders, institutional traders, and anyone who wants to instantly recognize global session timing and ranges for SMC, ICT, and other session-based strategies.
How to use:
Set your chart to your local timezone.
Use the "Session timezone offset" setting if session boxes do not match actual session opens on your chart.
Adjust the hours and minutes for each session as needed.
Enable or disable labels in the “Display” settings group.
Tip: Use the overlay to spot session highs and lows, volatility windows, and institutional liquidity sweeps.
VisionThis indicator helps visually distinguish and analyze the Asian, London, and New York trading sessions. It's a great tool for intraday traders focusing on time-based liquidity zones.
🔧 Features:
Asian range box, London / New York high-low lines with distinct colors.
Customizable time windows, Asian range deviations and colors.
Gold Power Hours Strategy📈 Gold Power Hours Trading Strategy
Trade XAUUSD (Gold) or XAUEUR during the most volatile hours of the New York session, using momentum and trend confirmation, with session-specific risk/reward profiles.
✅ Strategy Rules
🕒 Valid Trading Times ("Power Hours"):
Trades are only taken during high-probability time windows on Tuesdays, Wednesdays, and Thursdays , corresponding to key New York session activity:
Morning Session:
08:00 – 11:00 (NY time)
Afternoon Session:
12:30 – 16:00
19:00 – 22:00
These times align with institutional activity and economic news releases.
📊 Technical Indicators Used:
50-period Simple Moving Average (SMA50):
Identifies the dominant market trend.
14-period Relative Strength Index (RSI):
Measures market momentum with session-adjusted thresholds.
🟩 Buy Signal Criteria:
Price is above the 50-period SMA (bullish trend)
RSI is greater than:
60 during Morning Session
55 during Afternoon Session
Must be during a valid day (Tue–Thu) and Power Hour session
🟥 Sell Signal Criteria:
Price is below the 50-period SMA (bearish trend)
RSI is less than:
40 during Morning Session
45 during Afternoon Session
Must be during a valid day and Power Hour session
🎯 Trade Management Rules:
Morning Session (08:00–11:00)
Stop Loss (SL): 50 pips
Take Profit (TP): 150 pips
Risk–Reward Ratio: 1:3
Afternoon Session (12:30–16:00 & 19:00–22:00)
Stop Loss (SL): 50 pips
Take Profit (TP): up to 100 pips
Risk–Reward Ratio: up to 1:2
⚠️ TP is slightly reduced in the afternoon due to typically lower volatility compared to the morning session.
📺 Visuals & Alerts:
Buy signals: Green triangle plotted below the bar
Sell signals: Red triangle plotted above the bar
SMA50 line: Orange
Valid session background: Light pink
Alerts: Automatic alerts for buy/sell signals
Custom Daily Session Zones by KoenigseggCustom Daily Session Zones
🟣 Description
This indicator displays customizable trading session time zones as background highlights on your chart, on any timeframe you choose. The inline info tooltip provides the precise start and end times of the three largest market sessions—the US, the EU, and ASIA—for quick reference. It provides flexible control over session times for different days of the week, making it ideal for traders who need to visualize specific market hours or trading sessions.
🟣 Key Features
- Flexible Session Configuration: Set a common session time for all days or customize individual sessions for each day of the week
- Per-Day Control: Enable or disable sessions for specific days (Monday through Sunday)
- Color Customization: Choose unique colors for each day's session zones
- UTC Timezone Standard: All session times are defined in UTC to ensure consistency across charts
- Clean Visual Display: Non-intrusive background highlighting that doesn't interfere with price action
🟣 How to Use
- Common Session Mode: Use the default mode to apply the same session time across all enabled days
- Manual Per-Day Mode: Enable "Manual per-day sessions" to set different session times for each day
- Day Selection: Toggle individual days on/off based on your trading schedule
- Color Coding: Customize colors for each day to easily distinguish between different sessions
🟣 Technical Details
- Uses Pine Script v6 for optimal performance
- Implements proper session time detection using TradingView's built-in time functions
- Operates in UTC timezone for all session calculations
- Lightweight code that doesn't impact chart performance
🟣 Use Cases
- Highlight specific trading sessions (London, New York, Tokyo, etc.)
- Mark important market hours for your trading strategy
- Visualize different session overlaps
- Create custom trading time windows
- Track market activity during specific hours
🟣 Compatibility
- Works on all timeframes
- Compatible with all asset classes (Forex, Stocks, Crypto, Futures, etc.)
- Supports all TradingView chart types
- Responsive design that adapts to different screen sizes
🟣 Image Descriptions
- First Image (main image): Shows multiple New York Stock Exchange sessions from 1:30 p.m. to 8:00 p.m. (UTC), on the 15-minute timeframe, with each day’s zone colored differently to demonstrate the indicator’s customizable color settings.
- Second Image: A zoomed‑in fractal chart view of the same New York session on the 15-minute timeframe, illustrating how the background session zone appears even at higher detail levels.
Third Image: A close‑up of the New York session (1:30 p.m. to 8:00 p.m.) on the 3-minute timeframe, reaffirming the consistency of zone highlighting across different zoom levels.
🟣 Future Updates (v2)
In the next release, you’ll be able to define multiple session blocks per day—displaying two distinct colored zones within the same trading day. This will help you visualize when one market session ends and another begins without losing chart clarity.
🟣 Conclusion
This indicator is perfect for traders who need precise control over Market Session visualization and want to maintain a clean, professional chart appearance.
🟣 Disclaimer
This script is provided for educational and illustrative purposes only. It is not financial or trading advice, nor a recommendation to buy or sell any asset. Always conduct your own research and consult a professional before making any trading decisions.
Candles by Day, Time, Month + StatsThis Pine Script allows you to filter and display candles based on:
📅 Specific days of the week
🕒 Custom intraday time ranges (e.g., 9:15 to 10:30)
📆 Selected months
📊 Shows stats for each filtered block:
🔼 Range (High – Low)
📏 Average candle body size
⚙️ Key Features:
✅ Filter by day, time, and month
🎛 Toggle to show/hide the stats label
🟩 Candles are drawn only for selected conditions
📍 Stats label is positioned above session high (adjustable)
⚠️ Important Setup Instructions:
✅ 1. Use it on a blank chart
To avoid overlaying with default candles:
Open the chart of your preferred symbol
Click on the chart type (top toolbar: "Candles", "Bars", etc.)
Select "Blank" from the dropdown (this will hide all native candles)
Apply this indicator
This ensures only the filtered candles from the script are visible.
Adjust for your local timezone
This script uses a hardcoded timezone: "Asia/Kolkata"
If you are in a different timezone, change it to your own (e.g. "America/New_York", "Europe/London", etc.) in all instances of:
time(timeframe.period, "Asia/Kolkata")
timestamp("Asia/Kolkata", ...)
Use Cases:
Opening range behavior on specific weekdays/months
Detecting market anomalies during exact windows
Building visual logs of preferred trade hours
Rolling Log Returns [BackQuant]Rolling Log Returns
The Rolling Log Returns indicator is a versatile tool designed to help traders, quants, and data-driven analysts evaluate the dynamics of price changes using logarithmic return analysis. Widely adopted in quantitative finance, log returns offer several mathematical and statistical advantages over simple returns, making them ideal for backtesting, portfolio optimization, volatility modeling, and risk management.
What Are Log Returns?
In quantitative finance, logarithmic returns are defined as:
ln(Pₜ / Pₜ₋₁)
or for rolling periods:
ln(Pₜ / Pₜ₋ₙ)
where P represents price and n is the rolling lookback window.
Log returns are preferred because:
They are time additive : returns over multiple periods can be summed.
They allow for easier statistical modeling , especially when assuming normally distributed returns.
They behave symmetrically for gains and losses, unlike arithmetic returns.
They normalize percentage changes, making cross-asset or cross-timeframe comparisons more consistent.
Indicator Overview
The Rolling Log Returns indicator computes log returns either on a standard (1-period) basis or using a rolling lookback period , allowing users to adapt it to short-term trading or long-term trend analysis.
It also supports a comparison series , enabling traders to compare the return structure of the main charted asset to another instrument (e.g., SPY, BTC, etc.).
Core Features
✅ Return Modes :
Normal Log Returns : Measures ln(price / price ), ideal for day-to-day return analysis.
Rolling Log Returns : Measures ln(price / price ), highlighting price drift over longer horizons.
✅ Comparison Support :
Compare log returns of the primary instrument to another symbol (like an index or ETF).
Useful for relative performance and market regime analysis .
✅ Moving Averages of Returns :
Smooth noisy return series with customizable MA types: SMA, EMA, WMA, RMA, and Linear Regression.
Applicable to both primary and comparison series.
✅ Conditional Coloring :
Returns > 0 are colored green ; returns < 0 are red .
Comparison series gets its own unique color scheme.
✅ Extreme Return Detection :
Highlight unusually large price moves using upper/lower thresholds.
Visually flags abnormal volatility events such as earnings surprises or macroeconomic shocks.
Quantitative Use Cases
🔍 Return Distribution Analysis :
Gain insight into the statistical properties of asset returns (e.g., skewness, kurtosis, tail behavior).
📉 Risk Management :
Use historical return outliers to define drawdown expectations, stress tests, or VaR simulations.
🔁 Strategy Backtesting :
Apply rolling log returns to momentum or mean-reversion models where compounding and consistent scaling matter.
📊 Market Regime Detection :
Identify periods of consistent overperformance/underperformance relative to a benchmark asset.
📈 Signal Engineering :
Incorporate return deltas, moving average crossover of returns, or threshold-based triggers into machine learning pipelines or rule-based systems.
Recommended Settings
Use Normal mode for high-frequency trading signals.
Use Rolling mode for swing or trend-following strategies.
Compare vs. a broad market index (e.g., SPY or QQQ ) to extract relative strength insights.
Set upper and lower thresholds around ±5% for spotting major volatility days.
Conclusion
The Rolling Log Returns indicator transforms raw price action into a statistically sound return series—equipping traders with a professional-grade lens into market behavior. Whether you're conducting exploratory data analysis, building factor models, or visually scanning for outliers, this indicator integrates seamlessly into a modern quant's toolbox.
Thursday High & Friday Low Breakout (Safe)This TradingView Pine Script indicator is designed to help traders visually track two key situational breakout patterns that occur across the Thursday–Monday trading window. Specifically, it detects:
Whether the high of Thursday has been taken out on Friday, and
Whether the low of Friday has been breached on Monday.
These conditions are based on commonly observed market behaviors where key highs and lows from the previous days often act as liquidity targets or decision points. By identifying these events, traders can better understand the unfolding market structure and anticipate potential follow-through or reversals.
The script stores Thursday's high and Friday's low at the close of each respective day and evaluates the breakout conditions in real-time as new bars are printed. When Friday’s price action exceeds Thursday’s high, an upward-pointing green triangle is plotted above the bar. Conversely, when Monday’s price breaks below Friday’s low, a red downward triangle is plotted below the bar.
Unlike scripts that rely on label.new (which can create compatibility issues on certain platforms or versions), this version uses plotshape() to ensure wide compatibility and reliable visual cues, even on older Pine Script environments. This makes it lightweight, robust, and ideal for traders who want a quick-glance tool without cluttering their charts.
The indicator is best used on 1H, 4H, or daily timeframes to clearly observe the Thursday–Friday–Monday structure. It works well in both trending and consolidating markets as a tool to mark potential liquidity sweeps or break-of-structure setups.
OPR Asia-New-York [Elykia]This Pine Script indicator, called "OPR Asia-New-York ", displays time-based boxes corresponding to two specific trading periods known as OPR (Opening Price Range):
🎯 Purpose of the Indicator:
To visualize two key market time windows (morning and afternoon) as extended boxes, helping with technical analysis around opening ranges.
🕒 Two sessions displayed as boxes:
🔹 Morning OPR:
Default: from 09:00 to 09:15 (configurable)
The box extends until 10:30.
It captures the highest and lowest candle within this interval.
🔸 Afternoon OPR:
Default: from 15:30 to 15:45
The box extends until 17:30.
Follows the same logic as the morning session.
⚙️ Dashboard Options:
Enable or disable the morning or afternoon box individually
Select the timezone (e.g., GMT+2)
Customize all colors (morning/afternoon boxes, median line)
Set your own start/end/extension times for each session
📦 Each box includes:
A colored rectangle showing the price range (high/low)
A dotted median line between the high and low
The box and line extend until the end time defined
🧠 Usefulness for Traders:
Identify liquidity zones or consolidation areas
Trade setups like liquidity grabs, breakouts, or fakeouts around the OPR
Align with ICT methods or scalping strategies based on session behavior
BTC/Fiat Divergence & Spread Monitor📄 BTC/Fiat Divergence & Spread Monitor
This indicator visualizes Bitcoin’s relative performance across multiple fiat currencies and highlights periods of unusual divergence. It helps traders assess which fiat pairs BTC has outperformed or underperformed over a configurable lookback period and monitor the dynamic spread between the strongest and weakest pairs.
Features:
Relative Performance Matrix:
Ranks BTC returns in 6 fiat pairs, displaying a color-coded table of percentage changes and ranks.
Divergence Spread Oscillator:
Calculates the spread between the top and bottom performing pairs and normalizes this using a Z-Score. The oscillator helps identify when fiat pricing divergence is unusually high or compressed.
Dynamic Smoothing:
Optional Hull Moving Average smoothing to reduce noise in the spread signal.
Customizable Inputs:
Lookback period for percent change.
Z-Score normalization window.
Smoothing length.
Symbol selection for each fiat pair.
Visual Mode Toggle:
Switch between relative performance lines and spread oscillator view.
Potential Use Cases:
Fiat Rotation:
Identify which fiat is relatively weak or strong to optimize your exit currency when taking BTC profits.
Volatility Detection:
Use the spread Z-Score to detect periods of high divergence across fiat pairs, signaling macro FX volatility or dislocations.
Regime Analysis:
Track when fiat spreads are converging or expanding, potentially signaling market regime shifts.
Risk Management:
When divergence is extreme (Z-Score > +1), consider reducing position sizing or waiting for reversion.
Disclaimer:
This indicator is provided for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security or asset. Always do your own research and consult a qualified financial professional before making trading decisions. Use at your own risk.
Tip:
Experiment with different lookback periods and smoothing settings to adapt the indicator to your timeframe and trading style.
RSI Divergence (Nikko)RSI Divergence by Nikko
🧠 RSI Divergence Detector — Nikko Edition This script is an enhanced RSI Divergence detector built with Pine Script v6, modified for better visuals and practical usability. It uses linear regression to detect bullish and bearish divergences between the RSI and price action — one of the most reliable early signals in technical analysis.
✅ Improvements from the Original:
- Clean divergence lines using regression fitting.
- Optional label display to reduce clutter (Display Labels toggle).
- Adjustable line thickness (Display Line Width).
- A subtle heatmap background to highlight RSI overbought/oversold zones.
- Uses max accuracy with high calc_bars_count and custom extrapolation window.
🔍 How It Works: The script applies linear regression (least squares method) on both RSI data, and Price (close) data.
It then compares the direction of RSI vs. direction of Price over a set length. If price is making higher highs while RSI makes lower highs, it's a bearish divergence. If price is making lower lows while RSI makes higher lows, it's a bullish divergence. Additional filters (e.g., momentum and slope thresholds) are used to validate only strong divergences.
🔧 Input Parameters: RSI Length: The RSI period (default: 14). RSI Divergence Length: The lookback period for regression (default: 25). Source: Which price data to calculate RSI from (default: close). Display Labels: Show/hide “Bullish” or “Bearish” labels on the chart. Display Line Width: Adjusts how thick the plotted divergence lines appear.
📣 Alerts: Alerts are built-in for both RSI Buy (bullish divergence) and RSI Sell (bearish divergence) so you can use it in automation or notifications.
🚀 Personal Note: I’ve been using this script daily in my own trading, which is why I took time to improve both the logic and visual clarity. If you want a divergence tool that doesn't clutter your chart but gives strong signals, this might be what you're looking for.
Price-EMA Z-Score Backgroundhe “Price‑to‑EMA Z‑Score Background” indicator is designed to give you a clear, visual sense of when price has moved unusually far away from its smoothed trend, and to highlight those moments as potential overextension or mean‑reversion opportunities. Under the hood, it first computes a standard exponential moving average (EMA) of your chosen lookback length, then measures the raw difference between the current close and that EMA on every bar. To make that raw deviation comparable across different markets and timeframes, it converts the series of differences into a z‑score—subtracting the rolling mean of the deviations and dividing by their rolling standard deviation over a second lookback window.
Once you’ve normalized price‑to‑EMA distance into z‑score units, you can set two simple trigger levels: one upper threshold and one lower threshold. Whenever the z‑score climbs above the upper threshold, the chart background glows green, signaling that price is extended far above its EMA (and might be ripe for a pullback). Whenever the z‑score falls below the lower threshold, the background turns red, calling out an equally extreme move below the EMA (and a possible oversold bounce). Between those bands, no shading appears, letting you know price is trading within its “normal” range around the trend.
By adjusting the EMA period, the z‑score lookback, and the two trigger levels, you can dial in early warning signals (e.g. ±1 σ) or wait for very stretched moves (±2 σ or more). Used in concert with your favorite momentum or pattern tools—or even as a standalone visual cue—this simple background‑shading approach makes it easy to spot when a market is running too hot or too cold relative to its own recent average.
Simple Sessions & LevelsWhat this indicator does:
This script marks out two essential types of price levels for intraday and swing traders:
The high and low of a customizable 15-minute opening range after the market/session open.
The previous day’s high, midpoint (“halfback”), and low.
How it works:
The script lets you set the session start time (hour and minute) to match your market.
It then calculates the high and low of the first 15 minutes after the session opens and plots those as solid lines.
It also plots the prior day’s high, halfback (midpoint), and low on your chart for easy reference.
Each line and each label can be toggled on or off independently in the settings for maximum customization.
Colors for each level are also fully customizable.
How to use it:
Add the script to your chart.
Set the session start hour and minute to match the open of the market or instrument you trade.
Choose which levels and labels you want displayed by using the toggles in the settings.
The indicator will automatically draw the session range and prior day levels for you.
Use these lines as reference for key support, resistance, and potential trade entry/exit points.
What makes it unique and useful:
This tool combines a flexible session opening range with classic daily reference levels in one package. You have complete control over which levels and labels are shown, making it adaptable for any trading style. It’s especially useful for day traders who want to quickly identify volatility windows and the most important price levels from the previous session.