Mitigation Blocks — Lite (ICT) + Stats + Entry75Mitigation Blocks — Lite (ICT) + Stats + Entry75
What it does
This indicator finds recent Mitigation Blocks (ICT-style) and draws a single active bullish and bearish block on the chart.
It also plots the 75% entry level for each active block and shows a compact performance HUD (“Отработано / Worked”) so you can quickly judge how well blocks have been reacting on the current symbol and timeframe.
Logic (brief)
Structure impulse
A new block is created when price breaks the last swing (pivot-based) with an optional ATR body filter.
After an upswing break → search the most recent bearish candle within a lookback window → its body defines the bullish block (top/bottom = max/min of that candle’s open/close).
After a downswing break → search the most recent bullish candle → defines the bearish block.
Touch & mitigation
First time price touches a block, the block is marked mitigated (border becomes dashed).
Entry line for that block is removed (no history clutter to the left).
75% entry levels
Long (bullish block): entry = top − 0.75 × (top − bottom) (deeper inside from the top).
Short (bearish block): entry = bottom + 0.75 × (top − bottom) (deeper inside from the bottom).
Lines are drawn only to the right (history on the left is hidden).
Stats (HUD)
The HUD shows Worked% per side: percentage of first touches that reached a simple target in the check window.
Current version uses a conservative proxy: success if, within the next bars, price moved away from the block by at least ~1×ATR (internally calculated) without first invalidating the block’s opposite boundary.
Values are accumulated while the script runs on the loaded chart range.
Inputs
Structure
Swing length (pivot) — pivot size to detect last swing.
Require minimum impulse / Min body × ATR / ATR length — filter for strong displacement bars.
Search last opposite candle (bars back) — lookback to find the candle that defines the block.
Style
Fill & border colors for bullish/bearish blocks.
Mitigated border color (dashed on first touch).
Entry 75% lines
Show 75% entry lines (on/off)
Colors and line width.
Autoscale
Optional hidden anchor plots for better autoscaling.
On-chart elements
Active bullish/bearish block (rectangle, extended right).
Dashed border once the block is mitigated (first touch).
75% entry line for each non-mitigated block (drawn only to the right; removed on mitigation).
HUD (top-right):
LONG | Worked: XX.X% |
SHORT | Worked: XX.X% |
If there is no active (non-mitigated) block on a side, the entry cell shows “ожидаем” (“waiting”).
How to read it
Trade from block to block: use the 75% line as a reference entry inside the zone; stops are commonly placed beyond the opposite side of the block.
Worked% helps compare symbols/timeframes: higher with a decent sample typically means more reliable reactions.
The indicator shows only the latest valid block per side to keep the chart clean.
Notes & tips
This is a discretionary tool intended to support ICT-style execution; it is not a strategy and does not place trades.
Try different timeframes. Many users prefer M5–H1 for entries and H4–D1 for context.
You can turn off entry lines if you only want the zones.
Because stats are computed on the visible history while the script runs, switching symbols/TFs will reset the counters.
Inputs (defaults)
Pivot length: 5
ATR length: 14
Min body × ATR: 1.0 (enable/disable filter)
Opposite candle lookback: 5
Entry 75% lines: ON
Indicatori e strategie
Bollinger ALTswap Alert v1.0 (MA28 Rotation ALT↔BTC)Inspired by: Bollinger Awesome Alert R1 by JustUncleL
What is it?
BBALTSWAP overlays Bollinger Bands (20, 2), a 3-EMA, and a Rotation MA (default 28), then gives state-change alerts to rotate between ALT ↔ BTC on any ALT/BTC chart.
Core rotation rule
• Rotate → ALT when close > Bollinger middle and close > MA28.
• Rotate → BTC when close < Bollinger middle and close < MA28.
• Otherwise: Wait (no rotation).
Labels only print when the state changes (to avoid spam). You can also compute the rotation on a higher timeframe (default 4h) while viewing a lower one (e.g., 1h).
Optional extras
• Breakout arrows (scalping-style) when 3-EMA crosses the Bollinger middle with an Awesome Oscillator direction filter.
• Bollinger Squeeze coloring (relative width) to highlight expansion/contraction.
• Min bars between labels to throttle how often rotation labels appear.
Inputs (highlights)
• Use EMA for Bollinger / Rotation MA
• Bollinger length & multiplier
• AO fast/slow lengths
• Higher-timeframe selector for rotation (default 240 = 4h)
• Show breakout arrows / show “Wait” / min bars between labels
How to use (simple playbook)
1. Chart: open your ALT/BTC pair (e.g., ETHBTC).
2. Direction: leave rotation HTF at 4h for steadier signals.
3. Execution: take rotations on bar close; manage entries on your lower TF (1h/15m) if desired.
4. Override check (optional): when BTCUSDT is in a fresh breakout, prefer BTC even if ALT flashes briefly.
Alerts
Add two alerts, Once per bar close:
• “Rotate to ALT (state change)”
• “Rotate to BTC (state change)”
Notes
• Works on any ALT/BTC pair.
• The breakout arrows are optional and independent from the rotation signals.
• This tool is educational; not financial advice.
9:30 USA OPENEasy if it go up it will turn green and you can lng if it goes down it will turn red and you can short
Quant Trend + Donchian (Educational, Public-Safe)What this does
Educational, public-safe visualization of a quant regime model:
• Trend : EMA(64) vs EMA(256) (EWMAC proxy)
• Breakout : Donchian channel (200)
• Volatility-awareness : internal z-scores (not plotted) for concept clarity
Why it’s useful
• Shows when trend & breakout align (clean regimes) vs conflict (chop)
• Helps explain why volatility-aware systems size up in smooth trends and scale down in noise
How to read it
• EMA64 above EMA256 with price near/above Donchian high → trend-following alignment
• EMA64 below EMA256 with price near/below Donchian low → bearish alignment
• Inside channel with EMAs tangled → range/chop risk
Notes
• Indicator is educational only (no orders).
• Built entirely with TradingView built-ins.
• For consistent visuals: enable “Indicator values on price scale” and disable “Scale price chart only” in Settings → Scales .
HTF Candle Overlay (Boxes + Wicks) 1hr / SolalDescription:
This indicator lets you visualize higher time frame (HTF) candles directly on a lower time frame chart.
It draws each HTF candle as a transparent box (the body) with wicks extending to the high and low. The boxes automatically update as each higher time frame candle forms and remain fixed once the candle closes.
You can choose any higher time frame (e.g., 1H, 4H, 1D) while trading on lower intervals (like 1m, 5m, 15m) to see key market structure and price zones.
Features:
Display candles from any higher time frame on your current chart.
Customizable colors for bullish and bearish candles.
Adjustable transparency, border and wick thickness.
History depth setting to control how many past HTF candles are displayed.
No repainting — candles stay fixed once closed.
Use case:
Ideal for traders who want to monitor higher time frame price action (support/resistance, trend direction) without switching chart time frames.
EMA 9/18 Weekly on all time frameweekly ema 9/18 on all your time frame
If you want to have your weekly time frame ema on all your time frame this indicator is made for you !
Candle Color [AY¹]Visually highlight specific time periods with custom colors on intraday charts.
Ideal for session-based traders who want to emphasize New York, London or any custom trading hours. Developed by AY¹
Candle Color Highlighter
A simple yet powerful intraday visualization tool that colors candles or chart background during your chosen trading sessions.
Perfect for traders who rely on time-based confluences — such as ICT, SMC, or session scalping frameworks.
🔧 Key Features
✅ Highlight up to four custom time periods (e.g. London Open, NY Open, Lunch Hour, etc.)
✅ Supports multiple highlight styles:
• Bar Color only
• Background only
• Both
✅ Full timezone control (Exchange, UTC, New York, London, Tokyo, or custom UTC+3)
✅ Works on all intraday timeframes or only those you select (1m–4h).
✅ Optional labels marking session starts.
✅ Integrated alerts when any period becomes active.
✅ Informative status table showing timezone, timeframe, and active period.
🕒 Use Cases
Highlight New York Killzone (07:30–09:30) or London Open (02:00–03:00)
Separate different liquidity windows
Emphasize your backtest periods
Combine with volume, displacement, or structure indicators for time-based confluence setups
🎨 Customization
Each of the four configurable periods allows you to choose:
Start/End time
Custom color and transparency
Session label visibility
Highlight style preference
💡 Example Setup
Period Session Time Color Notes
Period 1 02:00–03:00 Magenta London Killzone
Period 2 07:30–08:30 Yellow NY Pre-market
Period 3 08:30–09:30 Blue NY Open
Period 4 09:30–10:00 Green Initial Balance
MACD / AO Alineación (V21) PublicA long or short indicator for any timeframe. It's important to consider volatility and ADX to find the most appropriate momentum. There are also other details to consider.
Episodic Pivot -AparnaEpisodic pivot when volume are 5x of SMA 14 and price is 10% higher than previous close
MACD-V+ (ATR Normalized MACD)MACD-V+ is an ATR-normalized MACD tool that focuses on true turning points inside Overbought/Oversold zones. It marks a signal only when the MACD’s slope changes direction and shows real progress back toward the zero line, with an optional dwell (depth & time) filter so you don’t get faked out by shallow pokes into a zone. Clean visuals, “first-in-zone” gating, and configurable labeling make it practical for discretionary and systematic traders alike.
For best results, adjust Overbought and Oversold levels based on stock volatility. The default settings of 150 and -150 are for highly volatile tickers. Reduce for less volatile tickers.
Please help me improve the code for everyone.
Bollinger Breakout Candle ShadingSubtle shading behind the bars when the price trades outside of the Bollinger bands.
Manipolazione Luca C H1Osservando le candele h1 neglio orari ( di apertura sessione london e ny) possiamo cogliere molto piu' facilmente le manipolazioni per poter aprire le operazioni o scendere di time frame aspettando un altri trigger di entrata.
By observing the h1 candles during the opening hours (London and New York session) we can much more easily detect manipulations in order to open trades or move down the time frame waiting for other entry triggers.
Manipolazione Luca C.(H1)Osservando le candele su H1 se notiamo una manipolazione evidente entriamo a mercato.
Tristan's Three Line Strike PatternThree Line Strike Indicator (5-Minute Timeframe)
This indicator highlights Three Line Strike candlestick patterns on a 5-minute chart . The Three Line Strike is a rare four-candle formation that often signals trend continuation rather than reversal.
Bullish Three Line Strike (green “3LS long” above the candle):
Three strong bullish candles in a row are followed by a large bearish candle that completely engulfs the prior three. Despite looking bearish, this setup often indicates strength in the uptrend.
Bearish Three Line Strike (red “3LS sell” below the candle):
Three consecutive bearish candles are followed by a large bullish engulfing candle. Although it looks like a reversal, the downtrend commonly resumes.
How to use on the 5-min chart:
Watch for the labels marking the pattern.
A bullish signal suggests that the upward move is likely to continue after the engulfing candle.
A bearish signal suggests that the downtrend is likely to continue after the engulfing candle.
These signals are not entry/exit triggers on their own—I suggest you combine them with trend confirmation (e.g., moving averages, momentum indicators, or volume analysis) before acting.
Use good risk management, and don't buy / sell based on these indicators alone.
Level Marking - Day Levels, Fib, Swing high Low)Plots key day levels: previous day PH/PL/PC and live current CH/CL, each as extend-right lines with optional dashed style and right-side zig-zag price labels.
Adds “Golden Fib” 0.5 & 0.618 from the prior day’s High–Low (you can flip Low→High or High→Low to match TV’s Fib tool).
Marks fast swings (3-bar) with blue boxes that trail the latest price—great for quick scalps.
Marks slow swings (7-bar) with red horizontal lines extended to the right; price labels sit at the line ends.
Everything updates in real time each bar and respects TradingView’s future-object limits.
VWAP Deviation Oscillator [BackQuant]VWAP Deviation Oscillator
Introduction
The VWAP Deviation Oscillator turns VWAP context into a clean, tradeable oscillator that works across assets and sessions. It adapts to your workflow with four VWAP regimes plus two rolling modes, and three deviation metrics: Percent, Absolute, and Z-Score. Colored zones, optional standard deviation rails, and flexible plot styles make it fast to read for both trend following and mean reversion.
What it does
This tool measures how far price is from a chosen VWAP and expresses that gap as an oscillator. You can view the deviation as raw price units, percent, or standardized Z-Score. The plot can be a histogram or a line with optional fills and sigma bands, so you can quickly spot polarity shifts, overbought and oversold conditions, and strength of extension.
VWAP modes track a session VWAP that resets (4H, Daily, Weekly) or a rolling VWAP that updates continuously over a fixed number of bars or days.
Deviation modes let you choose the lens: Percent, Absolute, or Z-Score. Each highlights different aspects of stretch and mean pressure.
Visual encoding uses a 10-zone color palette to grade the magnitude of deviation on both sides of zero.
Volatility guards compute mode-specific sigma so thresholds are stable even when volatility compresses.
Why this works
VWAP is a high signal anchor used by institutions to gauge fair participation. Deviations around VWAP cluster in regimes: mild oscillations within a band, decisive pushes that signal imbalance, and standardized extremes that often precede either continuation or snapback. Expressing that distance as a single time series adds clarity: bias is the oscillator’s sign, risk context is its magnitude, and regime is the way it behaves around sigma lines.
How to use it
Trend following
Favor the side of the zero line. Bullish when the oscillator is above zero and making higher swing highs. Bearish when below zero and making lower swing lows. Use +1 sigma and +2 sigma in your mode as strength tiers. Pullbacks that hold above zero in uptrends, or below zero in downtrends, are often continuation entries.
Mean reversion
Fade stretched readings when structure supports it. Look for tests of +2 sigma to +3 sigma that fail to progress and roll back toward zero, or the mirror on the downside. Z-Score mode is best when you want standardized gates across assets. Percent mode is intuitive for intraday scalps where a given percent stretch tends to mean revert.
Session playbook
Use Daily or Weekly VWAP for intraday or swing context. Rolling modes help when the asset lacks clean session boundaries or when you want a continuous anchor that adapts to liquidity shifts.
Key settings
VWAP computation
VWAP Mode = 4 Hours, Daily, Weekly, Rolling (Bars), Rolling (Days). Session modes reset the VWAP when a new session begins. Rolling modes compute VWAP over a fixed trailing window.
Rolling (Lookback: Bars) controls the trailing bar count when using Rolling (Bars).
Rolling (Lookback: Days) converts days to bars at runtime and uses that trailing span.
Use Close instead of HLC3 switches the price reference. HLC3 is smoother. Close makes the anchor track settlement more tightly.
Deviation measurement
Deviation Mode
Percent : 100 * (Price / VWAP - 1). Good for uniform scaling across instruments.
Absolute : Price - VWAP. Good when price units themselves matter.
Z-Score : Standardizes the absolute residual by its own mean and standard deviation over Z/Std Window . Ideal for cross-asset comparability and regime studies.
Z/Std Window sets the mean and standard deviation window for Z-Score mode.
Volatility controls
Percent Mode Volatility Lookback estimates sigma for percent deviations.
Absolute Mode Volatility Lookback estimates sigma for absolute deviations.
Minimum Sigma Guard (pct pts) prevents the percent sigma from collapsing to near zero in extremely quiet markets.
Visualization
Plot Type = Histogram or Line. Histogram emphasizes impulse and polarity changes. Line emphasizes trend waves and divergences.
Positive Color / Negative Color define the palette for line mode. Histogram uses a 10-bucket gradient automatically.
Show Standard Deviations plots symmetric rails at ±1, ±2, ±3 sigma in the current mode’s units.
Fill Line Oscillator and Fill Opacity add a soft bias band around zero for line mode.
Line Width affects both the oscillator and the sigma rails.
Reading the zones
The oscillator’s color and height map deviation to nine graded buckets on each side of zero, with deeper greens above and deeper reds below. In Percent and Absolute modes, those buckets are scaled by their mode-specific sigma. In Z-Score mode the bucket edges are fixed at 0.5, 1.0, 2.0, and 2.8.
0 to +1 sigma weak positive bias, usually rotational.
+1 to +2 sigma constructive impulse. Pullbacks that hold above zero often continue.
+2 to +3 sigma strong expansion. Watch for either trend continuation or exhaustion tells.
Beyond +3 sigma statistical extreme. Requires structure to avoid fading too soon.
Mirror logic applies on the negative side.
Suggested workflows
Trend continuation checklist
Pick a session VWAP that matches your timeframe, for example Daily for intraday or Weekly for position trades.
Wait for the oscillator to hold the correct side of zero and for a sequence of higher swing lows in the oscillator (uptrend) or lower swing highs (downtrend).
Buy pullbacks that stabilize between zero and +1 sigma in an uptrend. Sell rallies that stabilize between zero and -1 sigma in a downtrend.
Use the next sigma band or a prior price swing as your target reference.
Mean reversion checklist
Switch to Z-Score mode for standardized thresholds.
Identify tests of ±2 sigma to ±3 sigma that fail to extend while price meets support or resistance.
Enter on a polarity change through the prior histogram bar or a small hook in line mode.
Fade back to zero or to the opposite inner band, then reassess.
Notes on the three modes
Percent is easy to reason about when you care about proportional stretch. It is well suited to intraday and multi-asset dashboards.
Absolute tracks cash distance from VWAP. This is useful when instruments have tight ticks and you plan risk in price units.
Z-Score standardizes the residual and is best for quant studies, cross-asset comparisons, and threshold research that must be scale invariant.
What the alerts can tell you
Polarity changes at zero can mark the start or end of a leg.
Crosses of ±1 sigma identify overbought or oversold in the current mode’s units.
Zone changes signal an upgrade or downgrade in deviation strength.
Troubleshooting and edge cases
If your instrument has long flat periods, keep Minimum Sigma Guard above zero in Percent mode so the rails do not vanish.
In Rolling modes, very short windows will respond quickly but can whip around. Session modes smooth this by resetting at well known boundaries.
If Z-Score looks erratic, increase Z/Std Window to stabilize the estimate of mean and sigma for the residual.
Final thoughts
VWAP is the anchor. The deviation oscillator is the narrative. By separating bias, magnitude, and regime into a simple stream you can execute faster and review cleaner. Pick the VWAP mode that matches your horizon, choose the deviation lens that matches your risk framework, and let the color graded zones guide your decisions.
Performance-based Asset Weighting(MTF)**Performance-Based Asset Weighting (MTF/Symbol Free Setting)**
#### Overview
This indicator is a tool that visualizes the relative strength of performance (price change rate) as “weight (allocation ratio)” for **four user-defined stocks**.
By setting any specified past point in time as the baseline (where all symbols are equally weighted at 25%), it aims to provide an intuitive understanding of which symbols outperformed others and attracted capital, or underperformed and saw capital outflows.
**【Default Settings and Application Scenario: Pension Fund Rebalancing Analysis】**
The default settings reference the basic portfolio of Japan's Government Pension Investment Fund (GPIF), configuring four major asset classes: domestic equities, foreign equities, domestic bonds, and foreign bonds. It is known that when market fluctuations cause deviations from this equal-weighted ratio, rebalancing occurs to restore the original ratio (selling assets whose weight has increased and buying assets whose weight has decreased).
Analyzing using this default setting can serve as a reference point for considering **“whether rebalancing sales (or purchases) by pension funds and similar entities are likely to occur in the future.”**
**【Important: Usage Notes】**
The weights shown by this indicator are **theoretical reference values** calculated solely based on performance from the specified start date. Even if large investors conduct significant rebalancing (asset buying/selling) during the period, those transactions themselves are not reflected in this chart's calculations.
Therefore, please understand that the actual portfolio ratios may differ. **Use this solely as a rough guideline. **
#### Key Features
* **Freely configure the 4 assets for analysis:** You can freely set any 4 assets (stocks, indices, currencies, cryptocurrencies, etc.) you wish to compare via the settings screen.
* **Performance-based weight calculation:** Rather than simple price composition ratios, it calculates each asset's price change since the specified start date as a “performance index” and displays each asset's proportion of the total sum.
* **Freely set analysis start date:** You can set any desired starting point for analysis, such as “after the XX shock” or “after earnings announcements,” using the calendar.
* **Multi-Timeframe (MTF) Support:** Independently of the timeframe displayed on the chart, you can freely select the timeframe (e.g., 1-hour, 4-hour, daily) used by the indicator for calculations.
#### Calculation Principle
This indicator calculates weights in the following three steps:
1. **Obtaining the Base Price**
Obtain the closing price for each of the four stocks on the user-set “Start Date for Weight Calculation.” This becomes the **base price** for analysis.
2. **Calculating the Performance Index**
Divide the current price of each stock by the **base price** obtained in Step 1 to calculate the “Performance Index”.
`Performance Index = Current Price ÷ Base Date Price`
This quantifies how many times the current performance has increased compared to the base date performance, which is set to “1”.
3. **Calculating Weights**
Sum the “Performance Indexes” of the four stocks. Then, calculate the percentage contribution of each stock's Performance Index to this total sum and plot it on the chart.
`Weight (%) = (Individual Performance Index ÷ Total Performance Index of 4 Stocks) × 100`
Using this logic, on the analysis start date, all stocks' performance indices are set to “1”, so the weights start equally at 25%.
#### Usage
* **Application Example 1: Market Sentiment Analysis (Using Default Settings)**
Analyze using the default asset classes. By observing the relative strength between “Equities” and “Bonds”, you can assess whether the market is risk-on or risk-off.
* **Application Example 2: Sector/Theme Strength Analysis**
Configure settings for groups like “Top 4 semiconductor stocks” or “4 GAFAM stocks.” Setting the start date to the beginning of the year or earnings season allows you to instantly compare which stocks within the same sector are performing best.
* **Application Example 3: Cryptocurrency Power Map Analysis**
By setting major cryptocurrencies like “BTC, ETH, SOL, ADA,” you can analyze which currencies are attracting market capital.
**【About Legend Display】**
Due to Pine Script specification constraints, the legend on the chart will display fixed names: **“Stock 1” to “Stock 4”. **
Please note that the symbol you entered for “Symbol 1” in the settings corresponds to the “Symbol 1” line on the chart.
#### Settings
* **Symbol 1 to Symbol 4:** Set the four symbols you wish to analyze.
* **Timeframe for Calculation:** Select the timeframe the indicator references when calculating weights.
* **Start Date for Weight Calculation:** This serves as the base date for comparing performance.
#### Disclaimer
This script is solely a tool to assist with market analysis and does not recommend buying or selling any specific financial instruments. Please make all final investment decisions at your own discretion.
-------------------------------------------------------------------------------------------------------------------
**Performance-based Asset Weighting(MTF・シンボル自由設定)**
#### 概要
このインジケーターは、**ユーザーが自由に設定した4つの銘柄**について、パフォーマンス(騰落率)の相対的な強さを「ウェイト(構成比率)」として可視化するツールです。
指定した過去の任意の時点を基準(全銘柄が均等な25%)として、そこからどの銘柄のパフォーマンスが他の銘柄を上回り、資金が向かっているのか、あるいは下回っているのかを直感的に把握することを目的としています。
**【デフォルト設定と活用シナリオ:年金基金のリバランス考察】**
デフォルト設定では、日本の年金積立金管理運用独立行政法人(GPIF)の基本ポートフォリオを参考に、主要4資産クラス(国内株式, 外国株式, 国内債券, 外国債券)が設定されています。市場の変動によってこの均等な比率に乖離が生じると、元の比率に戻すためのリバランス(比率が増えた資産を売り、減った資産を買う)が行われることが知られています。
このデフォルト設定で分析することで、**「今後、年金基金などによるリバランスの売り(買い)が発生する可能性があるか」を考察するための、一つの目安として利用できます。**
**【重要:利用上の注意点】**
このインジケーターが示すウェイトは、あくまで指定した開始日からのパフォーマンスのみを基に算出した**理論上の参考値**です。実際に大口投資家などが途中で大規模なリバランス(資産の売買)を行ったとしても、その取引自体はこのチャートの計算には反映されません。
そのため、実際のポートフォリオ比率とは異なる可能性があることをご理解の上、**あくまで大まかな目安としてご活用ください。**
#### 主な特徴
* **分析対象の4銘柄を自由に設定可能:** 設定画面から、比較したい4つの銘柄(株式、指数、為替、仮想通貨など)を自由に設定できます。
* **パフォーマンス基準のウェイト計算:** 単純な価格の構成比ではなく、指定した開始日からの各銘柄の騰落を「パフォーマンス指数」として算出し、その合計に占める各銘柄の割合を表示します。
* **分析開始日の自由な設定:** 「〇〇ショック後」「決算発表後」など、分析したい任意の時点をカレンダーから設定できます。
* **マルチタイムフレーム(MTF)対応:** チャートに表示している時間足とは別に、インジケーターが計算に使う時間足(1時間足、4時間足、日足など)を自由に選択できます。
#### 計算の原理
このインジケーターは、以下の3ステップでウェイトを算出しています。
1. **基準価格の取得**
ユーザーが設定した「ウェイト計算の開始日」における、4つの各銘柄の終値を取得し、これを分析の**基準価格**とします。
2. **パフォーマンス指数の算出**
現在の各銘柄の価格を、ステップ1で取得した**基準価格**で割ることで、「パフォーマンス指数」を算出します。
`パフォーマンス指数 = 現在の価格 ÷ 基準日の価格`
これにより、基準日のパフォーマンスを「1」とした場合、現在のパフォーマンスが何倍になっているかが数値化されます。
3. **ウェイトの算出**
4つの銘柄の「パフォーマンス指数」の合計値を算出します。そして、合計値に占める各銘柄のパフォーマンス指数の割合(%)を計算し、チャートに描画します。
`ウェイト (%) = (個別のパフォーマンス指数 ÷ 4銘柄のパフォーマンス指数の合計) × 100`
このロジックにより、分析開始日には全銘柄のパフォーマンス指数が「1」となるため、ウェイトは均等に25%からスタートします。
#### 使用方法
* **応用例1:市場のセンチメント分析(デフォルト設定利用)**
デフォルト設定の資産クラスで分析し、「株式」と「債券」の力関係を見ることで、市場がリスクオンなのかリスクオフなのかを判断する材料になります。
* **応用例2:セクター・テーマ別の強弱分析**
設定画面で、例えば「半導体関連の主要4銘柄」や「GAFAMの4銘柄」などを設定します。開始日を年初や決算時期に設定することで、同セクター内でどの銘柄が最もパフォーマンスが良いかを一目で比較できます。
* **応用例3:仮想通貨の勢力図分析**
「BTC, ETH, SOL, ADA」など、主要な仮想通貨を設定することで、市場の資金がどの通貨に向かっているのかを分析できます。
**【凡例の表示について】**
Pine Scriptの仕様上の制約により、チャート上の凡例は**「銘柄1」〜「銘柄4」という固定名で表示されます。**
お手数ですが、設定画面でご自身が「銘柄1」に入力したシンボルが、チャート上の「銘柄1」のラインに対応する、という形でご覧ください。
#### 設定項目
* **銘柄1〜銘柄4:** 分析したい4つのシンボルをそれぞれ設定します。
* **計算に使う時間足:** インジケーターがウェイトを計算する際に参照する時間足を選択します。
* **ウェイト計算の開始日:** パフォーマンスを比較する上での基準日となります。
#### 免責事項
このスクリプトはあくまで市場分析を補助するためのツールであり、特定の金融商品の売買を推奨するものではありません。投資の最終的な判断は、ご自身の責任において行ってください。
BFM Yen Carry to Risk Ratio (Dynamic Rates)Shows risk of yen carry trade unwinding. Based on cost to borrow from Japan to buy us stocks compared to interest rate in USA.
Position Size CalculatorPosition Size CalculatorRisk Management Made Simple – Size Your Trades Like a Pro!Tired of guessing position sizes and blowing up your account on oversized trades? This Pine Script indicator automates position sizing based on your risk tolerance, ensuring every trade risks only what you've predefined. Perfect for stocks, forex, crypto, or futures—works for long or short setups. Overlay it on your candlestick chart and watch the math do the work.Key Features:Smart Risk Control: Input your account size (e.g., $70k) and risk % (e.g., 1%). It caps your max loss per trade automatically.
Dynamic Entry & Stop: Use live chart close as entry, or click to set a manual entry level (green solid line). For stops, toggle manual placement (red broken line) or use a % distance—auto-calculates the effective % for precision.
Visual Markers: Green line for entry price, red dashed line for stop loss—spans your chart for easy spotting.
Customizable Table: Floating info panel shows Account Size, Risk Amount, Stop Distance %, and Position Size (shares/lots). Drag its position via settings (top-right default).
No More Guesswork: Formula: Position Size = (Account × Risk %) ÷ Stop Distance. Handles edge cases like tiny distances to avoid div-by-zero.
How to Use:Add to your chart via Pine Editor.
In settings: Set account size/risk %. Toggle "Use Manual Entry Price" and click chart to place green line. Do the same for stop (red line) or use % input.
Table updates live—grab the position size and execute!
Pro Tip: For shorts/longs, the abs distance keeps risk symmetric. Test on demo first.
Built for v6—clean, lightweight, and 100% customizable. Share your tweaks in comments! Remember, this is a tool, not advice—trade responsibly. (Inspired by classic Kelly Criterion vibes, but simplified for daily grinders.)
TGFA Flexible Alerts Multi-MA CrossoversTGFA Flexible Alerts, Multi-MA Crossovers
Description
Flexible MA crossovers with BUY/SELL alerts, customizable candle colors, and an info box for ATR/volatility insights. Supports EMA/SMA/HMA/VWAP on any chart.
Overview
TGFA Flexible Alerts is a versatile Pine Script indicator for traders seeking customizable moving average (MA) crossovers, visual signals, and quick-reference metrics. It overlays crossover lines (e.g., fast EMA over slow SMA), generates BUY/SELL labels and alerts, colors candles based on themes, and includes an optional info box with ATR bands, support/resistance, and trend projections. Built for any symbol and timeframe (optimized for 1H intraday), it auto-detects Heikin Ashi charts and handles mixed MA types like responsive HMA with lagging EMAs. All logic uses built-in TA functions for reliability—no repainting on confirmed bars.
Key Features
MA Crossover Engine: Configurable lines (EMA, SMA, HMA, VWAP) with dynamic colors (HMA tints green/red based on slope). Enable/disable via inputs.
Invert Signals Toggle: Flips BUY/SELL logic for mixed MA setups (e.g., HMA as fast line over EMA).
Reasoning: Traditional crossovers assume a fast line (low lag) crossing above a slow line (high lag) for buys. HMA's hull design makes it ultra-responsive, so it may "lead" too aggressively—causing premature signals. Inverting aligns it with user intuition (e.g., HMA dipping below then recovering signals strength), reducing false positives in trending markets. Test on your pairs!
Visual Alerts: BUY/SELL labels at crossover price (with optional price display and offset adjustment).
Single MA Overlays: Independent plots for EMA/SMA/HMA/VWAP (length 0 to hide).
Info Box: Real-time table with current price, ±1/2 ATR bands, median price (over lookback), trend (SMA50 slope), volatility % (ATR normalized), support/resistance (recent highs/lows), and reversal projections (tied to SMA50 pivot for up/down bias).
Candle Coloring: 20+ themes (dark/light canvases) for bull/bear/reversal/low-volume bars—e.g., Emerald Blaze greens uptrends, dims on low vol. Toggle off for no changes.
Chart Source Flexibility: Auto-switches to Heikin Ashi if detected; manual override for Regular/HA.
Alerts fire on crossovers/crossunders (custom messages with ticker/interval). Open-source for forking.
How to Use
Add to Chart: Search in TradingView's public library, apply to any symbol (e.g., stocks, forex). Best on 1H for intraday, but works on daily/weekly too.
Setup Crossovers: Choose Line 1/2 types/lengths (e.g., HMA 9 over SMA 20). Enable "Invert Signals" if using HMA—prevents lag mismatches in volatile assets.
Alerts & Labels: Toggle labels for visuals; set TradingView alerts on "Buy"/"Sell" conditions. Use offset for crowded charts.
Info Box Insights: Enable for quick scans—e.g., enter long near support if trend is bullish and price > median. Adjust ATR length (default 14) for sensitivity.
Candle Themes: Pick a scheme (e.g., Neon Pulse for dark mode); it overrides bar colors without altering data.
Customization Tip: For HMA-heavy setups, invert + short lengths (5-9) catch turns early; pair with volume filter in alerts.
Limitations & Disclaimers - Designed for overlay on price charts; may overlap in tight ranges—adjust transparency via styles.
HMA can repaint intra-bar; signals confirm on close. Not back tested for all assets—validate with strategy tester.
Info box projections use SMA(50) as a trend pivot (same for up/down as reference); customize via code for advanced calcs. Candle colors are cosmetic only.
This is an analysis tool, not advice. Trading involves risk; combine with fundamentals/news. Past performance isn't indicative of future results. No liability for losses.
I'm still a newbie, so feedback encouraged!
Thank you!!
ThisGirl
ATR Horizontal Lines from EMA and SMA with TableHow it works:
The script calculates ATR levels (of your choosing)
Instead of plotting curves, it creates horizontal lines
The lines are deleted and recreated on each bar to show current levels
Lines extend to the right or can be limited to a certain width
Customization options:
Line width (1-10 pixels)
Individual colors for each of the 4 lines
All the original parameters (EMA/SMA lengths, ATR length, multipliers)
The horizontal lines will now show the current ATR-based support/resistance levels and move dynamically as the EMAs, SMA, and ATR values change with new price data.