Session Backgrounds (Asia, London, US) - Weekdays Onlythis is to mark asia, london, us session so we can easily see what is current session while trading
指標和策略
CerberusFX Midnight Line UTC+2Daily Vertical Line UTC+2
Plots a vertical blue line spanning the full chart height at the start of each day at 00:00 UTC+2 (or the next available candle). Includes a label ("00:00 UTC+2") above the candle for clarity. Ideal for separating trading days on intraday charts in the UTC+2 timezone.
Orthogonal Projections to Latent Structures (O-PLS)Version 0.1
Orthogonal Projections to Latent Structures (O-PLS) Indicator for TradingView
This indicator, named "Orthogonal Projections to Latent Structures (O-PLS)", is designed to help traders understand the relevance or predictive power of various market variables on the future close price of the asset it's applied to. Unlike standard correlation coefficients that show a simple linear relationship, O-PLS aims to separate variables into "predictive" (relevant to Y) and "orthogonal" (irrelevant noise) components. This Pine Script indicator provides a simplified proxy of the relevance score derived from O-PLS principles.
Purpose of the Indicator
The primary purpose of this indicator is to identify which technical factors (such as price, volume, and other indicators) have the strongest relationship with the future price movement of the current trading instrument. By providing a "relevance score" for each input variable, it helps traders focus on the most influential data points, potentially leading to more informed trading decisions.
Inputs
The indicator offers the following user-definable inputs:
* **Lookback Period:** This integer input (default: 100, min: 10, max: 500) determines the number of past bars used to calculate the relevance scores for each variable. A longer lookback period considers more historical data, which can lead to smoother, less reactive scores but might miss recent shifts in variable importance.
* **External Asset Symbol:** This symbol input (default: `BINANCE:BTCUSDT`) allows you to specify an external asset (e.g., `BINANCE:ETHUSDT`, `NASDAQ:TSLA`) whose close price will be included in the analysis as an additional variable. This is useful for cross-market analysis to see how other assets influence the current chart.
* **Plot Visibility Checkboxes (e.g., "Plot: Open Price Relevance", "Plot: Volume Relevance", etc.):** These boolean checkboxes allow you to toggle the visibility of individual relevance score plots on the chart, helping to declutter the display and focus on specific variables.
Outputs
The indicator provides two main types of output:
Relevance Score Plots: These are lines plotted in a separate pane below the main price chart. Each line corresponds to a specific market variable (Open Price, Close Price, High Price, Low Price, Volume, various RSIs, SMAs, MFI, and the External Asset Close). The value of each line represents the calculated "relevance score" for that variable, typically scaled between 0 and 10. A higher score indicates a stronger predictive relationship with the future close price.
Sorted Relevance Table : A table displayed in the top-right corner of the chart provides a clear, sorted list of all analyzed variables and their corresponding relevance scores. The table is sorted in descending order of relevance, making it easy to identify the most influential factors at a glance. Each variable name in the table is colored according to its plot color, and the external asset's name is dynamically displayed without the "BINANCE:" prefix.
How to Use the Indicator
1. **Add to Chart:** Apply the "Orthogonal Projections to Latent Structures (O-PLS)" indicator to your desired trading chart (e.g., ETH/USDT).
2. **Adjust Inputs:**
* **Lookback Period:** Experiment with different lookback periods to see how the relevance scores change. A shorter period might highlight recent correlations, while a longer one might show more fundamental relationships.
* **External Asset Symbol:** If you trade BTC/USDT, you might add ETH/USDT or SPX as an external asset to see its influence.
3. **Analyze Relevance Scores:**
* **Plots:** Observe the individual relevance score plots over time. Are certain variables consistently high? Do scores change before significant price moves?
* **Table:** Refer to the sorted table on the latest confirmed bar to quickly identify the top-ranked variables.
4. **Incorporate into Strategy:** Use the insights from the relevance scores to:
* Prioritize certain indicators or price actions in your trading strategy. For example, if "Volume" has a high relevance score, it suggests volume confirmation is critical for future price moves.
* Understand the influence of inter-market relationships (via the External Asset Close).
How the Indicator Works
The indicator works by performing the following steps on each bar:
1. **Data Fetching:** It gathers historical data for various price components (open, high, low, close), volume, and calculated technical indicators (SMA, RSI, MFI) for the specified `lookback` period. It also fetches the close price of an `External Asset Symbol` .
2. **Standardization (Z-scoring):** All collected raw data series are standardized by converting them into Z-scores. This involves subtracting the mean of each series and dividing by its standard deviation . Standardization is crucial because it brings all variables to a common scale, preventing variables with larger absolute values from disproportionately influencing the correlation calculations.
3. **Correlation Calculation (Proxy for O-PLS Relevance):** The indicator then calculates a simplified form of correlation between each standardized input variable and the standardized future close price (Y variable) . This correlation is a proxy for the relevance that O-PLS would identify. A high absolute correlation indicates a strong linear relationship.
4. **Relevance Scaling:** The calculated correlation values are then scaled to a range of 0 to 10 to provide an easily interpretable "relevance score" .
5. **Output Display:** The relevance scores are presented both as time-series plots (allowing observation of changes over time) and in a real-time sorted table (for quick identification of top factors on the current bar) .
How it Differs from Full O-PLS
This indicator provides a *simplified proxy* of O-PLS principles rather than a full, mathematically rigorous O-PLS model. Here's why and how it differs:
* **Dimensionality Reduction:** A full O-PLS model would involve complex matrix factorization techniques to decompose the independent variables (X) into components that are predictive of Y and components that are orthogonal (unrelated) to Y but still describe X's variance. Pine Script's array capabilities and computational limits make direct implementation of these matrix operations challenging.
* **Orthogonal Components:** A true O-PLS model explicitly identifies and removes orthogonal components (noise) from the X data that are unrelated to Y. This indicator, in its simplified form, primarily focuses on the direct correlation (relevance) between each X variable and Y after standardization, without explicitly modeling and separating these orthogonal variations.
* **Predictive Model:** A full O-PLS model is ultimately a predictive model that can be used for regression (predicting Y). This indicator, however, focuses solely on **identifying the relevance/correlation of inputs to Y**, rather than building a predictive model for Y itself. It's more of an analytical tool for feature importance than a direct prediction engine.
* **Computational Intensity:** Full O-PLS involves Singular Value Decomposition (SVD) or Partial Least Squares (PLS) algorithms, which are computationally intensive. The indicator uses simpler statistical measures (mean, standard deviation, and direct correlation calculation over a lookback window) that are feasible within Pine Script's execution limits.
In essence, this Pine Script indicator serves as a practical tool for gaining insights into variable relevance, inspired by the spirit of O-PLS, but adapted for the constraints and common use cases of a TradingView environment.
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).
3 EMA trong 1 NTT CAPITALThe 3 EMA in 1 NTT CAPITAL indicator provides an overview of the market trend with three EMAs of different periods, helping to identify entry and exit points more accurately, thus supporting traders in making quick and effective decisions.
Daily Lows and Highs with Fading on Breach (RVOL Filter)Daily Highs and Lows with RVOL Filter and Fading Lines
This TradingView Pine Script draws horizontal lines at the daily lows of high RVOL red candles and at the daily highs of high RVOL green candles. Lines are colored red for lows and green for highs. The line width dynamically adjusts based on RVOL levels (thicker lines for stronger volume). When price breaches these levels on the next day, the lines gradually fade in opacity and decrease in width, visually indicating multiple breaches without removing the lines entirely. The script includes customizable RVOL threshold, line style, and width settings, plus debug information for easy monitoring.
Script Criteria Explanation:
The script draws horizontal lines based on daily candles with high relative volume (RVOL).
For Red Candles (Close < Open):
If the daily RVOL is above the user-defined threshold (default 2), a red line is drawn at the daily low price.
The line width depends on the RVOL level:
Width 5 if RVOL is between 2 and 3.
Width 10 if RVOL is above 3.
For Green Candles (Close > Open):
If the daily RVOL is above the threshold, a green line is drawn at the daily high price.
The line width follows the same RVOL logic as red lines:
Width 5 if RVOL is between 2 and 3.
Width 10 if RVOL is above 3.
Line Behavior on Breach:
When the next day’s price breaches these lines (low breaches red lines, high breaches green lines), the lines:
Increase their transparency (fade) by 20% each breach, up to a maximum of 80% transparency (making the line 20% visible).
Decrease their width by 1 with each breach, down to a minimum width of 1.
Lines are never removed; they only visually fade and shrink as they get breached multiple times.
Lines extend 100 bars into the future (to the right) to stay visible over time.
The user can customize the RVOL threshold, line style (solid/dotted/dashed), and base line width in the settings.
Algo Sniper Signal (Visual Style)Algo Sniper Signal (Visual Style) – Trading Bot Description
The Algo Sniper Signal is a visual trading bot that combines multiple technical indicators to generate reliable long and short entry signals. Its goal is to provide clear and precise trade signals based on proven strategies, highlighted directly on the chart for easy interpretation.
Key Features:
Multi-Indicator Setup: Utilizes EMA (14), SMA (9), RSI (14), ADX (14), and MACD Histogram to generate signals.
Long and Short Signals: Only one active signal is shown at a time; new signals are triggered only after a confirmed reversal in the opposite direction.
Trade Limitation: Allows only one trade per day to avoid overtrading.
Visual Representation: Signal zones are displayed as colored boxes on the chart, along with green long and red short labels.
Trailing Stop Visualization: Optional visual trailing stop loss displayed directly on the chart.
Indicator Dashboard: A clear, concise table at the bottom right of the chart displays the current status of all indicators.
Gold & FX 4H Strategy - AutoYou BUY when price is ABOVE all the EMA and SELL when price is BELLOW all the EMA
liq depth fvg/bpr9.30 to 10.00 range liquidity depth boxes where reversals can occur.
Also displays fvg's and bpr's to add confluence.
Rsi By Moshi MTF (1H Fixed)This script is a custom multi-timeframe RSI indicator called "Rsi By Moshi MTF (1H Fixed)". It combines RSI signals from the current timeframe (e.g. M15) with confirmation from the 1-hour RSI trend to generate buy/sell signals.
Main Features:
Calculates RSI, EMA, and WMA on the current chart timeframe.
Fetches real-time and previous RSI values from the 1-hour timeframe.
Generates buy signals when RSI crosses above its EMA and 1H RSI is rising.
Generates sell signals when RSI crosses below its EMA and 1H RSI is falling.
Offers optional horizontal RSI bands at key levels (20–80) for visual guidance.
Plots RSI, EMA, WMA, and triangle markers for buy/sell signals.
Includes built-in alert conditions for automation or notifications.
✅ Pre-Trade Checklist — AMDCheck List ( consistency)
✅ Checklist Display Features:
Visible only when enabled via a toggle.
Displayed as a floating label box in the top left (or customizable location).
Contains your key checklist items:
Market condition
Key support/resistance
Session check
News awareness
Strategy match
RRR check
Risk % used
Mental state (emotion/revenge check)
If you want to be a serious trader can follow
SMA Crossover Strategy📈 Indicator: SMA Crossover Strategy
This strategy uses optimized fast and slow SMA values tailored to popular timeframes for more responsive trend detection. You can let the script auto-select values or manually define your own crossover settings. Clean visual cues and per-candle signal filtering keep your chart sharp and actionable.
🔧 Key Features:
- Auto Mode: Smart defaults for each timeframe with trader-tested pairs
- Manual Mode: User-defined flexibility when custom values are needed
- Signal Clarity: BUY/SELL labels are plotted only once per confirmed candle
🧠 Default Auto Values (Based on Chart Timeframe)
- 1-min: Fast = 5, Slow = 20
- 5-min: Fast = 5, Slow = 10
- 15-min: Fast = 5, Slow = 13
- 30-min: Fast = 15, Slow = 30
- 1-hr: Fast = 50, Slow = 200
- 4-hr: Fast = 20, Slow = 50
- Daily: Fast = 50, Slow = 200
- Weekly: Fast = 10, Slow = 30
If your timeframe isn't matched exactly, the script falls back to sensible defaults.
📊 How to Improve Conviction
SMA crossovers are strong signals when confirmed by other tools. Here are some add-ons you can layer into your chart:
🔍 Confirmation Indicators
- RSI (14): Look for crossovers near RSI crossing 50 or at oversold/overbought zones for momentum confirmation.
- MACD: Use histogram alignment with crossover signals to detect real trend shifts.
- Volume Filters: Pair signals with rising volume for institutional confirmation.
🌀 Trend & Volatility Filters
- ATR (Average True Range): Helps filter signals during consolidation—watch for expanding ATR as a volatility cue.
- ADX: Trade only when ADX > 20 to avoid false signals in ranging markets.
- HMA (Hull MA): A smoother, faster MA that can act as a trend bias overlay.
🔭 Multi-Timeframe Awareness
Overlay higher-timeframe trend indicators (like a daily 200 SMA on an intraday chart) to avoid trading against macro momentum.
5 EMA vs 13 EMA Crossover Signals//@version=5
indicator("5 EMA vs 13 EMA Crossover Signals", overlay=true)
// EMAs
ema5 = ta.ema(close, 5)
ema13 = ta.ema(close, 13)
// Plot EMAs
plot(ema5, title="5 EMA", color=color.blue)
plot(ema13, title="13 EMA", color=color.orange)
// Crossover logic
buySignal = ta.crossover(ema5, ema13)
sellSignal = ta.crossunder(ema5, ema13)
// Plot signals
plotshape(buySignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sellSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")
CerberusFX Custom Time LineCerberusFX Custom Time Line
🧠 How it works:
Detects when time passes the target.
Sets a should_plot flag.
Waits for the next bar, even on Renko.
Plots the line once, then resets.
🧪 Tested on:
Renko
Heikin Ashi
1min–1D regular timeframes
3-Bar Compression Reversal Pattern//@version=5
indicator("3-Bar Compression Reversal Pattern", overlay=true)
// Get candle OHLCs
open1 = open
close1 = close
body1 = math.abs(close1 - open1)
open2 = open
close2 = close
body2 = math.abs(close2 - open2)
// 2nd candle body < 50% of 1st
secondSmall = body2 < (0.5 * body1)
// 3rd candle engulfs both 1st and 2nd
lowAll = math.min(low , low )
highAll = math.max(high , high )
engulfAll = (high > highAll) and (low < lowAll)
// Final condition
patternDetected = secondSmall and engulfAll
// Plot signal
plotshape(patternDetected, location=location.belowbar, color=color.green, style=shape.labelup, size=size.small, title="Pattern Signal")
alertcondition(patternDetected, title="3-Bar Reversal Alert", message="3-Bar Compression Reversal Pattern Detected!")
Volatility Radar + Classic StochVolatility Radar + Classic Stoch
This indicator detects volatility squeezes by measuring Bollinger Bands tightness relative to recent history and confirms potential breakout strength using multiple factors:
Bollinger Bands bandwidth percentile to identify tight and super-tight squeezes
TTM Squeeze confirmation via Keltner Channels
Volume spikes indicating rising market interest
ADX trend strength to gauge directional momentum
Classic Stochastic oscillator to signal overbought/oversold conditions
A composite volatility score ranks the overall setup strength with intuitive color-coded background and a real-time label.
Use this tool to anticipate volatility expansions and improve timing for breakout trades.
MarketCapLibrary2Library "MarketCapLibrary2"
setMarketCapMap(m)
Parameters:
m (map)
getMarketCap(ticker)
Parameters:
ticker (string)
MarketCapLibrary1Library "MarketCapLibrary1"
setMarketCapMap(m)
Parameters:
m (map)
getMarketCap(ticker)
Parameters:
ticker (string)
AnnualizedReturnCalculatorLibrary "AnnualizedReturnCalculator"
TODO: add library description here
calculateAnnualizedReturn(isStartTime, enableLog)
Parameters:
isStartTime (bool) : 开始时间的BOOL值变量(用于标记策略开始时间)
enableLog (bool) : 是否输出日志
Returns:
返回持仓基准年化收益率、资金基准年化收益率、总收益、平均资金占用
My script//@version=5
indicator("Volume in Crores", overlay=false)
vol_crores = volume / 1e7
plot(vol_crores, title="Volume (Cr)", style=plot.style_columns, color=color.new(color.blue, 0))
showLabels = input.bool(true, title="Show Volume Labels")
labelOffset = input.int(1, title="Label Offset (bars)")
if showLabels and bar_index % 5 == 0
label.new(x=bar_index - labelOffset, y=vol_crores, text=str.tostring(vol_crores, "#.##") + " Cr", style=label.style_label_up, size=size.small, color=color.white, textcolor=color.black)
Vertical Lines at Specific NY Timesthese time zones indicates london session and new york session accumulation manipulation and distribution at than spesific time zones