Pine Script® インジケーター
Sentiment
Yzkvng SMC Confirmations & webhookWhat PineScript Does
Monitors price action
Detects trading signals
Sends alert() with JSON data
What TradingView Does
Shows popup notification
Sends HTTP POST to webhook URL
Stores in console logs
What Your Backend Does
Receives the POST request
Logs the data
Updates database
Sends notifications
Places trades (if automated)
All Three Happen Together
When PineScript detects a signal:
Instantly: Popup appears on TradingView
Instantly: HTTP request sent to backend
Simultaneously: Both happen at the same time
Pine Script® ストラテジー
Gold Mining Margin MACROGold Mining Margin Macro Indicator — Description
This indicator measures the structural profitability of gold mining by comparing the gold price with estimated production costs. It is designed as a macro-context tool, not a short-term trading signal.
The script tracks three core components:
Gold − AISC (All-In Sustaining Cost) → proxy for mining profitability
Energy-adjusted mining margin → incorporates oil as a major production cost input
Gold / Oil ratio → intermarket relationship between gold and energy costs
Together, these metrics help visualize the economic pressure or expansion phase of the gold mining sector.
What the indicator measures
The indicator estimates whether gold is trading:
near production-cost pressure levels
in a neutral profitability zone
in a strong mining-profit environment
or in a boom phase
A weekly regime classification is used to reduce noise and focus on macro-cycle conditions rather than short-term price fluctuations.
Primary use case
This indicator is intended to help identify:
potential gold price floor zones
mining-sector stress conditions
cyclical turning points in gold
confirmation context for cycle-based analysis
It works best when combined with:
cycle analysis
intermarket analysis
positioning data
macroeconomic context
Important note
The AISC value is user-defined and represents an approximate global industry cost level, not the cost of a specific mining company.
The indicator is meant to reflect sector-level economics, not individual equities.
Pine Script® インジケーター
Mossan's Farming System [Taolue Remix]Mossan's Farming System
**【概要】**
このインジケーターは、「物理的なコスト(**WTI原油価格**)」と「金融的なコスト(**米10年債利回り**)」という2つのマクロ指標を監視し、現在の市場が**「農耕(トレンドフォロー)」**に適しているか、**「嵐(高ボラティリティ・警戒)」**の状態にあるかを背景色で可視化します。
さらに、環境認識に基づいたRSIの押し目買い・戻り売りシグナルと、ダイバージャンス検知機能を提供します。
**【コンセプト:狩猟から農耕へ】**
* **🌱 農耕モード (背景:緑)**
* 原油価格と米金利が共に移動平均を**下回っている**状態。
* 実体経済へのコスト負担が軽く、流動性が確保されています。
* **戦略:** 押し目買い(**Plant**)推奨。トレンドが育ちやすい土壌です。
* **⚠️ 嵐/警戒モード (背景:赤)**
* 原油価格と米金利が共に移動平均を**上回っている**状態。
* インフレ懸念と金融引き締めが同時に起きている「カオス」な状態です。
* **戦略:** キャッシュポジション推奨、または短期的な戻り売り(**Harvest**)。
* **☁️ 待機 (背景:グレー)**
* 方向感が定まらない状態。無理にトレードせず**「休む」**期間です。
**【機能とロジック】**
1. **マクロ環境認識:**
* **USOIL** (WTI原油) と **US10Y** (米10年債利回り) を取得し、指定した移動平均線(MA)と比較します。
* **マルチタイムフレーム対応:** 設定から「環境認識を行う時間足」を固定できます(例:15分足チャートを見ながら、**日足**の環境を表示)。
* **カスタムMA:** 環境判定に使うMAの種類を **SMA, EMA, HMA, WMA** 等から選択可能です。
2. **売買シグナル (Plant & Harvest):**
* **Plant (買い):** 環境が「緑」かつ、RSIが**売られすぎ**水準から復帰した時。
* **Harvest (売り):** 環境が「赤」かつ、RSIが**買われすぎ**水準から反落した時。
* 環境認識フィルターにより、マクロ環境に逆行する危険なシグナルを排除します。
3. **RSIダイバージャンス:**
* 強気(**Bull**)および弱気(**Bear**)のダイバージャンスを自動検知し、チャート上にラインを描画します。
**【設定】**
* **環境認識の時間足:** デフォルトはチャートと同じですが、「**D(日足)**」などに固定することを推奨します。
* **MAの種類/期間:** 反応速度を調整できます(デフォルト: SMA 20)。
* **RSI設定:** 期間や感度を調整可能です。
---
** **
This indicator visualizes the current market regime by monitoring two key macro factors: **Physical Cost (WTI Crude Oil)** and **Financial Cost (US 10Y Yield)**. It determines whether the market is in a **"Farming Mode" (Safe/Trend Following)** or a **"Storm Mode" (High Volatility/Risk-Off)** based on background colors.
It also provides RSI-based buy/sell signals filtered by this macro environment, along with divergence detection.
** **
* **🌱 Farming Mode (Green Background)**
* Both Oil and Yields are **below** their moving averages.
* Indicates lower operational costs for the economy and stable liquidity.
* **Strategy:** Look for dip buys (**Plant**). Trends are likely to grow steadily.
* **⚠️ Storm Mode (Red Background)**
* Both Oil and Yields are **above** their moving averages.
* Indicates inflation fears and monetary tightening. High risk.
* **Strategy:** Stay in cash or look for short-term selling opportunities (**Harvest**).
* **☁️ Wait (Gray Background)**
* Mixed signals. It is recommended to **wait** for a clearer direction.
** **
1. **Macro Environment Recognition:**
* Fetches data for **USOIL** and **US10Y** to compare against a user-defined Moving Average.
* **Multi-Timeframe Support:** You can fix the timeframe for environment detection (e.g., view **Daily** environment on a 15m chart).
* **Custom MA Types:** Choose from **SMA, EMA, HMA, WMA**, etc., for the trend detection logic.
2. **Trading Signals (Plant & Harvest):**
* **Plant (Buy):** Triggered when the environment is "Green" AND RSI crosses up from the **oversold** zone.
* **Harvest (Sell):** Triggered when the environment is "Red" AND RSI crosses down from the **overbought** zone.
* The environment filter helps filter out dangerous counter-trend signals.
3. **RSI Divergence:**
* Automatically detects and draws lines for **Bullish** and **Bearish** RSI divergences.
** **
* **Environment Timeframe:** Default is same as chart, but fixing it to higher timeframes (e.g., "**D**") is recommended for stability.
* **MA Type/Length:** Adjust the sensitivity of the trend detection (Default: SMA 20).
* **RSI Settings:** Customizable length and thresholds.
**Disclaimer:**
This script is for educational purposes only. Past performance does not guarantee future results. Please manage your risk carefully.
Pine Script® インジケーター
Point of Control Directional Change - Color This is a great tool used to track the changes in the point of control price for each candle relative to the start of the day. In each new candle, if the point of control price changes upward or downward, the indicator will signal this by a bar of color. It can give you insight on the direction price is starting to push towards. No color means no meaningful change.
Important note: this tool is meant to be easily readable with color only, therefore you can make it pretty small at the bottom of the chart. All you need to see is the color change, 1cm or so works great.
You can change the sensitivity of the largest change in the settings, this dynamically changes the sensitivity of medium and small relative to the large percent change. (ex: 3% = 0.03)
Largest Move Down = dark red
Medium Move Down = red
Small Move Down = light red
Largest Move Up = dark green
Medium Move Up = green
Small Move Up = light green
Pine Script® インジケーター
Pine Script® インジケーター
Multi-Strategy Filter: Pivot/Breakout/VWAP/RSI/MACDStrategy Overview: Multi-Confirmation Technical Scanner
This filter is a high-probability trend-following system that combines three core trading methodologies: Pivot Points (for institutional levels), Breakout Trading (for price action momentum), and VWAP (for volume-weighted value tracking). To ensure accuracy and avoid false breakouts, a signal is only generated when at least three of these core strategies align, further validated by a "Sweet Spot" RSI (momentum confirmation without being overbought) and a bullish MACD crossover. This multi-layered approach identifies stocks with strong institutional support and significant upward momentum.
Pine Script® インジケーター
Macro Regime Dashboard HOW TO READ THE MACRO REGIME DASHBOARD
Think of this as a weather report for markets, not a trade signal generator.
1 START WITH THE REGIME (TOP ROW)
MACRO REGIME
RISK-ON → tailwinds for equities & beta
MIXED → chop, fakeouts, smaller size
RISK-OFF → capital preservation first
This answers:
“Should I be pressing risk right now?”
Rule of thumb
Stay aligned with the regime
Don’t fight it with individual stock ideas
2 THE SCORE (SECOND ROW)
Regime Score
Range: roughly –5 to +5
+3 to +5 → strong risk-on
+1 to +2 → mild tailwind
–1 to +1 → transition / no edge
–2 to –5 → defensive environment
This answers:
“How confident is this environment?”
Position sizing rule
|Score| ≥ 3 → full size allowed
|Score| = 1–2 → reduced size
|Score| = 0 → mostly wait
3 EQUITIES ROW (SPY vs MA)
Equities
Risk+ → SPY above trend MA
Risk- → SPY below trend MA
This is your market participation check.
Interpretation
Risk-ON + Equities Risk+ = trends work
Risk-OFF + Equities Risk- = avoid longs
Mixed + Equities flipping = chop zone
4 CREDIT ROW (HYG / IEF)
Credit
Risk+ → credit spreads tightening
Risk- → credit stress building
This is the canary in the coal mine.
Very important rule
If Credit = Risk-, be skeptical of rallies
Credit usually breaks before equities
5 VOLATILITY ROW (VIX)
Volatility
Low → trend-following works
High → mean reversion, hedging, patience
This answers:
“Is the market calm or nervous?”
Trade adjustment
Low vol → options selling, swing trades
High vol → smaller size, wider stops, hedges
6 RATES ROW (10Y YIELD)
Rates
Risk+ → yields falling
Risk- → yields rising
This tells you who wins inside equities.
Mapping
Falling rates → tech, growth, duration
Rising rates → value, energy, financials
7 USD ROW (DXY)
USD
Risk+ → USD weakening
Risk- → USD strengthening
This controls global liquidity.
Mapping
Weak USD → commodities, EM, gold
Strong USD → US assets outperform, EM struggles
8 200 MA CONTEXT (LONG TREND)
Bull / Bear Context
Bull → regime shifts resolve upward
Bear → rallies fail more often
This is your macro gravity.
Rule
In Bear context → be quicker to de-risk
In Bull context → give trades more room
9 TILT (BOTTOM ROW)
Tilt
This is your portfolio bias, not a trade.
Examples:
Growth / Equities / EM
Cash / Defensives / Hedges
Reduce size / wait
This answers:
“What should my book look like this week?”
EXAMPLE: STRONG RISK-ON
Regime: RISK-ON
Score: +4
Credit: Risk+
Vol: Low
Action
Full size allowed
Favor trend trades
Reduce hedges
EXAMPLE: RISK-OFF
Regime: RISK-OFF
Score: –3
Credit: Risk-
Vol: High
Action
Raise cash
Defensive ETFs
Avoid dip-buying
EXAMPLE: MIXED / TRANSITION
Score near 0
Credit flat
Vol rising
Action
Smaller size
Pairs trades
Wait for confirmation
Pine Script® インジケーター
HK Spring Fes Win 2016-2026 (Alpha)Calculate the return rate of Hong Kong stock trading around the Chinese New Year period from 2016 to 2026 (using closing prices as buying and selling prices).
For personal entertainment purposes only and for reference only; not intended as investment advice.
Pine Script® インジケーター
VWAP 3 SignalsVWAP D/W/M Dashboard is a simple trend / bias dashboard that compares the current price against three anchored VWAP levels:
Daily VWAP
Weekly VWAP
Monthly VWAP
A compact table is displayed in the top-right corner of the chart with 5 rows and 2 columns (Instrument / Status).
For each VWAP timeframe, the script shows:
Bullish → price is above the VWAP
Bearish → price is below the VWAP
In addition, the dashboard includes volatility-based market balance readings using ±1 Standard Deviation bands around the anchored VWAP for:
Weekly STD
Monthly STD
STD logic:
Balanced market → price is inside the ±1 deviation zone
Bullish → price is above +1 deviation
Bearish → price is below −1 deviation
What it’s used for
This tool helps you quickly identify:
multi-timeframe VWAP alignment (trend bias / direction)
whether the market is trending (outside ±1 STD) or balanced/ranging (inside ±1 STD)
It’s designed as a fast “at-a-glance” confirmation panel you can keep on screen while trading.
Notes
VWAP levels are calculated as anchored VWAPs that reset on each new day/week/month.
The dashboard is meant for decision support, not as standalone financial advice.
Pine Script® インジケーター
Volume Conviction Index v1.0Volume Conviction Index (VCI) v1.0
This indicator helps answer a simple question: Does this price move have real strength behind it, or is the volume too weak to trust???
It measures "conviction" through how many participants are in the marketplace by looking at volume in a smart, reliable way:
- Spots unusual volume surges (buying or selling pressure) that stand out from normal (median line plotted) levels.
- visually helps with discretionary calls and allows the median avg of participation not just volume to be 'seen'
- Blends recent volume changes with how volume compares to its typical range.
How to read the chart (super straightforward):
- Teal columns above the zero line: Strong buying conviction — volume supporting the up move (good sign for breakouts or holds).
- Orange columns below zero: Strong selling conviction — heavy participation on the downside (watch for reversals or weakness on rallies).
- Flat/small bars near zero: Low conviction — price might be moving on fumes (often leads to fakeouts or quick fades).
- Optional white dashed line (the "median conviction"): A smoothed version over the last few bars. If it crosses zero or diverges from price, it can signal shifting momentum.
index works the same for both bears and bulls. teal bars in the positive are above participation or conviction in both bearish and bullish participation. also allows identifying exhaustion in both bearish and bullish scenarios.
works well equally on lower TFs and higher TFs
Why use it:
It uses robust statistics (rolling median volume + Median Absolute Deviation for a "z-like" score) instead of plain averages — much better at handling noisy or outlier-heavy markets like crypto, forex, or stocks during news events. Then it adds a weighted mix of short-term volume acceleration and relative volume for better context.
Great for:
- Beginners: Start with defaults — the colors and zero line make it easy to see at a glance.
- Day/swing traders: Filter entries/exits with real participation (e.g., teal spike on support bounce = higher odds).
- Anyone learning volume: Shows clearly when moves have "muscle" vs. when they're suspect.
Quick usage tips:
- Best on 5m to 4h charts with good volume data.
- Combine with price action, levels, or your favorite tools — use VCI to confirm conviction.
- Toggle the median line in settings if your timeframe is noisy.
Defaults work well across most assets — adjust "Volume Window" for longer/shorter lookback, or "Recent Weight" to emphasize sudden changes more/less.
I personally like using it on 1min / 5min / 30min charts. Has a microscope / high-rez feel about it when I'm on quicker TFs.
Open-source under © RU55IANROUL3TT3 — feel free to study, fork, or build on it!
Feedback welcomed — what markets/timeframes does it help you with?
Pine Script® インジケーター
Price vs OI 24h Relative Change📘 How to Use – Price vs Open Interest (24h Relative Change)
This indicator compares price movement and open interest (OI) change over the last 24 hours, allowing you to better understand market positioning and trader behavior.
It does not generate signals by itself. It is designed as a context and confirmation tool.
🔹 What the Indicator Shows
Price Δ (green area)
The percentage change in price compared to 24 hours ago.
Open Interest Δ (purple area)
The percentage change in open interest compared to 24 hours ago
(based on Binance BTCUSDT perpetual futures).
Zero line
The 24h baseline. Values above zero indicate an increase, below zero a decrease.
🔹 How to Interpret the Relationship
📈 Price ↑ & OI ↑
➡️ New positions are being opened in the direction of the move
This usually confirms trend continuation.
📈 Price ↑ & OI ↓
➡️ Short positions are being closed
This often indicates a short squeeze or short covering rally, which can be less sustainable.
📉 Price ↓ & OI ↑
➡️ New short positions are entering the market
This suggests bearish conviction and possible downside continuation.
📉 Price ↓ & OI ↓
➡️ Positions are being closed on both sides
Often seen during deleveraging, consolidation, or range conditions.
🔹 How to Use It in Practice
Use it as a confirmation tool alongside price action
Compare price structure with OI behavior
Identify whether moves are driven by new positioning or position closures
Works on all timeframes (intraday to swing)
⚠️ Important Notes
This indicator is non-repainting
It uses relative changes, not absolute values
It is best used to understand market structure, not as a standalone trading system
Pine Script® インジケーター
Profile volume deviationThis indicator calculates the width of the 70% Value Area of a moving volume profile over a defined number of candles.
It begins by identifying the highest and lowest points of the period under review, then divides this price range into several segments. For each candle, the volume is added to the segment corresponding to the closing price, which allows a volume profile to be constructed.
Once the total volume is known, the indicator identifies the most traded segment, called the Point of Control. From this central point, it gradually widens the area upwards and downwards by adding the most voluminous adjacent segments until it covers 70% of the total volume: this is the Value Area.
The lower and upper limits of this area are then converted into prices, and their difference gives the width of the Value Area. This width can be displayed directly as a price value or as a percentage of the current price.
The indicator is mainly used to assess the state of the market: a narrow Value Area suggests a phase of compression or range, while a wide Value Area indicates a period of expansion and strong activity.
Pine Script® インジケーター
Benner Cycle Map (A/B/C)Benner Cycle Map (A/B/C Years) + Macro Events • Educational Overlay
Description:
This script is an educational overlay that visualizes the classic Benner Cycle “A/B/C” year map (as presented on the historical Benner card) and optionally plots a curated set of major macro/market events (e.g., 1929 Crash, 9/11, Lehman, COVID) for historical context.
⚠️ Important: This indicator is NOT a trading strategy, does NOT generate buy/sell signals, and does NOT predict future market outcomes. It should not be used as financial advice.
What it shows:
A years (Panic)
B years (Good Times / Sell years)
C years (Hard Times / Buy/Accumulate years)
Optional Macro Events Overlay (context markers only)
Key features
Dynamic rebuild on zoom/pan (keeps labels aligned with the visible range)
Full customization: label position (Top/Center/Bottom), colors, opacity, sizes
Multiple label formats: horizontal, stacked, or vertical-styled (simulated via line breaks)
Background regime shading with selectable overlap priority
Two on-chart panels: Legend + Current Year Status
How to use (educational use-case)
Use this overlay to study historical clustering of the mapped years against price behavior and major events. It’s best viewed on higher timeframes (weekly/monthly) to reduce clutter.
Disclaimer
Markets are complex and influenced by countless variables. The Benner cycle map and the event markers shown here are provided for learning and visualization only. Past patterns do not guarantee future results. Always do your own research and risk management.
Pine Script® インジケーター
EMA 9 13 15 21 50 200EMA Multi Cross Alert System is a multi-moving average indicator designed to help traders quickly identify trend shifts and momentum changes using key Exponential Moving Average (EMA) crossover signals.
The script plots six important EMAs (9, 13, 15, 21, 50, and 200) directly on the price chart, allowing traders to monitor short-term, medium-term, and long-term trend alignment in real time.
The indicator automatically generates alerts when critical EMA crossover events occur, helping traders react quickly without constantly watching charts.
Pine Script® インジケーター
Trinity Scalping Direction DashbaordTrinity Scalping Dashboard – User Guide
**Purpose**
This indicator shows whether the current price is above or below the 5-period EMA across five key timeframes (5 min, 15 min, 1 hour, 4 hour, Daily).
It highlights when all five timeframes are aligned in the same direction (all bullish or all bearish), giving a clear "Buy", "Sell", or "No Trade Zone" signal.
**What the indicator displays**
- A dashboard table appears in one corner of the chart
- Each row shows one timeframe
- Text says "Above - Bullish" (green) or "Below - Bearish" (red) depending on whether current price is above or below the 5 EMA on that timeframe
- The bottom row shows the overall signal:
- **Buy** → all 5 timeframes are bullish (price > 5 EMA on every TF)
- **Sell** → all 5 timeframes are bearish (price < 5 EMA on every TF)
- **No Trade Zone** → mixed alignment (not all timeframes agree)
**Customizing the indicator**
- **EMA Period** — default is 5, but you can change it (e.g. to 8, 9, 13, etc.)
- **Colors** — adjust Bullish (green), Bearish (red), and No Trade (yellow) colors to your preference
- **Table Position** — choose Top Right, Bottom Right, or Bottom Left
- **Text Sizes** — separately control the size of the timeframe rows and the signal row (Tiny → Huge)
- **Header** — shows "Options Direction Dashboard" at the top of the table (you can edit the text in the code if desired)
**How to read the signal**
- **Strong Buy** — entire table green + bottom row says **Buy**
- **Strong Sell** — entire table red + bottom row says **Sell**
- **No clear direction** — mixed colors + bottom row says **No Trade Zone**
Only trade in the direction of the **full alignment** (all rows same color) for highest-probability setups.
**Alerts**
Three alert conditions are built-in:
1. **Buy Signal** — triggers when all timeframes become bullish
2. **Sell Signal** — triggers when all timeframes become bearish
3. **Signal Change** — triggers any time the overall signal changes (Buy ↔ Sell ↔ No Trade)
To set an alert:
- Right-click on the chart → **Add Alert**
- In **Condition**, select this indicator
- Choose one of the three conditions (Buy Signal / Sell Signal / Signal Change)
- Set frequency to **Once Per Bar Close** (recommended for most users)
- Customize notification (email, SMS, webhook, etc.)
**Best practices**
- Use for scalping when all EMA align and only take trades in the direction of the alignment.
- Use on higher timeframes (1H, 4H, Daily) for swing/position trading and use the smaller timeframe to time entries
- Combine with your existing price action, support/resistance or other filters
- The strongest setups occur when the signal flips from No Trade → Buy or No Trade → Sell
Pine Script® インジケーター
btall//@version=5
strategy("AR | AlphaEdge Pro (No-Repaint) v1.0",
overlay=true,
initial_capital=100000,
commission_type=strategy.commission.percent,
commission_value=0.04,
slippage=1,
pyramiding=0,
calc_on_order_fills=true,
calc_on_every_tick=false,
process_orders_on_close=true)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Inputs
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
grp1 = "Trend + Signals"
useHTF = input.bool(true, "Use Higher TF Trend Filter", group=grp1)
htf = input.timeframe("240", "Higher Timeframe", group=grp1)
htfEmaLen = input.int(200, "HTF EMA Length", minval=1, group=grp1)
emaFastLen = input.int(21, "Fast EMA", minval=1, group=grp1)
emaSlowLen = input.int(55, "Slow EMA", minval=1, group=grp1)
stAtrLen = input.int(10, "Supertrend ATR Length", minval=1, group=grp1)
stFactor = input.float(3.0, "Supertrend Factor", minval=0.1, step=0.1, group=grp1)
rsiLen = input.int(14, "RSI Length", minval=1, group=grp1)
rsiBull = input.int(52, "RSI Bull Threshold", minval=1, maxval=99, group=grp1)
rsiBear = input.int(48, "RSI Bear Threshold", minval=1, maxval=99, group=grp1)
useVolFilter = input.bool(true, "Use Volume Filter", group=grp1)
volLen = input.int(20, "Volume SMA Length", minval=1, group=grp1)
volMult = input.float(1.2, "Volume Multiplier", minval=0.1, step=0.1, group=grp1)
grp2 = "Risk Management (ATR)"
atrLen = input.int(14, "ATR Length", minval=1, group=grp2)
slAtrMult = input.float(1.6, "Stop = ATR x", minval=0.1, step=0.1, group=grp2)
rr = input.float(2.0, "Risk:Reward (TP)", minval=0.1, step=0.1, group=grp2)
useRiskPct = input.bool(true, "Dynamic Position Size by Risk %", group=grp2)
riskPct = input.float(1.0, "Risk % of Equity per Trade", minval=0.05, step=0.05, group=grp2)
maxPosPct = input.float(20.0, "Max Position % of Equity Cap", minval=1.0, step=1.0, group=grp2)
grp3 = "Breakeven + Session"
useBE = input.bool(true, "Move Stop to Breakeven", group=grp3)
beTriggerATR = input.float(1.0, "Trigger After +ATR x", minval=0.1, step=0.1, group=grp3)
beOffsetATR = input.float(0.05, "BE Offset (ATR x)", minval=0.0, step=0.01, group=grp3)
useSession = input.bool(false, "Trade Only in Session", group=grp3)
sess = input.session("1000-1500", "Session (exchange time)", group=grp3)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Helper / Filters
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
inSession = not useSession or not na(time(timeframe.period, sess))
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
rsi = ta.rsi(close, rsiLen)
atr = ta.atr(atrLen)
volOk = not useVolFilter or (volume > ta.sma(volume, volLen) * volMult)
// Supertrend
= ta.supertrend(stFactor, stAtrLen) // stDir: 1 bullish, -1 bearish (TradingView behavior)
stBull = stDir == 1
stBear = stDir == -1
// HTF trend (lookahead_off to reduce repaint risk on historical vs realtime behavior)
htfEma = request.security(syminfo.tickerid, htf, ta.ema(close, htfEmaLen), barmerge.gaps_off, barmerge.lookahead_off)
htfBull = close >= htfEma
htfBear = close <= htfEma
trendOkLong = not useHTF or htfBull
trendOkShort = not useHTF or htfBear
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Entry Conditions (confirmed bar to avoid “intrabar” surprises)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
longSignal = barstate.isconfirmed and inSession and trendOkLong and stBull and close > emaFast and emaFast > emaSlow and rsi >= rsiBull and volOk
shortSignal = barstate.isconfirmed and inSession and trendOkShort and stBear and close < emaFast and emaFast < emaSlow and rsi <= rsiBear and volOk
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Position sizing by ATR stop distance (approx; works best on stocks/spot)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
f_posQty(_stopDist) =>
// Risk capital = equity * riskPct%
riskCapital = strategy.equity * (riskPct / 100.0)
// Qty to risk roughly riskCapital if stop hits
rawQty = _stopDist > 0 ? (riskCapital / _stopDist) : 0.0
// Cap position size by maxPosPct% of equity
maxPositionValue = strategy.equity * (maxPosPct / 100.0)
maxQty = close > 0 ? (maxPositionValue / close) : rawQty
qty = math.max(0.0, math.min(rawQty, maxQty))
qty
stopDist = atr * slAtrMult
qty = useRiskPct ? f_posQty(stopDist) : na
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Entries
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
if (longSignal and strategy.position_size <= 0)
strategy.entry("L", strategy.long, qty=useRiskPct ? qty : na)
if (shortSignal and strategy.position_size >= 0)
strategy.entry("S", strategy.short, qty=useRiskPct ? qty : na)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Exits (ATR SL/TP + optional Breakeven)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
isLong = strategy.position_size > 0
isShort = strategy.position_size < 0
entry = strategy.position_avg_price
longSL = entry - stopDist
longTP = entry + stopDist * rr
shortSL = entry + stopDist
shortTP = entry - stopDist * rr
// Breakeven logic
beTrig = atr * beTriggerATR
beOff = atr * beOffsetATR
if isLong and useBE
// if price moved in our favor enough -> raise stop to entry (+offset)
if (close - entry) >= beTrig
longSL := math.max(longSL, entry + beOff)
if isShort and useBE
if (entry - close) >= beTrig
shortSL := math.min(shortSL, entry - beOff)
// Submit exits every bar so they update dynamically
strategy.exit("XL", from_entry="L", stop=longSL, limit=longTP, when=isLong)
strategy.exit("XS", from_entry="S", stop=shortSL, limit=shortTP, when=isShort)
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
// Visuals + Alerts
//━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
plot(emaFast, "EMA Fast", linewidth=2)
plot(emaSlow, "EMA Slow", linewidth=2)
plot(stLine, "Supertrend", linewidth=2)
plot(useHTF ? htfEma : na, "HTF EMA", linewidth=2)
plotshape(longSignal, title="Long Signal", style=shape.triangleup, location=location.belowbar, size=size.tiny, text="L")
plotshape(shortSignal, title="Short Signal", style=shape.triangledown, location=location.abovebar, size=size.tiny, text="S")
alertcondition(longSignal, title="AlphaEdge Long", message="AlphaEdge LONG on {{ticker}} @ {{close}}")
alertcondition(shortSignal, title="AlphaEdge Short", message="AlphaEdge SHORT on {{ticker}} @ {{close}}")
Pine Script® インジケーター
BOS, CHoCH and CISD [theEccentricTrader]█ OVERVIEW
This open-source indicator plots Break of Structure (BOS), Change of Character (CHoCH) and Change in State of Delivery (CISD) events directly on the chart and provides optional alerts for each condition.
All conditions are built around my primitive swing logic and are confirmed at candle close to avoid repainting.
The script is designed as a research tool, not a trading strategy. It does not generate entries, exits, targets or risk management rules. Its purpose is to make objectively defined market structure events visible, reproducible and testable across markets and timeframes.
█ CONCEPTS
Green and Red Candles
A green candle is defined as a candle that closes at or above its open.
A red candle is defined as a candle that closes below its open.
Swing Highs and Swing Lows
A swing high is defined as a green candle, or a series of consecutive green candles, followed by a single red candle that completes the swing and forms the peak.
A swing low is defined as a red candle, or a series of consecutive red candles, followed by a single green candle that completes the swing and forms the trough.
Peak and Trough Prices
The peak price of a complete swing high is either the high of the red candle that completes the swing or the high of the preceding green candle, depending on which is higher.
The trough price of a complete swing low is either the low of the green candle that completes the swing or the low of the preceding red candle, depending on which is lower.
Basic Uptrends and Downtrends
Basic uptrends, henceforth referred to as uptrends, are formed when the most recent trough is higher than the preceding trough.
Basic downtrends, henceforth referred to as downtrends, are formed when the most recent peak is lower than the preceding peak.
Break of Structure (BOS)
A BOS occurs when price continues in the direction of the prevailing trend by breaking beyond the most recent peak or trough price. BOS implies trend continuation through structural expansion.
BOS Up occurs during an uptrend when price closes above the most recent peak.
BOS Down occurs during a downtrend when price closes below the most recent trough.
Change of Character (CHoCH)
A CHoCH occurs during an uptrend or downtrend when price breaks the most recent peak or trough price in the opposite direction to the prevailing trend, without fully reversing the higher-level trend structure. CHoCH implies early structural weakness or internal rotation rather than confirmed trend reversal.
CHoCH Up occurs during a downtrend when price closes above the most recent peak but remains below the preceding peak.
CHoCH Down occurs during an uptrend when price closes below the most recent trough but remains above the preceding trough.
Change in State of Delivery (CISD)
A CISD occurs when price breaks the most recent peak or trough price. CISD isolates pure structural displacement, independent of trend classification.
CISD Up occurs when price closes above the most recent peak without regard for trend state.
CISD Down occurs when price closes below the most recent trough without regard for trend state.
█ VISUAL OUTPUTS
Labels
Labels are plotted at the candle where each condition is confirmed.
Users can change the label colours and sizes via indicator Settings/Inputs/LABELS.
Event Lines
Horizontal dashed lines mark the peak or trough that was broken.
Trend Lines
Trend lines are drawn to contextualise trend direction for appropriate structural events.
█ ALERTS
Optional alerts are provided for all conditions. By default, all alerts are set to false.
Users can apply alerts via Indicator Settings/Inputs/ALERTS.
Pine Script® インジケーター
Money Management Trade Data BoxTrade Data Box - Money Management Indicator
Overview
This indicator provides real-time position sizing and risk management calculations directly on your chart. It displays a clean data box that helps traders maintain disciplined risk management by automatically calculating the optimal number of contracts to trade based on ATR (Average True Range) volatility measurements.
What It Does
The indicator solves a critical problem that many traders face: determining the correct position size before entering a trade. Instead of manually calculating how many contracts to trade based on your risk tolerance and stop loss distance, this tool does all the math for you in real-time.
Key Features
ATR-Based Stop Loss & Target Calculation
Uses the Average True Range to set dynamic stop losses and profit targets that adapt to current market volatility
ATR multipliers allow you to customize how conservative or aggressive your stops and targets are (reasonable reward-to-risk ratio).
Automatic Position Sizing
Calculates exactly how many contracts you should trade to risk a specific dollar amount
Takes into account your defined risk per trade, the instrument's tick value, and the calculated stop loss distance
Updates continuously as market conditions change
Visual Data Box
Displays four critical pieces of information:
Target (ticks): How far your profit target is from entry
Stop (ticks): How far your stop loss should be placed
Risk Amount: Your fixed dollar risk per trade
Contracts: The calculated number of contracts to trade
Customization Options
Adjustable table size for different screen sizes
Six position options to place the box wherever you prefer on your chart
Optional "real close" dots to verify you're seeing actual closing prices if you are using Heiken Ashi Candles.
How Traders Use This
Set Your Risk Parameters: Input your maximum dollar risk per trade (e.g., $200) and the tick value for your instrument (e.g., $0.50 for Micro NQ (MNQ) futures)... verify your tick value before trading to ensure your risk management is correct.
Adjust ATR Settings: Customize the ATR length and multipliers based on your trading style and the instrument's characteristics.
Read the Box Before Trading: Before entering any trade, check the data box to know:
Where to place your stop loss
Where to set your profit target
How many contracts to trade to maintain consistent risk
Execute with Confidence: Enter your trade knowing you're risking exactly the amount you're comfortable with, regardless of how volatile the market is
Why This Matters
Professional traders know that position sizing is more important than entry timing. This indicator ensures you're never over-leveraged during volatile periods or under-leveraged during quiet markets. By basing calculations on ATR, your stops and targets automatically adjust to current market conditions, helping you maintain consistent risk across all trades.
Pine Script® インジケーター
Prop Firms No-Trade News (NFP/CPI/FOMC) - 30m WarningProp Firms No-Trade News (NFP / CPI / FOMC) — 30m Warning
This indicator is designed for traders operating under **prop firm rules**, where trading during high-impact economic news is restricted or prohibited.
It highlights **no-trade windows** around the most critical U.S. macroeconomic events and helps you stay compliant, disciplined, and risk-aware.
Covered High-Impact Events
* **Non-Farm Payrolls (NFP)**
→ Automatically calculated (1st Friday of each month at 08:30 ET)
* **Consumer Price Index (CPI)**
→ Manually configurable
* **FOMC Rate Decision / Policy Statement**
→ Manually configurable
How It Works
* **30-minute warning alert** before each event
* **No-trade window shading** on the chart
* **Optional labels** for:
* Upcoming no-trade period
* Exact news release moment
* **Customizable buffers**:
* Minutes before the event
* Minutes after the event
Alerts Included
* 30-minute pre-news warning
* No-trade window start
* No-trade window end
* News release time
All alerts can be used for **manual trading discipline** or automated workflows.
Who This Is For
* Prop firm traders (evaluation or funded)
* Futures and index traders
* Traders who want **rule-based protection against emotional or impulsive trading during news**
Notes
* News times are based on **U.S. Eastern Time (ET)**
* CPI and FOMC dates must be updated manually according to the official economic calendar
* This tool does **not execute trades** — it enforces awareness and discipline
Pine Script® インジケーター
Spectre -Candles Spectre -Candles MEANS SPECTRE CANDLES -
2 candle closing main 2 candle closing main
Pine Script® インジケーター
Sequential - Heatmap [R2D2]The Professional Edge in Trend Exhaustion
In a market environment saturated with noise, the most valuable tool for a trader is clarity. Standard trend-following indicators often lag, and traditional reversal markers can be premature. The Sequential: Heatmap is a sophisticated trend-exhaustion indicator designed to identify precise market inflection points where a trend has reached its mathematical limit.
By focusing on the Exhaustion Phase (counts 7, 8, and 9) and integrating Perfection Logic, this tool filters out "weak" setups, highlighting only the high-probability price flips that professional institutional traders watch.
How It Works: The Logic of Exhaustion
The Sequential operates on the principle of price symmetry. A "Setup" occurs when a series of at least nine consecutive bars close higher (for a Sell Setup) or lower (for a Buy Setup) than the close of the bar four periods prior.
The "Perfected" Difference
A standard 9-count is often not enough for a high-conviction entry. This publication-ready script includes Perfection Logic:
Perfected Buy (9★) : The low of bar 8 or 9 must be lower than the lows of both bars 6 and 7.
Perfected Sell (9★) : The high of bar 8 or 9 must be higher than the highs of both bars 6 and 7.
This ensures that the final move in the sequence is a true "climax" before the reversal begins.
Step-by-Step Usage Guide
Step 1: Monitor the Heatmap
As a trend develops, the bars will remain standard. Once the sequence hits count 7, the Heatmap Gradient activates.
Faint Color: Momentum is beginning to stretch.
Deep Saturated Color: The trend is entering the danger zone for a reversal.
Step 2: Identify the 9★ Completion
Wait for the number 9 to appear. If a star (★) is attached, the setup is "Perfected". This is your primary signal that the current move is mathematically overextended.
Step 3: Define Your Risk with Risk Lines
Upon completion of a 9-count, the script draws a solid thin horizontal line:
Green Line (Resistance) : The ceiling of the move. Use this as a profit target for longs or a hard stop for shorts.
Red Line (Support) : The floor of the move. Use this as a profit target for shorts or a hard stop for longs.
Trading Like a Pro: Strategies for Success
To use this tool effectively at a professional level, follow these three core tenets:
Don’t Front-Run the 9 : Amateur traders often try to "guess" the reversal at count 5 or 6. Professionals wait for the Perfected 9 to close. The heatmap is designed to keep you patient.
The "Risk Line" Breaker : If price closes beyond a Risk Line (e.g., closes above the green resistance line), the exhaustion has failed, and a "Setup Trend Extension" is occurring. In this case, exit your reversal trade immediately; the trend is stronger than the exhaustion.
Confluence with Higher Timeframes : A Perfected 9 on a 15-minute chart is strong; a Perfected 9 on a 15-minute chart that aligns with a 4-hour Risk Line is institutional grade.
Pine Script® インジケーター
ICT Macros & Visual Risk CalculatorThis "all-in-one" indicator is specifically designed for ICT (Inner Circle Trader) methodology practitioners who trade high-volatility time windows (Macros). It combines automated visual identification of these sessions with an advanced risk calculator that dynamically draws position blocks (Long/Short) based on pips, ensuring fast and precise execution.
Pine Script® インジケーター






















