US/SPY- Financial Regime Index Swing Strategy Credits: concept inspired by EdgeTools Bloomberg Financial Conditions Index (Proxy)
 
Improvements: eight component basket, inverse volatility weights, winsorization option( statistical technique used to limit the influence of outliers in a dataset by replacing extreme values with less extreme ones, rather than removing them entirely), slope and price gates, exit guards, table and gradients.
 Summary in one paragraph
 A macro regime swing strategy for index ETFs, futures, FX majors, and large cap equities on daily calculation with optional lower time execution. It acts only when a composite Financial Conditions proxy plus slope and an optional price filter align. Originality comes from an eight component macro basket with inverse volatility weights and winsorized return z scores that produce a portable yardstick. 
 Scope and intent 
Markets: SPY and peers, ES futures, ACWI, liquid FX majors, BTC, large cap equities.
Timeframes: calculation daily by default, trade on any chart.
Default demo: SPY on Daily.
Purpose: convert broad financial conditions into clear swing bias and exits.
 Originality and usefulness
 
Unique fusion: return z scores for eight liquid proxies with inverse volatility weighting and optional winsorization, then slope and price gates.
Failure mode addressed: false starts in chop and early shorts during easy liquidity.
Testability: all knobs are inputs and the table shows components and weights.
Portable yardstick: z scores center at zero so thresholds transfer across symbols.
 Method overview in plain language
 Base measures
Return basis: natural log return over a configurable window, standardized to a z score. Winsorization optional to cap extremes.
 Components
 EQ US and EQ GLB measure equity tone.
CREDIT uses LQD over HYG. Higher credit quality outperformance is risk off so sign is flipped after z score.
RATES2Y uses two year yield, sign flipped.
SLOPE uses ten minus two year yield spread.
USD uses DXY, sign flipped.
VOL uses VIX, sign flipped.
LIQ uses BIL over SPY, sign flipped.
Each component is smoothed by the composite EMA.
 Fusion rule 
Weighted sum where weights are equal or inverse volatility with exponent gamma, normalized to percent so they sum to one.
 Signal rule
 Long when composite crosses up the long threshold and its slope is positive and price is above the SMA filter, or when composite is above the configured always long floor.
Short when composite crosses down the short threshold and its slope is negative and price is below the SMA filter.
Long exit on cross down of the long exit line or on a fresh short signal.
Short exit on cross up of the short exit line or on a fresh long signal, or when composite falls below the force short exit guard.
 What you will see on the chart
 
Markers on suggestion bars: L for long, S for short, LX and SX for exits.
Reference lines at zero and soft regime bands at plus one and minus one.
Optional background gradient by regime intensity.
Compact table with component z, weight percent, and composite readout.
Table fields and quick reading guide
Component: EQ US, EQ GLB, CREDIT, RATES2Y, SLOPE, USD, VOL, LIQ.
Z: current standardized value, green for positive risk tone where applicable.
Weight: contribution percent after normalization.
Composite: current index value.
Reading tip: a broadly green Z column with slope positive often precedes better long context.
 Inputs with guidance
Setup
 
Calc timeframe: default Daily. Leave blank to inherit chart.
Lookback: 50 to 1500. Larger length stabilizes regimes and delays turns.
EMA smoothing: 1 to 200. Higher smooths noise and delays signals.
Normalization
Winsorize z at ±3: caps extremes to reduce one off shocks.
Return window for equities: 5 to 260. Shorter reacts faster.
Weighting
Weight lookback: 20 to 520.
Weight mode: Equal or InvVol.
InvVol exponent gamma: 0.1 to 3. Higher compresses noisy components more.
Signals
Trade side: Long Short or Both.
Entry threshold long and short: portable z thresholds.
Exit line long and short: soft exits that give back less.
Slope lookback bars: 1 to 20.
Always long floor bfci ≥ X: macro easy mode keep long.
Force short exit when bfci < Y: macro stress guard.
 Confirm 
Use price trend filter and Price SMA length.
 View 
Glow line and Show component table.
 Symbols 
SPY ACWI HYG LQD VIX DXY US02Y US10Y BIL are defaults and can be changed.
 Realism and responsible publication
 
No performance claims. Past is not future.
Shapes can move intrabar and settle on close.
Execution is on standard candles only.
 Honest limitations and failure modes
 
Major economic releases and illiquid sessions can break assumptions.
Very quiet regimes reduce contrast. Use longer windows or higher thresholds.
Component proxies are ETFs and indexes and cannot match a proprietary FCI exactly.
 Strategy notice
 Orders are simulated on standard candles. All security calls use lookahead off. Nonstandard chart types are not supported for strategies.
 Entries and exits
 
Long rule: bfci cross above long threshold with positive slope and optional price filter OR bfci above the always long floor.
Short rule: bfci cross below short threshold with negative slope and optional price filter.
Exit rules: long exit on bfci cross below long exit or on a short signal. Short exit on bfci cross above short exit or on a long signal or on force close guard.
 Position sizing
 Percent of equity by default. Keep target risk per trade low. One percent is a sensible starting point. For this example we used 3% of the total capital
 Commisions 
We used a 0.05% comission and 5 tick slippage
 Legal 
Education and research only. Not investment advice. Test in simulation first. Use realistic costs.
Penunjuk dan strategi
Previous Day OHLC with Labels//@version=5
indicator("Previous Day OHLC with Labels (Visible Fix)", overlay=true)
// ========== SETTINGS ==========
col_open  = input.color(color.new(color.green, 0), "Open Line Color")
col_high  = input.color(color.new(color.red, 0), "High Line Color")
col_low   = input.color(color.new(color.blue, 0), "Low Line Color")
col_close = input.color(color.new(color.yellow, 0), "Close Line Color")
line_w    = input.int(2, "Line Width", minval=1, maxval=5)
show_labels = input.bool(true, "Show Labels")
// ========== PREVIOUS DAY DATA ==========
prev_open  = request.security(syminfo.tickerid, "D", open , lookahead=barmerge.lookahead_on)
prev_high  = request.security(syminfo.tickerid, "D", high , lookahead=barmerge.lookahead_on)
prev_low   = request.security(syminfo.tickerid, "D", low , lookahead=barmerge.lookahead_on)
prev_close = request.security(syminfo.tickerid, "D", close , lookahead=barmerge.lookahead_on)
prev_dow   = request.security(syminfo.tickerid, "D", dayofweek , lookahead=barmerge.lookahead_on)
// Get day name
day_name = prev_dow == dayofweek.monday    ? "Monday" :
           prev_dow == dayofweek.tuesday   ? "Tuesday" :
           prev_dow == dayofweek.wednesday ? "Wednesday" :
           prev_dow == dayofweek.thursday  ? "Thursday" :
           prev_dow == dayofweek.friday    ? "Friday" :
           prev_dow == dayofweek.saturday  ? "Saturday" : "Sunday"
// ========== DRAW LINES ==========
if barstate.islast
    // Extend across full chart view
    line.new(bar_index - 500, prev_open,  bar_index + 500, prev_open,  color=col_open,  width=line_w, extend=extend.both)
    line.new(bar_index - 500, prev_high,  bar_index + 500, prev_high,  color=col_high,  width=line_w, extend=extend.both)
    line.new(bar_index - 500, prev_low,   bar_index + 500, prev_low,   color=col_low,   width=line_w, extend=extend.both)
    line.new(bar_index - 500, prev_close, bar_index + 500, prev_close, color=col_close, width=line_w, extend=extend.both)
    if show_labels
        label.new(bar_index + 2, prev_open,  str.format("{0} Open  {1,number,0.#####}",  day_name, prev_open),  style=label.style_label_left, textcolor=color.white, color=col_open)
        label.new(bar_index + 2, prev_high,  str.format("{0} High  {1,number,0.#####}",  day_name, prev_high),  style=label.style_label_left, textcolor=color.white, color=col_high)
        label.new(bar_index + 2, prev_low,   str.format("{0} Low   {1,number,0.#####}",  day_name, prev_low),   style=label.style_label_left, textcolor=color.white, color=col_low)
        label.new(bar_index + 2, prev_close, str.format("{0} Close {1,number,0.#####}", day_name, prev_close), style=label.style_label_left, textcolor=color.white, color=col_close)
Point of Control (POC)**Point of Control (POC) Indicator**
This indicator identifies the price level where the most trading volume occurred over a specified lookback period (default: 365 days). The POC represents a significant support/resistance level where the market found the most acceptance.
**Key Features:**
- **POC Line**: Bright green horizontal line showing the highest volume price level
- **Volume Profile Analysis**: Divides price range into rows and calculates volume distribution
- **Value Area (Optional)**: Shows VAH and VAL levels containing 70% of total volume
- **Customizable**: Adjust lookback period, price resolution, colors, and line width
**How to Use:**
- POC acts as a magnet - price often returns to test these high-volume levels
- Strong support/resistance zone where significant trading activity occurred
- Useful for identifying key price levels for entries, exits, and stops
- Higher lookback periods (365 days) show longer-term significant levels
**Settings:**
- Lookback Period: Number of bars to analyze (default: 365)
- Price Rows: Calculation resolution - higher = more precise (default: 24)
- Toggle Value Area High/Low for additional context
---
My Rate Of Change. Buy equities if crosses up from 0, Sell equities and switch to commodities like Gold if crosses down 40
Prev 1-Min Volume • 5% Max Shares (TTP-ready)💡 Overview
This tool was built to help Trade The Pool (TTP) traders comply with the new “5% per minute volume” rule — without needing to calculate anything manually.
It automatically tracks the previous 1-minute volume, calculates 5% of it, and compares that to your planned order size.
If your planned size is within the limit, it shows green ✅.
If you’re above, it flashes red 🚫.
And when liquidity spikes allow for more size, you’ll see a green glow and 🔔 alert — so you can size up confidently without breaking the rule.
⚙️ Features
✅ Auto-calculates 5% volume cap from the previous 1-min candle
✅ Displays previous volume, max allowed shares, and your planned size
✅ TTP “different volume” scaling option (e.g. 0.69 for 45M vs 65M real volume)
✅ Per-bar slice suggestion for 10s scalpers
✅ Corner selector (top-left, top-right, bottom-left, bottom-right)
✅ Visual glow and 🔔 alert when liquidity window opens
✅ Compact and real-time responsive on 10s charts
All-in-One: EMA, ORB, PM, and Anchored VWAPAll-in-One: EMA, ORB, PM, and Anchored VWAP... ema 9/20/50/100/20 + opening range break + premarket high and lows + vwap all in one indicator enjoy.. all these can be turned on and off if you only want vwap and ema or pm and orb etc..
Rolling Pivot RibbonRolling Pivot Ribbon 
This indicator displays historical and developing pivot levels across multiple days,
creating a dynamic "ribbon" effect as pivots roll forward through time.
DESIGNED FOR: Intraday timeframes (≤1D). Shows warning on higher timeframes.
USE CASE: Identify key support/resistance levels, track pivot evolution, and spot
price interaction zones with enhanced visual clarity.
WHY? 
There comes a time in every Pinescript developer's evolution, they feel compelled to write a script that draws many lines, possibly triangles, into the future. This is mine. It's both totally useless, and a constant source of comfort to me. 
KEY FEATURES:
• Multiple pivot calculation methods (Classic, Camarilla)
• Historical pivot tracking with configurable lookback period (default 4 days)
• Real-time "developing" pivots that update intraday based on current day's HLC
• Gradient fills between adjacent pivot levels for visual depth
• 13 pivot levels: PP, R1-R6, S1-S6
TASTY MODE (Advanced):
• Intelligent filtering: only shows lines that price has recently intersected
• Dynamic transparency: opacity adjusts based on intersection frequency
• Auto-cleanup: removes stale lines that haven't been touched in X days
• Smart extensions: lines that see more action project further into the future
• Focus mode options to reduce chart clutter
VISUAL CONTROLS:
• Toggle individual pivot levels on/off
• Customizable colors and transparency for lines and fills
• Flexible label positioning (left-align or right-align)
• Adjustable projection length for pivot lines (defaults to 1. Set to 0 for just a ribbon)
EMA & ORB/PM LevelsScript that combines EMA and opening range and Premarket high and low levels all in one so you can save using three indicators and just use this one.
AMF PG Strategy v2.3AMF PG Strategy v2.3
1. Core Philosophy: Filtered and Volatility-Aware Trend Following
"AMF PG Strategy" is an advanced trend-following system designed to adapt to the dynamic nature of modern markets. The strategy's core philosophy is not just to follow the trend but also to wait for the right conditions to enter the market.
This is not a "black box." It is a rules-based framework that gives the user full control over various market filters. By requiring multiple conditions to be met simultaneously, the strategy aims to filter out low-quality signals and focus only on high-probability trend opportunities.
2. Core Engine: AMF PG Trend Following
At the heart of the strategy is a proprietary, volatility-aware trend-following mechanism called AMF PG (Praetorian Guard). This engine operates as follows:
Dynamic Bands: Creates a dynamic upper and lower band around the price that is constantly recalculated. The width of these bands is not fixed; It dynamically adjusts based on recent market volatility, volume flow, and price expansion. This adaptive structure allows the strategy to adapt to both calm and high-volatility markets.
Entry Signals: A buy signal is triggered when the price rises above the upper band. A sell signal is triggered when the price falls below the lower band. However, these signals are executed only when all the active filters described below give the green light.
Trailing Stop-Loss: When a position is entered, the opposite band automatically acts as a trailing stop-loss level. For example, when a buy position is opened, the lower band follows the price as a stop-loss. This allows for profit retention and trend continuation.
3. Multi-Layered Filter System: Understanding the Market
The power of this strategy comes from its modular filter system, which allows the user to filter market conditions based on their own analysis. Each filter can be enabled or disabled individually in the settings:
Filter 1: Trend Strength (ADX Filter): This filter confirms whether there is a strong trend in the market. It uses the ADX (Average Directional Index) indicator and only allows trades if the ADX value is above a certain threshold. This helps avoid trading in weak or directionless markets. It also confirms the direction of the trend by checking the position of the DMI (+DI and -DI) lines.
Filter 2: Sideways Market (Chop Index Filter): This filter determines whether the market is excessively choppy or directionless. Using the Chop Index, this filter aims to protect against fakeouts by blocking trades when the market is highly indecisive.
Filter 3: Market Structure (Hurst Exponent Filter): This is one of the strategy's most advanced filters. It analyzes the current market behavior using the Hurst Exponent. This mathematical tool attempts to determine whether a market tends to trend (permanent), tends to revert to the mean (anti-permanent), or moves randomly. This filter ensures that signals are generated only when market structure supports trending trades.
4. Risk Management: Maximum Drawdown Protection
This strategy includes a built-in capital protection mechanism. Users can specify the percentage of their capital they will tolerate to decline from its peak. If the strategy's capital reaches this set drawdown limit, the protection feature is activated, closing all open positions and preventing new trades from being opened. This acts as an emergency brake to protect capital against unexpected market conditions.
5. Automation Ready: Customizable Webhook Alerts
The strategy is designed for traders who want to automate their signals. From the Settings menu, you can configure custom alert messages in JSON format, compatible with third-party automation services (via Webhooks).
6. Strategy Backtest Information
Please note that past performance is not indicative of future results. The published chart and performance report were generated on the 4-hour timeframe of the BTCUSD pair with the following settings:
Test Period: January 1, 2016 - October 31, 2025
Default Position Size: 15% of Capital
Pyramiding: Closed
Commission: 0.0008
Slippage: 2 ticks (Please enter the slippage you used in your own tests)
Testing Approach: The published test includes 423 trades and is statistically significant. It is strongly recommended that you test on different assets and timeframes for your own analysis. The default settings are a template and should be adjusted by the user for their own analysis.
MACD (classic) + Divergences (wicks & bodies, fast/slow)macd with divergences. Wicks + bodies. Two settings for right bar
Gold THB per Baht (XAU -> Thai baht gold)What it does 
This indicator converts international gold prices (XAU) into Thai retail “baht gold” price (THB per 1 baht gold weight) in real time. It multiplies the XAU price (per troy ounce) by USD/THB and converts ounces to Thai baht-weight using the exact gram ratios.
 Formula
 
THB per baht gold = XAU (USD/oz) × USDTHB × (15.244 / 31.1035) × (1 + Adjustment%) + FlatFeeTHB
1 troy ounce = 31.1035 g
1 Thai baht gold = 15.244 g
Conversion factor ≈ 0.490103
Key Levels: Prior Open & Close (D/W/M/Q/Y)This indicator plots the previous period's open and close levels for multiple timeframes—daily, weekly, monthly, quarterly, and yearly—on your chart. It uses Pine Script's request.security() function to pull the prior period's open and close prices for each timeframe, then draws horizontal dotted lines extending to the right at those levels. Each line is labeled and color-coded for easy distinction. These levels can help highlight potential support/resistance areas, but they are reference points only and not trading signals.
SJ WaveTrendWaveTrend Indicator – Full English Brief for TradingView
Description:
The WaveTrend Oscillator (WT) is a momentum-based indicator originally developed by LazyBear, designed to identify overbought and oversold market conditions with high precision. It is conceptually similar to the RSI and Stochastic Oscillator but uses a wave-based mathematical approach to detect turning points in price action earlier and more smoothly.
⸻
🔍 How It Works
WaveTrend analyzes the difference between price and its moving average (typically the exponential moving average of the Typical Price).
It then applies multiple layers of smoothing to filter out noise and produce two oscillating lines — WT1 (fast) and WT2 (slow).
The crossing points between WT1 and WT2 are used to identify momentum shifts:
	•	When WT1 crosses above WT2 from below the oversold zone → Bullish signal
	•	When WT1 crosses below WT2 from above the overbought zone → Bearish signal
⸻
⚙️ Core Formula Concept
The WaveTrend calculation typically follows this process:
	1.	Compute the Typical Price (TP) = (High + Low + Close) / 3
	2.	Calculate the Exponential Moving Average (EMA) of TP over a short length
	3.	Determine the Raw Wave (ESA) and De-trended Price Oscillator (DPO)
	4.	Apply double smoothing to produce the final WT1 and WT2 values
These smoothed waves behave like energy waves that expand and contract based on market volatility — hence the name WaveTrend.
⸻
📈 Interpretation
	•	Overbought Zone: WT values above +60 to +70
	•	Oversold Zone: WT values below -60 to -70
	•	Crossovers: WT1 crossing WT2 signals a potential trend reversal
	•	Divergence: When price makes a new high/low but WT does not, it signals momentum weakening
⸻
🧠 Trading Insights
	•	Best used on higher timeframes (H1 and above) for trend confirmation, and on lower timeframes (M15–M30) for precise entries.
	•	Combine with ADX, EMA Cloud, or Volume Filters to confirm real momentum shifts and avoid false signals.
	•	You can highlight WT Diff (WT1 - WT2) to visualize momentum expansion and contraction; large positive or negative differences often precede strong reversals.
Consecutive Gap FinderLooks for consecutive gaps based on daily chart using ATR multiplier.
Highlights them when a certain number are found.
نقدینگی و اردر های نواحی {وحید}// This work is licensed under a Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) creativecommons.org
// © amir
//@version=5
indicator("نقدینگی و اردر های نواحی {وحید}"
  , overlay = true
  , max_lines_count = 500
  , max_labels_count = 500
  , max_boxes_count = 500)
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
length = input(14, 'Pivot Lookback')
area = input.string('Wick Extremity', 'Swing Area', options =  )
intraPrecision = input(false, 'Intrabar Precision', inline = 'intrabar')
intrabarTf = input.timeframe('1', ''              , inline = 'intrabar')
filterOptions = input.string('Count', 'Filter Areas By', options =  , inline = 'filter')
filterValue   = input.float(0, ''                                            , inline = 'filter')
//Style
showTop      = input(true, 'Swing High'              , inline = 'top', group = 'Style')
topCss       = input(color.red, ''                   , inline = 'top', group = 'Style')
topAreaCss   = input(color.new(color.red, 50), 'Area', inline = 'top', group = 'Style')
showBtm      = input(true, 'Swing Low'                , inline = 'btm', group = 'Style')
btmCss       = input(color.teal, ''                   , inline = 'btm', group = 'Style')
btmAreaCss   = input(color.new(color.teal, 50), 'Area', inline = 'btm', group = 'Style')
labelSize = input.string('Tiny', 'Labels Size', options =  , group = 'Style')
//-----------------------------------------------------------------------------}
//Functions
//-----------------------------------------------------------------------------{
n = bar_index
get_data()=>  
  = request.security_lower_tf(syminfo.tickerid, intrabarTf, get_data())
get_counts(condition, top, btm)=>
    var count = 0
    var vol = 0.
    if condition
        count := 0
        vol := 0.
    else
        if intraPrecision
            if n > length
                if array.size(v ) > 0
                    for   in v 
                        vol += array.get(l , index) < top and array.get(h , index) > btm ? element : 0
        else
            vol += low  < top and high  > btm ? volume  : 0
        
        count += low  < top and high  > btm ? 1 : 0
     
set_label(count, vol, x, y, css, lbl_style)=>
    var label lbl = na
    var label_size = switch labelSize
        'Tiny' => size.tiny
        'Small' => size.small
        'Normal' => size.normal
    target = switch filterOptions
        'Count'  => count
        'Volume' => vol
    if ta.crossover(target, filterValue)
        lbl := label.new(x, y, str.tostring(vol, format.volume)
          , style = lbl_style
          , size = label_size
          , color = #00000000
          , textcolor = css)
    if target > filterValue
        label.set_text(lbl, str.tostring(vol, format.volume))
set_level(condition, crossed, value, count, vol, css)=>
    var line lvl = na
    target = switch filterOptions
        'Count'  => count
        'Volume' => vol
    if condition
        if target  < filterValue 
            line.delete(lvl )
        else if not crossed 
            line.set_x2(lvl, n - length)
        lvl := line.new(n - length, value, n, value
          , color = na)
    if not crossed 
        line.set_x2(lvl, n+3)
    
    if crossed and not crossed 
        line.set_x2(lvl, n)
        line.set_style(lvl, line.style_dashed)
    if target > filterValue
        line.set_color(lvl, css)
set_zone(condition, x, top, btm, count, vol, css)=>
    var box bx = na
    target = switch filterOptions
        'Count'  => count
        'Volume' => vol
    if ta.crossover(target, filterValue)
        bx := box.new(x, top, x + count, btm
          , border_color = na
          , bgcolor = css)
    
    if target > filterValue
        box.set_right(bx, x + count)
//-----------------------------------------------------------------------------}
//Global variables
//-----------------------------------------------------------------------------{
//Pivot high
var float ph_top = na
var float ph_btm = na
var bool  ph_crossed = na
var       ph_x1 = 0
var box   ph_bx = box.new(na,na,na,na
  , bgcolor = color.new(topAreaCss, 80)
  , border_color = na)
//Pivot low
var float pl_top = na
var float pl_btm = na
var bool  pl_crossed = na
var       pl_x1 = 0
var box   pl_bx = box.new(na,na,na,na
  , bgcolor = color.new(btmAreaCss, 80)
  , border_color = na)
//-----------------------------------------------------------------------------}
//Display pivot high levels/blocks
//-----------------------------------------------------------------------------{
ph = ta.pivothigh(length, length)
//Get ph counts
  = get_counts(ph, ph_top, ph_btm)
//Set ph area and level
if ph and showTop
    ph_top := high 
    ph_btm := switch area 
        'Wick Extremity' => math.max(close , open )
        'Full Range' => low 
    
    ph_x1 := n - length
    ph_crossed := false
    box.set_lefttop(ph_bx, ph_x1, ph_top)
    box.set_rightbottom(ph_bx, ph_x1, ph_btm)
else
    ph_crossed := close > ph_top ? true : ph_crossed
    
    if ph_crossed
        box.set_right(ph_bx, ph_x1)
    else
        box.set_right(ph_bx, n+3)
if showTop
    //Set ph zone
    set_zone(ph, ph_x1, ph_top, ph_btm, ph_count, ph_vol, topAreaCss)
    //Set ph level
    set_level(ph, ph_crossed, ph_top, ph_count, ph_vol, topCss)
    //Set ph label
    set_label(ph_count, ph_vol, ph_x1, ph_top, topCss, label.style_label_down)
//-----------------------------------------------------------------------------}
//Display pivot low levels/blocks
//-----------------------------------------------------------------------------{
pl = ta.pivotlow(length, length)
//Get pl counts
  = get_counts(pl, pl_top, pl_btm)
//Set pl area and level
if pl and showBtm
    pl_top := switch area 
        'Wick Extremity' => math.min(close , open )
        'Full Range' => high  
    pl_btm := low 
    
    pl_x1 := n - length
    pl_crossed := false
    
    box.set_lefttop(pl_bx, pl_x1, pl_top)
    box.set_rightbottom(pl_bx, pl_x1, pl_btm)
else
    pl_crossed := close < pl_btm ? true : pl_crossed
    if pl_crossed
        box.set_right(pl_bx, pl_x1)
    else
        box.set_right(pl_bx, n+3)
if showBtm
    //Set pl zone
    set_zone(pl, pl_x1, pl_top, pl_btm, pl_count, pl_vol, btmAreaCss)
    
    //Set pl level
    set_level(pl, pl_crossed, pl_btm, pl_count, pl_vol, btmCss)
    //Set pl labels
    set_label(pl_count, pl_vol, pl_x1, pl_btm, btmCss, label.style_label_up)
//-----------------------------------------------------------------------------}
Iani Indicator 📊 **Iani Indicator**
**Clean and simple trend direction tool**
**Description:**
Iani Indicator is a compact and easy-to-read visual tool based on EMA crossovers to identify market bias: **Buy, Sell, or Neutral**.
* The background between EMAs shows the current trend:
  🟩 **Green** – bullish trend (Buy)
  🟥 **Red** – bearish trend (Sell)
  🟨 **Yellow** – flat / neutral zone
* Text labels “Buy”, “Sell”, or “Neutral” appear automatically when direction changes.
* Works smoothly on any timeframe – ideal for both scalping and swing trading.
**Purpose:**
To give traders a clear, noise-free view of market direction at a glance.
---
👉 Short version (for TradingView “Short Description” field):
**Simple EMA-based indicator showing Buy, Sell, or Neutral bias with clean background colors.**
Vol Vahid// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © amir
//@version=5
indicator("Vol Vahid")
 =ta.dmi(14,14)
sw=input.bool(true,'Highlight Ranging/Sideways')
showbarcolor=input.bool(true,'Apply Barcolor')
show_Baseline=input.bool(true,'Show Hull Trend')
rsiLengthInput = input.int(14, minval=1, title="RSI Length1", group="RSI Settings")
rsiLengthInput2 = input.int(28, minval=1, title="RSI Length2", group="RSI Settings")
trendlen= input(title='Hull Trend Length', defval=30,group='Hull Trend')
oversold=input.int(30, minval=1, title="Over Sold", group="RSI Settings")
overbought=input.int(70, minval=1, title="Over Bought", group="RSI Settings")
BBMC=ta.hma(close,trendlen)
MHULL = BBMC 
SHULL = BBMC 
hmac=MHULL > SHULL ?color.new(#00c3ff , 0):color.new(#ff0062, 0)
buysignal=MHULL > SHULL 
sellsignal=MHULL < SHULL
frsi=ta.hma(ta.rsi(close,rsiLengthInput),10)
srsi=ta.hma(ta.rsi(close,rsiLengthInput2),10)
hullrsi1=ta.rsi(MHULL,rsiLengthInput)
hullrsi2=ta.rsi(SHULL,rsiLengthInput)
rsic=frsi>srsi?color.new(#00c3ff , 0):color.new(#ff0062, 0)
barcolor(showbarcolor?hmac:na)
hu1=plot(show_Baseline?hullrsi1:frsi,title='HMA1',color=color.gray,linewidth=1,display=display.none)
hu2=plot(show_Baseline?hullrsi2:srsi,title='HMA2',color=color.gray,linewidth=1,display=display.none)
fill(hu1,hu2,title='HULL RSI TREND',color=show_Baseline?hmac:rsic)
fill(hu1,hu2,title='HULL with Sideways',color=sw and adx<20?color.gray:na)
rsiUpperBand2 = hline(90, "RSI Upper Band(90)", color=color.red,linestyle=hline.style_dotted,display=display.none)
rsiUpperBand = hline(overbought, "RSI Upper Band", color=color.red,linestyle=hline.style_dotted,display=display.none)
fill(rsiUpperBand2,rsiUpperBand,title='Buy Zone',color=color.red,transp=80)
hline(50, "RSI Middle Band", color=color.new(#787B86, 50),linestyle=hline.style_solid)
rsiLowerBand = hline(oversold, "RSI Lower Band", color=color.green,linestyle=hline.style_dotted,display=display.none)
rsiLowerBand2 = hline(10, "RSI Lower Band(10)", color=color.green,linestyle=hline.style_dotted,display=display.none)
fill(rsiLowerBand,rsiLowerBand2,title='Sell Zone',color=color.green,transp=80)
plotshape(buysignal and sellsignal  ?hullrsi1 :na, title='Buy', style=shape.triangleup, location=location.absolute,  color=color.new(color.yellow, 0), size=size.tiny, offset=0)
plotshape(sellsignal  and buysignal  ?hullrsi1 :na, title='Sell', style=shape.triangledown, location=location.absolute, color=color.new(color.red, 0), size=size.tiny, offset=0)
alertcondition(buysignal and sellsignal  ,title='RSI TREND:Buy Signal',message='RSI TREND: Buy Signal')
alertcondition(sellsignal  and buysignal ,title='RSI TREND:Sell Signal',message='RSI TREND: Sell Signal')
Day Range Divider DTSCopied it for DTS purposes to ensure proper tracking, testing, and verification within the DTS workflow. This copy is intended for reference, analysis, and any required adjustments without affecting the original version.
Sector Relative StrengthThis indicator measures a stock's Real Relative Strength against its sector benchmark, helping you identify stocks that are outperforming or underperforming their sector peers. 
The concept is based on the Real Relative Strength methodology popularized by the r/realdaytrading community.
Unlike traditional relative strength calculations that simply compare price ratios, this indicator uses a more sophisticated approach that accounts for volatility through ATR (Average True Range), providing a normalized view of true relative performance.
Key Features
Automatic Sector Detection
Automatically detects your stock's sector using TradingView's built-in sector classification
Maps to the appropriate SPDR Sector ETF (XLK, XLF, XLV, XLY, XLP, XLI, XLE, XLU, XLB, XLC)
Supports all 20 TradingView sectors
Sector ETF Mappings
The indicator automatically compares your stock against:
Technology: XLK (Technology Services, Electronic Technology)
Financials: XLF (Finance sector)
Healthcare: XLV (Health Technology, Health Services)
Consumer Discretionary: XLY (Retail Trade, Consumer Services, Consumer Durables)
Consumer Staples: XLP (Consumer Non-Durables)
Industrials: XLI (Producer Manufacturing, Industrial Services, Transportation, Commercial Services)
Energy: XLE (Energy Minerals)
Utilities: XLU
Materials: XLB (Non-Energy Minerals, Process Industries)
Communications: XLC
Default: SPY (for Miscellaneous or unclassified sectors)
Customizable Settings
Comparison Mode: Choose between automatic sector comparison or custom symbol
Length: Adjustable lookback period (default: 12)
Smoothing: Apply moving average to reduce noise (default: 3)
Visual Clarity
Green line: Stock is outperforming its sector
Red line: Stock is underperforming its sector
Zero baseline: Clear reference point for performance
Clean info box: Shows which ETF you're comparing against
How It Works
The indicator calculates relative strength using the following methodology:
Rolling Price Change: Measures the price movement over the specified length for both the stock and its sector ETF
ATR Normalization: Uses Average True Range to normalize for volatility differences
Power Index: Calculates the sector's strength relative to its volatility
Real Relative Strength: Compares the stock's performance against the sector's power index
Smoothing: Applies a moving average to reduce single-candle spikes
Formula:
Power Index = (Sector Price Change) / (Sector ATR)
RRS = (Stock Price Change - Power Index × Stock ATR) / Stock ATR
Smoothed RRS = SMA(RRS, Smoothing Length)
RSI + MFIRSI and MFI combined, width gradient fields if OS or OB, shows divergences separate for wicks and bodies, shows dots when mfi and rsi oversold at the same time. 
Continuation Probability (0–100)This indicator helps measure how likely the current candle trend will continue or reverse, giving a probability score between 0–100.
It combines multiple market factors trend, candle strength, volume, and volatility to create a single, intuitive signal.
RSI + Elder Bull-Bear pressure RSI + Bull/Bear (Elder-Ray enhanced RSI) 
 What it is 
An extended RSI that overlays Elder-Ray Bull/Bear Power on the same, zero-centered scale. You get classic RSI regime cues plus a live read of buy/sell pressure, with optional smoothing, bands, and right-edge value labels.
 Key features 
RSI with bands – default bands 30 / 50 / 70 (editable).
Bull/Bear Power (Elder) – ATR-normalized; optional EMA/SMA/RMA/HMA smoothing.
One-pane overlay – RSI and Bull/Bear share a common midline (RSI-50 ↔ panel 0).
Right-edge labels – always visible at the chart’s right margin with adjustable offsets.
 How to read it 
Cyan line = RSI (normalized)
Above the mid band = bullish regime; below = bearish regime.
Green = Bull Power, Red = Bear Power
Columns/lines above 0 show buy pressure; below 0 show sell pressure.
Smoothing reduces noise; zero-line remains your key reference.
 Trade logic (simple playbook)
Entry 
BUY (primary):
RSI crosses up through 50 (regime turns bullish), and
Bull (green) crosses up through 0 (buy pressure confirms).
SELL (primary):
RSI crosses down through 50, and
Bear (red) crosses down through 0 (sell pressure confirms).
 Alternative momentum entries 
Aggressive BUY: Bull (green) pushes above RSI-80 band (strong upside impulse).
Aggressive SELL: Bear (red) pushes below RSI-30 band (strong downside impulse).
 Exits / trade management 
In a long: consider exiting or tightening stops if Bear (red) dips below the 0 line (rising sell pressure) or RSI loses 50.
In a short: consider exiting or tightening if Bull (green) rises above 0 or RSI reclaims 50.
Tip: “0” on the panel is your pressure zero-line (maps to RSI-50). Most whipsaws happen near this line; smoothing (e.g., EMA 21) helps.
 Defaults (on first load) 
RSI bands: 30 / 50 / 70 with subtle fills.
Labels: tiny, pushed far right (large offsets).
Bull/Bear smoothing: EMA(21), smoothed line plot mode.
RSI plotted normalized so it overlaps the pressure lines cleanly.
Tighten or loosen the Bull/Bear thresholds (e.g., Bull ≥ +0.5 ATR, Bear ≤ −0.5 ATR) to demand stronger confirmation.
 Settings that matter 
Smoothing length/type – balances responsiveness vs. noise.
Power/RSI Gain – visual scaling only (doesn’t change logic).
Band placement – keep raw 30/50/80 or switch to “distance from 50” if you prefer symmetric spacing.
Label offsets – move values clear of the last bar/scale clutter.
 Good practices 
Combine with structure/ATR stops (e.g., 1–1.5× ATR, swing high/low).
In trends, hold while RSI stays above/below 50 and the opposite pressure line doesn’t dominate.
In ranges, favor signals occurring near the mid band and take profits at the opposite band.
Disclaimer: This is a research/visual tool, not financial advice at any kind. Test your rules on multiple markets/timeframes and size positions responsibly.
Prev Daily Closes — Prev1 & Prev2 (intraday) RAJESH MAYEKARit gives last 2 days close line. when last 2 days close broke you get momentum for BTST 






















