Daily EMA-21/34/50The EMAs and color coding can be changed, by default it contains 21/34/50 on Daily, The script can be edited to suit the timeframe whichever wanted
Göstergeler ve stratejiler
Premarket High/Low LinesTHis is another script about premarket lines, the previous one is a label and this one really plot the lines, so you dont have to do it yourself. hope it helps :)
Premarket High/Low Label (Single Line)it shows you what the premarket high low label is on a single line, saving you the hassale of fidning it yourself. :) hope it helps.
2 Asset Optimal PortfolioThis script calculates and plots either the Sharpe Ratio or Sortino Ratio for a two-asset portfolio using historical price data, allowing users to analyse how different allocations affect portfolio performance over a specified lookback period.
Features:
Determine the weights of 2 assets and how they affect the the Sharpe or Sortino ratio.
Adjust timeframe to suit your personal investment timeframe.
User Inputs:
1. Asset 1 and Asset 2: Choose any two symbols to evaluate (default is BTCUSD for both).
2. Look Back Length: Number of past bars (days) to use for calculations (default is 365).
3. Source: Price source for returns (default is close).
4. Ratio: Select which ratio to plot — Sharpe or Sortino.
5. % of Asset 1: Portfolio weight (from 0 to 1) for Asset 1.
Tri-Monthly BTC Swing StrategyWhat This Does:
Component Function
EMA200 Filters long-term bullish conditions
MACD crossover Confirms swing entry
RSI > 50 Confirms momentum is strong
90-day cooldown Ensures you're not overtrading
Exit on MACD/RSI weakness Protects from reversals
Crypto Weighted 60 Day Return Index60 Day Return of Crypto Index (Volatility Adjusted) weightings based on Holdings
BTC
ETH
SOL
AAVE
XRP
VIX9D to VIX RatioVIX9D to VIX Ratio
The ratio > 1 can signal near-term fear > long-term fear (potential short-term stress).
The ratio < 1 implies long-term implied volatility is higher — more typical in calm markets.
Sessions (Blvck 5min Orb Range)Blvck 5min Orb + session indicator. Lays out the main sessions times with a background colour
PulseLogicLibPulseLogicLib v3.6.1
PulseLogic breath-strength & momentum-structure calculator
Exports:
• getBreathScore() → int (0–100)
• hasGreenDot() → bool
• getTriangleColor() → string (“green”/“red”/“none”)
PulseLinesLibPulseLinesLib v1.3.1
PulseLines morphic-level calculator (support & resistance)
Exports:
• getLevels(lookback:int, wickRatioThresh:float, flatCandles:int, tolerancePips:float, atrMult:float) → float
hudDisplay_v1Library "hudDisplay_v1"
f_getPosition(loc)
Parameters:
loc (string)
f_getTableSize(layout, itemCount)
Parameters:
layout (string)
itemCount (int)
f_getCellPosition(layout, index)
Parameters:
layout (string)
index (int)
f_drawHUD(show, loc, layout, content, textColor, bgColor)
Parameters:
show (bool)
loc (string)
layout (string)
content (array)
textColor (color)
bgColor (color)
TrailingStopLibraryLibrary "TrailingStopLibrary"
专业移动止盈库 - 为Pine Script策略提供完整的追踪止盈功能。支持做多做空双向交易,基于风险回报比智能激活,提供收盘价和高低价两种判断模式。包含完整的状态管理、调试信息和易用的API接口。适用于股票、外汇、加密货币等各种市场的风险管理。
@version 1.0
@author runto2006
new_config(enabled, activation_ratio, pullback_percent, price_type)
创建移动止盈配置对象
Parameters:
enabled (bool) : (bool) 是否启用移动止盈,默认true
activation_ratio (float) : (float) 激活盈亏比,默认4.0,表示盈利4倍止损距离时激活
pullback_percent (float) : (float) 回撤百分比,默认1.0,表示回撤1%时触发止盈
price_type (string) : (string) 价格类型,默认"close"。"close"=收盘价模式,"hl"=高低价模式
Returns: Config 配置对象
new_state()
创建移动止盈状态对象
Returns: State 初始化的状态对象
reset(state)
重置移动止盈状态
Parameters:
state (State) : (State) 要重置的状态对象
Returns: void
calc_activation_target(entry_price, stop_price, activation_ratio, is_long)
计算激活目标价格
Parameters:
entry_price (float) : (float) 入场价格
stop_price (float) : (float) 止损价格
activation_ratio (float) : (float) 激活盈亏比
is_long (bool) : (bool) 是否为多头持仓
Returns: float 激活目标价格,如果输入无效则返回na
get_check_price(price_type, is_long, for_activation)
获取用于判断的价格
Parameters:
price_type (string) : (string) 价格类型:"close"或"hl"
is_long (bool) : (bool) 是否为多头持仓
for_activation (bool) : (bool) 是否用于激活判断,影响高低价的选择方向
Returns: float 当前判断价格
check_activation(config, state, entry_price, stop_price, is_long, has_position)
检查是否应该激活移动止盈
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
entry_price (float) : (float) 入场价格
stop_price (float) : (float) 止损价格
is_long (bool) : (bool) 是否为多头持仓
has_position (bool) : (bool) 是否有持仓
Returns: bool 是否成功激活
update_tracking(config, state, is_long)
更新移动止盈的追踪价格
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
is_long (bool) : (bool) 是否为多头持仓
Returns: void
check_trigger(config, state, entry_price, is_long)
检查是否触发移动止盈
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
entry_price (float) : (float) 入场价格
is_long (bool) : (bool) 是否为多头持仓
Returns: bool 是否触发止盈
process(config, state, entry_price, stop_price, is_long, has_position)
一体化处理移动止盈逻辑
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
entry_price (float) : (float) 入场价格
stop_price (float) : (float) 止损价格
is_long (bool) : (bool) 是否为多头持仓
has_position (bool) : (bool) 是否有持仓
Returns: bool 是否触发止盈
get_trigger_price(config, state, is_long)
获取当前触发价格
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
is_long (bool) : (bool) 是否为多头持仓
Returns: float 触发价格,未激活时返回na
get_pullback_percent(config, state, entry_price, is_long)
计算当前回撤百分比
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
entry_price (float) : (float) 入场价格
is_long (bool) : (bool) 是否为多头持仓
Returns: float 当前回撤百分比,未激活时返回na
get_status_info(config, state, entry_price, is_long)
获取状态信息字符串(用于调试)
Parameters:
config (Config) : (Config) 移动止盈配置
state (State) : (State) 移动止盈状态
entry_price (float) : (float) 入场价格
is_long (bool) : (bool) 是否为多头持仓
Returns: string 详细的状态信息
Config
移动止盈配置对象
Fields:
enabled (series bool) : (bool) 是否启用移动止盈功能
activation_ratio (series float) : (float) 激活盈亏比 - 盈利达到止损距离的多少倍时激活追踪
pullback_percent (series float) : (float) 回撤百分比 - 从最优价格回撤多少百分比时触发止盈
price_type (series string) : (string) 价格判断类型 - "close"使用收盘价,"hl"使用高低价
State
移动止盈状态对象
Fields:
activated (series bool) : (bool) 是否已激活追踪止盈
highest_price (series float) : (float) 激活后记录的最高价格
lowest_price (series float) : (float) 激活后记录的最低价格
activation_target (series float) : (float) 激活目标价格
Open Interest Screener (Fixed Zones)📌 Purpose
This indicator scans Open Interest (OI) changes across selected exchanges and highlights significant spikes or drops directly on the chart using dynamic shaded zones.
It is designed to help traders detect unusual market positioning changes that may precede volatility events.
🧠 How It Works
1. Data Sources
Supports multiple exchanges: BitMEX USD, BitMEX USDT, Kraken USD (toggle on/off in settings).
Automatically adapts symbol prefix based on the chart’s base asset.
2. Spike / Drop Detection
OI % Change is calculated over a configurable lookback (Bars to look back).
Spike Up: OI increases by more than Threshold %.
Spike Down: OI decreases by more than Threshold %.
3. Dynamic Zones
When a spike occurs, a green zone (increase) or red zone (decrease) is drawn on the chart.
Zone height is dynamic, based on price high/low ± 5%, preventing chart distortion.
Minimum spacing (Zone Spacing) prevents clustering.
📈 How to Use
Green Zones: Large OI increase can signal fresh positioning (possible breakout setups).
Red Zones: Large OI decrease can signal liquidation events or position unwinds.
Combine with price action, funding rates, or volatility measures for higher confidence.
Recommended Timeframes: Works best on 15m, 1h, 4h.
Markets: Crypto derivatives (OI data available).
⚙️ Inputs
Bars to Look Back
OI % Change Threshold
Zone Width
Exchange toggles (BitMEX USD/USDT, Kraken USD)
⚠️ Disclaimer
This script is for educational purposes only and does not constitute financial advice.
Always test thoroughly before live trading.
Volume Scanner (Spikes & Drops) [Context]📌 Purpose
This indicator detects significant volume spikes or drops and optionally filters them by price context (local highs/lows).
It helps identify potential breakout or exhaustion points with improved signal quality compared to raw volume alerts.
🧠 How It Works
1. Volume Spike / Drop Detection
SMA Volume over N bars is calculated as baseline.
Volume Spike: Volume > SMA × Spike Multiplier (default 1.5×).
Volume Drop: Volume < SMA × Drop Multiplier (default 0.5×).
2. Context Filter (optional)
When Use Context = ON:
Bullish Context: Volume spike at/near local price high (last Lookback bars).
Bearish Context: Volume drop at/near local price low (last Lookback bars).
3. Signal Gap
Minimum spacing between signals (Min Gap Bars) prevents excessive clustering.
4. Visuals
Background shading:
Green = Volume Spike in bullish context.
Red = Volume Drop in bearish context.
Alerts can be configured for both conditions.
📈 How to Use
Volume Spikes near highs can indicate breakouts or exhaustion tops.
Volume Drops near lows can signal liquidity dry-up or potential reversals.
Combine with price action or support/resistance for confirmation.
Recommended Timeframes: Works on all timeframes; more reliable on 15m, 1h, 4h.
Markets: Crypto, Forex, Stocks.
⚙️ Inputs
Volume SMA Length
Spike Multiplier / Drop Multiplier
Use Context (High/Low filter)
Min Gap Bars (avoid clustered signals)
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.
Smart Price Divergence (MACD Filter) + EMA📌 Purpose
This indicator detects Price Divergences with MACD filtered by a 200 EMA trend condition.
It helps identify high-probability reversal zones aligned with market trend context.
🧠 How It Works
1. MACD Divergence Logic
Bearish Divergence:
Price makes a higher high.
MACD makes a lower high.
Price is above EMA (indicating possible exhaustion in bullish trend).
Bullish Divergence:
Price makes a lower low.
MACD makes a higher low.
Price is below EMA (indicating possible exhaustion in bearish trend).
2. EMA Trend Filter
EMA(200) is used as a directional filter:
Bearish divergences considered above EMA (extended bullish conditions).
Bullish divergences considered below EMA (extended bearish conditions).
3. Visual & Alerts
EMA(200) plotted on chart in orange.
Red triangles for Bearish Divergence.
Green triangles for Bullish Divergence.
Alerts fire for both divergence types.
📈 How to Use
Look for divergence signals as potential reversal alerts.
Combine with support/resistance or price action for confirmation.
EMA ensures signals occur in extended zones, increasing reliability.
Recommended Timeframes: 1h, 4h, D.
Markets: Forex, Crypto, Stocks.
⚙️ Inputs
MACD Fast / Slow / Signal Length
EMA Length (default 200)
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.
Smart Deviation Trend Bands PRO + MTF Filter📌 Purpose
This indicator combines multi-level Deviation Bands (±1, ±2, ±3 standard deviations from SMA) with a Higher Timeframe (HTF) Trend Filter.
It helps traders identify potential bounce and breakout setups aligned with the dominant market trend.
🧠 How It Works
1. Deviation Bands
SMA(Length) is calculated as the centerline.
Standard deviations (±1, ±2, ±3) define multiple dynamic support and resistance zones.
Outer bands (±3) often mark overextended zones; inner bands (±1, ±2) show active trading areas.
2. HTF Trend Filter
A higher timeframe SMA (HTF SMA) acts as a trend confirmation tool.
Default filter timeframe: 1 Day.
Trend Up: Price > HTF SMA
Trend Down: Price < HTF SMA
3. Entry Signals
Long Signal: Price crosses above lower deviation band (+1) when HTF trend is UP.
Short Signal: Price crosses below upper deviation band (−1) when HTF trend is DOWN.
4. Visuals & Alerts
Bands plotted in red (upper) and green (lower).
Centerline = SMA in blue.
HTF SMA in orange.
Circles on chart mark entry points; alerts trigger automatically.
📈 How to Use
In trending markets: Trade with the HTF direction, using band touches for entries.
In mean-reversion setups: Outer bands can be used to spot potential overbought/oversold zones.
Combine with volume or price action for confirmation.
Recommended Timeframes: 1h, 4h, D.
Markets: Forex, Crypto, Stocks.
⚙️ Inputs
SMA Length
StdDev Multiplier 1 / 2 / 3
HTF Timeframe (default: D1)
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.
Smart Volatility Squeeze + Trend Filter📌 Purpose
This indicator detects volatility squeeze conditions when Bollinger Bands contract inside Keltner Channels and signals potential breakout opportunities.
It also includes an optional EMA-based trend filter to align signals with the dominant market direction.
🧠 How It Works
1. Squeeze Condition
Bollinger Bands (BB): Length = 20, StdDev = 2.0 (default)
Keltner Channels (KC): EMA Length = 20, ATR Multiplier = 1.5 (default)
Squeeze ON: Occurs when BB Upper < KC Upper and BB Lower > KC Lower (low volatility zone).
2. Breakout Signals
Long Breakout: Price crosses above BB Upper after squeeze.
Short Breakout: Price crosses below BB Lower after squeeze.
3. Trend Filter (optional)
EMA(50) used to confirm breakout direction:
Long signals allowed only if price > EMA(50)
Short signals allowed only if price < EMA(50)
Toggle Use Trend Filter to enable/disable.
4. Visual & Alerts
Green circle at chart bottom indicates Squeeze ON.
Green/Red triangles mark breakouts.
Background gradually brightens during squeeze buildup.
Alerts available for long and short breakouts.
📈 How to Use
Look for Squeeze ON → then wait for breakout arrows.
Trade in breakout direction, preferably with trend filter ON.
Works best on higher timeframes (1h, 4h, D) and trending markets.
Markets: Crypto, Forex, Stocks — effective in volatile assets.
⚙️ Inputs
BB Length / StdDev
KC EMA Length / ATR Multiplier
Use Trend Filter
Trend EMA Length
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.
Smart RSI Divergence PRO | Auto Lines + Alerts📌 Purpose
This indicator automatically detects Regular and Hidden RSI Divergences between price action and the RSI oscillator.
It plots divergence lines directly on the chart, labels signals, and includes alerts for automated monitoring.
🧠 How It Works
1. RSI Calculation
RSI is calculated using the selected Source (default: Close) and RSI Length (default: 14).
2. Divergence Detection via Fractals
Swing points on both price and RSI are detected using fractal logic (5-bar patterns).
Regular Divergence:
Bearish: Price forms a higher high, RSI forms a lower high.
Bullish: Price forms a lower low, RSI forms a higher low.
Hidden Divergence:
Bearish: Price forms a lower high, RSI forms a higher high.
Bullish: Price forms a higher low, RSI forms a lower low.
3. Auto Drawing Lines
Lines are drawn automatically between divergence points:
Red = Regular Bearish
Green = Regular Bullish
Orange = Hidden Bearish
Blue = Hidden Bullish
Line width and transparency are adjustable.
4. Labels and Alerts
Labels mark divergence points with up/down arrows.
Alerts trigger for each divergence type.
📈 How to Use
Use Regular Divergences to anticipate trend reversals.
Use Hidden Divergences to confirm trend continuation.
Combine with support/resistance, trendlines, or volume for higher probability setups.
Recommended Timeframes: Works on all timeframes; more reliable on 1h, 4h, and Daily.
Markets: Forex, Crypto, Stocks.
⚙️ Inputs
Source (Close, HL2, etc.)
RSI Length
Toggle Regular / Hidden Divergence visibility
Toggle Lines / Labels
Line Width & Line Transparency
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before using in live trading.
Buy Sell Magic Rework📌 Purpose
This script is a reworked version of the Parabolic SAR strategy, with an optional ZigZag filter to confirm reversal points.
It helps traders identify potential trend reversals with reduced noise compared to the standard SAR.
🧠 How It Works
1. Parabolic SAR Flip Signals
Buy Signal: Triggered when SAR flips from above price to below price.
Sell Signal: Triggered when SAR flips from below price to above price.
(Default SAR parameters: Start = 0.02, Increment = 0.02, Max = 0.2)
2. ZigZag Filter (Optional)
When Use ZigZag Filter = true:
The script confirms reversals only at significant pivots (swing highs/lows) detected by the ZigZag algorithm over the selected ZigZag Period (default = 14 bars).
Buy Signal: Appears only when a new pivot low is detected.
Sell Signal: Appears only when a new pivot high is detected.
3. Trade-Off
Without ZigZag: More signals, more noise.
With ZigZag: Fewer signals, but stronger confirmation and reduced false entries.
📈 How to Use
Signals appear as green arrows for buy and red arrows for sell.
Works well for:
Trend reversal detection.
Swing trading confirmation.
Filtering entries for other systems.
Recommended Timeframes: 15m, 1h, 4h.
Markets: Forex, Crypto, Stocks.
⚙️ Inputs
ZigZag Period (bars for pivot detection)
SAR Start / Increment / Max (SAR parameters)
Use ZigZag Filter (toggle for confirmation)
⚠️ Disclaimer
This script is for educational purposes only. It does not constitute financial advice.
Always test thoroughly before live trading.
Smart Impulse Exhaustion Finder (ATR + ADX Filter)📌 Purpose
This indicator detects potential exhaustion of strong bullish or bearish impulses at fresh swing highs/lows by combining multiple price action and volatility-based filters.
🧠 How It Works
A signal is triggered only when all core conditions are satisfied:
1. Swing High/Low Detection
Current high (or low) must be the highest (or lowest) over the last Extremum Lookback bars (default: 50).
This ensures the move is significant relative to recent price action.
2. Impulse Confirmation
Price must extend by at least 1 × ATR from the previous swing point.
This filters out minor fluctuations.
3. Exhaustion Conditions (at least 2 out of 3 must be met)
RSI Extreme: RSI > Overbought Level (default: 80) for bearish signals, RSI < Oversold Level (default: 20) for bullish signals.
Volume Spike: Volume > SMA(Volume, Volume SMA Length) × Volume Spike Multiplier.
Candle Wick Rejection: Upper wick ≥ Wick Threshold % for bearish setups, Lower wick ≥ Wick Threshold % for bullish setups.
4. Trend Filter
ADX > ADX Threshold ensures the market is trending and filters out sideways conditions.
5. Candle Body Filter
Candle body must be ≥ Body Size ATR Factor × ATR.
This avoids weak signals from small candles or doji formations.
📈 How to Use
Bearish Signal:
Appears at fresh swing highs with exhaustion conditions met. Useful for tightening stops, taking partial profits, or counter-trend shorts.
Bullish Signal:
Appears at fresh swing lows with exhaustion conditions met. Useful for trailing stops, profit-taking, or counter-trend longs.
Recommended Timeframes: Works best on 1h, 4h, and Daily charts.
Markets: Crypto, Forex, Stocks — wherever volatility and trends are present.
⚙️ Inputs
RSI Length / Overbought / Oversold
Volume SMA Length & Volume Spike Multiplier
Wick Threshold %
Extremum Lookback (bars for highs/lows)
ADX Length & Threshold
Body Size ATR Factor
⚠️ Disclaimer
This script is for educational purposes only and does not constitute financial advice.
Always test thoroughly and apply proper risk management before live trading.
💡 Tip: Combine this tool with your own market context and confluence factors for higher probability setups.
JHW Volume Based Buy and Sell MomentumThe JHW Volume-Based Buy and Sell Momentum indicator is a custom momentum oscillator designed to capture market sentiment based on volume dynamics and price rate of change (ROC). It aims to identify bullish or bearish momentum by analyzing how price reacts to increasing or decreasing trading volume.
Core Logic:
The indicator calculates the Rate of Change (ROC) of the closing price.
It then accumulates this ROC separately based on whether the current volume is lower or higher than the previous bar:
If volume decreases, the ROC is added to a "negative volume index" accumulator.
If volume increases, the ROC is added to a "positive volume index" accumulator.
These two accumulators are combined to form a net momentum line.
Smoothing:
A Simple Moving Average (SMA) is applied to both accumulators over a user-defined period (default: 25 bars).
The sum of these smoothed values forms the signal line.
Visualization:
The indicator plots:
The net momentum line (yellow).
The smoothed signal line (blue).
The area between the two lines is filled with color:
Yellow when momentum is above the signal (bullish).
Blue when momentum is below the signal (bearish).
Bar colors are also adjusted to reflect the current momentum state.
Use Case:
This indicator helps traders:
Detect volume-driven momentum shifts.
Identify potential buy or sell zones based on volume behavior.
Confirm trends or spot early reversals.
ATR as % of CloseATR 14day period in % terms
the Normal ATR indicator by TV helps but this gives a clear idea as to the range in percentage terms as and when market rises to newer and newer highs
better than an absolute value