Bitcoin Relative Strength IndexThis script leverages on the original RSI indicator to create a naive strategy based on weekly RSI in order to trade bitcoin cycles.
Users can configure the thresholds at which buy low and sell high to backtest it against a pure buy and hold strategy.
Performance is better than buy and hold for several scenarios.
Indicadores e estratégias
Bull vs Bear Volume (Enhanced)Bull vs Bear Volume (Enhanced) is a custom volume histogram that separates and visualizes estimated buying vs. selling volume within each candle. This allows traders to better understand market sentiment and detect imbalances in demand and supply.
🔍 What It Does:
Plots bullish volume (green) above the x-axis and bearish volume (red) below.
Estimates bull/bear volume by analyzing the close location within the candle's range.
Highlights volume spikes with lime (bullish) or maroon (bearish) when volume exceeds a user-defined threshold.
Includes an optional total volume line for added context.
Supports smoothing via simple moving average (SMA) to reduce noise.
🛠️ Inputs:
Toggle smoothing and set its length.
Enable/disable threshold spike highlighting.
Show/hide the total volume overlay.
Adjust the threshold multiplier for spike detection.
⚠️ Important:
This script uses a proxy method based on candle structure to estimate volume split — it does not use real-time order flow or trade direction data.
Works best on liquid assets with consistent volume.
AP IFTCCIv2/IFTStoch/IFTRSI Multi-TimeframeMulti-Timeframe IFT-CCI/Stoch/RSI Composite
This enhanced indicator combines three powerful oscillators—Inverse Fisher Transform (IFT) versions of the Commodity Channel Index (CCI), Stochastic, and Relative Strength Index (RSI)—into a unified multi-timeframe analysis tool. Originally developed by John Ehlers (pioneer of cyclical analysis and signal processing in trading systems) and adapted by KIVANC (@fr3762), this version adds dual-timeframe capability to compare indicator values across different chart resolutions.
Key Features:
Triple Oscillator Composite
IFT-CCI: Smoothed CCI values transformed via Ehlers' Inverse Fisher Transform (blue-gold)
IFT-Stochastic: Classic stochastic oscillator processed through IFT (blue)
IFT-RSI: RSI oscillator converted to IFT format (magenta)
Composite Average Line: Combined average of all three indicators (green)
Multi-Timeframe Analysis
Compare primary and secondary timeframes (e.g., 1H vs. 4H, daily vs. weekly)
Primary timeframe plots use solid lines with 80% opacity
Secondary timeframe (optional) uses dashed/circle markers with 40% opacity
Key Levels
Overbought (+0.75) and oversold (-0.75) reference lines
Zero-centerline for momentum direction bias
Applications:
Trend Confirmation: Align higher timeframe signals with lower timeframe entries
Divergence Detection: Spot inter-timeframe discrepancies in momentum
Regime Filter: Use higher timeframe composite values to filter trades
Technical Basis:
Inverse Fisher Transform: Compresses oscillator values into bounded (-1 to +1) range while emphasizing extreme moves
Dual WMA Smoothing: Combines initial calculation smoothing (WMA1) with final output smoothing (WMA2)
Exponential Scaling: (e^2x - 1)/(e^2x + 1) formula converts Gaussian-like distributions to bounded outputs
Credits:
Original Concept: John Ehlers (IFT methodology, cyclical analysis foundations)
Initial Implementation: KIVANC (@fr3762 on Twitter) for the base IFT-CCI/Stoch/RSI script
Multi-Timeframe Adaptation: for cross-resolution analysis capabilities
This tool is particularly effective for traders seeking to align multiple timeframes while using Ehlers' noise-reduction techniques. The composite average line provides a consensus view, while the individual oscillators help identify component strength/weakness.
Apex Edge - MTF Confluence PanelApex Edge – MTF Confluence Panel
Description:
The Apex Edge – MTF Confluence Panel is a powerful multi-timeframe analysis tool built to streamline trade decision-making by aggregating key confluences across three user-defined timeframes. The panel visually presents the state of five core market signals—Trend, Momentum, Sweep, Structure, and Trap—alongside a unified Score column that summarizes directional bias with clarity.
Traders can customize the number of bullish/bearish conditions required to trigger a score signal, allowing the tool to be tailored for both conservative and aggressive trading styles. This script is designed for those who value a clean, structured, and objective approach to identifying market alignment—whether scalping or swing trading.
How it Works:
Across each of the three selected timeframes, the panel evaluates:
Trend: Based on a user-configurable Hull Moving Average (HMA), the script compares price relative to trend to determine bullish, bearish, or neutral bias.
Momentum: Uses OBV (On-Balance Volume) with volume spike detection to identify bursts of strong buying or selling pressure.
Sweep: Detects potential liquidity grabs by identifying price rejections beyond prior swing highs/lows. A break below a previous low with reversal signals bullish intent (and vice versa for bearish).
Structure: Uses dynamic pivot-based logic to identify market structure breaks (BOS) beyond recent confirmed swing levels.
Trap: Flags potential false moves by measuring RSI overbought/oversold signal clusters combined with minimal price movement—highlighting exhaustion or deceptive breaks.
Score: A weighted consensus of the above components. The number of required confluences to trigger a score (default: 3) can be set by the user via input, offering flexibility in signal sensitivity.
Why It’s Useful for Traders:
Quick Decision-Making: The color-coded panel provides instant visual feedback on whether confluences align across timeframes—ideal for fast-paced environments like scalping or high-volatility news sessions.
Multi-Timeframe Confidence: Helps eliminate guesswork by confirming whether higher and lower timeframe conditions support your trade idea.
Customizability: Adjustable confluence threshold means traders can fine-tune how sensitive the system is—more signals for faster entries, stricter confluence for higher conviction trades.
Built-In Alerts: Automated alerts for score alignment, trap detection, and liquidity sweeps allow traders to stay informed even when away from the screen.
Strategic Edge: Supports directional bias confirmation and trade filtering with logic designed to mimic professional decision-making workflows.
Features:
Clean, real-time confluence table across three user-selected timeframes
Configurable score sensitivity via “Minimum Confluences for Score” input
Cell-based colour coding for at-a-glance trade direction
Built-in alerts for score alignment, traps, and sweep triggers
Note - This Indicator works great in sync with Apex Edge - Session Sweep Pro
Useful levels for TP = previous session high/low boxes or fib levels.
⚠️ Disclaimer:
This script is for informational and educational purposes only and should not be considered financial advice. Always perform your own due diligence and practice proper risk management when trading.
RSI-WMA + EMA Trend Filter | Signal OnlyThis is the specialized indicator representing the internal strategy created by RIO for the Trading Career 2025 Class.
Enjoy and have fun by using it if you feel the option being suitable for your trading!
SBC ProtfoSBC Portfo PNL Indicator
Description
The SBC Portfo PNL Indicator is a user-friendly tool designed for Hebrew-speaking traders to track the Profit and Loss (PNL) of their stock portfolios on TradingView charts. It supports up to 5 distinct portfolios, each capable of holding an unlimited number of stocks with unlimited buy commands, allowing real-time monitoring of portfolio performance.
Key Features
- Multi-Portfolio Support: Track up to 5 separate portfolios for different trading strategies or accounts.
- Unlimited Stock Entries: Add unlimited stocks and buy commands per portfolio.
- Detailed Buy Commands: Input for each stock:
- Stock Ticker (e.g., AAPL, TSLA).
- Buy Price (e.g., 150.25).
- Buy Amount (e.g., 10).
- Hebrew-Friendly Interface: Intuitive settings dialog with clear instructions in Hebrew.
- Customizable PNL Tracking: Visualize PNL on charts with real-time updates based on market data.
How to Use
1. Add the Indicator:
- Go to the Indicators menu in TradingView and add the "SBC Portfo" PNL Indicator.
2. Configure Portfolios:
- Open the indicator’s settings dialog.
- For each portfolio (up to 5), enter data in the provided input fields using this format:
PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
Example:
Portfolio1:AAPL:150.25x10;TSLA:266.72x5
- This represents a portfolio named "Portfolio1" with:
- 10 shares of AAPL bought at $150.25.
- 5 shares of TSLA bought at $266.72.
- Repeat for additional portfolios (e.g., Portfolio2, Portfolio3).
- Add multiple buy commands for the same stock if needed (e.g., AAPL:160.50x20).
3. Apply Settings:
- Save settings to display PNL based on current market prices.
4. Monitor PNL:
- View PNL for each portfolio on the chart via tables, labels, or graphical overlays (based on settings).
Input Format
Enter portfolio data manually in the settings dialog, one input field per portfolio:
PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
- PortfolioName: Unique name (e.g., Portfolio1, Growth).
- StockTicker: Stock symbol (e.g., AAPL).
- BuyPrice: Purchase price per share (e.g., 150.25).
- BuyAmount: Number of shares (e.g., 10).
- Use
: to separate portfolio name, ticker, and buy data
x to separate price and amount
; for multiple stocks in the portfolio
Example:
- Portfolio 1: GrowthPortfolio:AAPL:150.25x10;TSLA:266.72x5
- Portfolio 2: DividendPortfolio:KO:55.20x50;PG:145.30x30
Notes
- Hebrew Support: Settings and labels are optimized for Hebrew users.
- Manual Input: Enter portfolio data manually in the settings dialog using the correct format.
- Compatibility: Works with any stock ticker supported by TradingView.
תיאור אינדיקטור SBC Portfo PNL הוא כלי ידידותי למשתמש שתוכנן במיוחד עבור סוחרים דוברי עברית למעקב אחר רווח והפסד (PNL) של תיקי המניות שלהם ישירות בגרפים של TradingView. הוא תומך בעד 5 תיקים נפרדים, כאשר כל תיק יכול להכיל מספר בלתי מוגבל של מניות עם פקודות קנייה בלתי מוגבלות, ומאפשר מעקב בזמן אמת אחר ביצועי התיק.
תכונות עיקריות
- תמיכה בריבוי תיקים: מעקב אחר עד 5 תיקים נפרדים עבור אסטרטגיות מסחר או חשבונות שונים.
- רישום מניות ללא הגבלה: הוספת מספר בלתי מוגבל של מניות ופקודות קנייה לכל תיק.
- פקודות קנייה מפורטות: הזנת נתונים עבור כל מניה:
- סימול המניה (למשל, AAPL, TSLA).
- מחיר קנייה (למשל, 150.25).
- כמות קנייה (למשל, 10).
- ממשק ידידותי לעברית: חלונית הגדרות אינטואיטיבית עם הוראות ברורות בעברית.
- מעקב PNL הניתן להתאמה: הצגת רווח והפסד בגרפים עם עדכונים בזמן אמת בהתבסס על נתוני השוק.
כיצד להשתמש
1. הוספת האינדיקטור:
- נווט לתפריט האינדיקטורים ב-TradingView והוסף את "SBC Portfo PNL Indicator".
2. הגדרת תיקים:
- פתח את חלונית ההגדרות של האינדיקטור.
- עבור כל תיק (עד 5), הזן נתונים בשדות המסופקים בפורמט הבא:
PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
לדוגמה:
Portfolio1:AAPL:150.25x10;TSLA:266.72x5
שורה זו מייצגת תיק בשם "Portfolio1" עם:
- 10 מניות של AAPL שנקנו ב-$150.25.
- 5 מניות של TSLA שנקנו ב-$266.72.
- חזור על התהליך עבור תיקים נוספים (למשל, Portfolio2, Portfolio3).
- ניתן להוסיף פקודות קנייה מרובות לאותה מניה לפי הצורך (למשל, AAPL:160.50x20).
3. החלת ההגדרות:
- שמור את ההגדרות להצגת ה-PNL בהתבסס על מחירי השוק הנוכחיים.
4. מעקב אחר PNL:
- צפה ב-PNL עבור כל תיק בגרף באמצעות טבלאות, תוויות או שכבות גרפיות (בהתאם להגדרות).
פורמט קלט הזן נתוני תיק ידנית בחלונית ההגדרות, שדה קלט אחד לכל תיק: PortfolioName:StockTicker:BuyPricexBuyAmount;StockTicker:BuyPricexBuyAmount
PortfolioName: שם ייחודי (למשל, Portfolio1, Growth).
StockTicker: סימול המניה (למשל, AAPL).
BuyPrice: מחיר רכישה למניה (למשל, 150.25).
BuyAmount: מספר המניות (למשל, 10).
השתמש ב-
: להפרדה בין שם התיק, סימול ונתוני קנייה
x להפרדה בין מחיר וכמות
; להפרדה בין מניות מרובות
דוגמה:
- תיק 1: GrowthPortfolio:AAPL:150.25x10;TSLA:266.72x5
- תיק 2: DividendPortfolio:KO:55.20x50;PG:145.30x30
Release Notes
Version 1.1 includes:
- Calculations for extended hours (Pre-Market & After-Hours).
- Option to display portfolio summary data for stocks not in the portfolio (enable via settings checkbox).
- Table background for better visibility; click to bring table to the front.
- Updated text strings (names, titles, tooltips).
הערות
תמיכה בעברית: ההגדרות והתוויות מותאמות למשתמשים דוברי עברית.
הזנה ידנית: הזן נתוני תיק ידנית בחלונית ההגדרות תוך שימוש בפורמט הנכון.
תאימות: עובד עם כל סימול מניה הנתמך על ידי TradingView.
גרסה 1.1 מכילה:
1. חישובים כוללים שעות מסחר מורחבות (Pre-Market ו-After-Hours).
2. אפשרות להציג נתוני תיק כוללים עבור מניות שאינן בתיק (הפעל באמצעות תיבת סימון בהגדרות).
3. צבע רקע לטבלה לשיפור הנראות; לחיצה על הטבלה מביאה אותה לחזית.
4. תיקון נוסחים (שמות, כותרות, וטולטיפים).
Rocky's Dynamic DikFat Supply & Demand ZonesDynamic Supply & Demand Zones
Overview
The Dynamic Supply & Demand Zones indicator identifies key supply and demand levels on your chart by detecting pivot highs and lows. It draws customizable boxes around these zones, helping traders visualize areas where price may react. With flexible display options and dynamic box behavior, this tool is designed to assist in identifying potential support and resistance levels for various trading strategies.
Key Features
Pivot-Based Zones: Automatically detects supply (resistance) and demand (support) zones using pivot highs and lows on the chart’s timeframe.
Dynamic Box Sizing: Boxes shrink when price enters them, reflecting reduced zone strength, and stop adjusting once price fully crosses through.
Customizable Display: Choose to show current-day boxes, historical boxes, or all boxes, with an option to update past box colors dynamically.
Session-Based Extension: Boxes can extend to the current bar or stop at 4:00 PM of the creation day’s 9:30 AM–4:00 PM trading session (ideal for stock markets).
Color Coding: Borders change color based on price position:
Green for demand zones (price above the box).
Red for supply zones (price below the box).
White for neutral zones (price inside the box).
User-Friendly Inputs: Adjust pivot lookback periods, box visibility, extension behavior, and colors via intuitive input settings.
How It Works
Zone Detection: The indicator uses pivot highs and lows to define supply and demand zones, plotting boxes between these levels.
Box Behavior:
Boxes are created when pivot highs and lows are confirmed, with no overlap with the previous box.
When price enters a box, it shrinks to reflect interaction, stopping once price exits completely.
Boxes can extend to the current bar or end at 4:00 PM of the creation day (or next trading day if created after 4:00 PM or on weekends).
Display Options:
Current Only: Shows boxes created on the current day.
Historical Only: Shows boxes from previous days, with optional color updates.
All Boxes: Shows all boxes, with an option to hide historical box color updates.
Performance: Limits the number of boxes to 200 to ensure smooth performance, removing older boxes as needed.
Inputs
Pivot Look Right/Left: Set the number of bars (default: 2) to confirm pivot highs and lows.
What Boxes to Show: Select Current Only, Historical Only, or All Boxes (default: Current Only).
Boxes On/Off: Toggle box visibility (default: on).
Extend Boxes to Current Bar: Choose whether boxes extend to the current bar or stop at 4:00 PM (default: off, stops at 4:00 PM).
Update Past Box Colors: Enable/disable color updates for historical boxes (default: on).
Demand/Supply/Neutral Box Color: Customize border colors (default: green, red, white).
How to Use
Add the indicator to your chart.
Adjust inputs to match your trading style (e.g., pivot lookback, box extension, colors).
Use the boxes to identify potential support (demand) and resistance (supply) zones:
Green-bordered boxes (price above) may act as support.
Red-bordered boxes (price below) may act as resistance.
White-bordered boxes (price inside) indicate active price interaction.
Combine with other analysis tools (e.g., trendlines, indicators) to confirm trade setups.
Monitor box shrinking to gauge zone strength and watch for breakouts when price fully crosses a box.
Understanding Supply and Demand in Stock Trading
In stock trading, supply and demand are fundamental forces driving price movements. Demand refers to the willingness of buyers to purchase a stock at a given price, often creating support levels where buying interest prevents further price declines. Supply represents the willingness of sellers to offload a stock, forming resistance levels where selling pressure halts price increases. These zones are critical because they highlight areas where significant buying or selling activity has occurred, influencing future price behavior.
The importance of supply and demand lies in their ability to reveal where institutional traders, with large orders, have entered or exited the market. Demand zones, often seen at pivot lows, indicate strong buying interest and potential areas for price reversals or bounces. Supply zones, typically at pivot highs, signal heavy selling and possible reversal points for downward moves. By identifying these zones, traders can anticipate where price is likely to stall, reverse, or break out, enabling better entry and exit decisions. This indicator visualizes these zones as dynamic boxes, making it easier to spot high-probability trading opportunities while emphasizing the core market dynamics of supply and demand.
Feedback
This indicator is designed to help traders visualize supply and demand zones effectively. If you have suggestions for improvements, please share your feedback in the comments!
Anomaly Counter-Trend StrategyA mean-reversion style strategy that automatically spots unusually large price moves over a configurable lookback period and takes the opposite side, with full risk-management, commission and slippage modeling—built in Pine Script® v6.
🔎 Overview
ACTS monitors the percent-change over the past N minutes and, when that move exceeds your chosen threshold, enters a counter-trend position (short on a strong rise; long on a sharp fall). It’s ideal for markets that often “overshoot” and snap back, and can be applied on any symbol or timeframe.
⚙️ Key Features
Anomaly Detection: Detect abnormal price swings based on a user-defined % change over a lookback period.
Counter-Trend Entries: Auto-enter short on rise anomalies, long on fall anomalies (with seamless flat↔reverse transitions).
Risk Management: Configurable stop-loss and take-profit in ticks per trade.
Realistic Modeling: Simulates commissions (0.05 % default), slippage (2 ticks), and percent-of-equity sizing.
Immediate Bar-Close Execution: Orders processed on bar close for faster fills.
Visual Aids: Optional on-chart BUY/SELL triangles and background highlights during anomaly periods.
⚙️ Inputs
Input Default Description
Percentage Threshold (%) 2.00 Min % move over lookback to trigger an anomaly.
Lookback Period (Minutes) 15 Number of minutes over which to measure change.
Stop Loss (Ticks) 100 Distance from entry for stop-loss exit.
Take Profit (Ticks) 200 Distance from entry for take-profit exit.
Plot Trade Signal Shapes (on/off) true Show BUY/SELL triangles on chart.
Highlight Anomaly Background true Shade background during anomaly bars.
📊 How to Use
Add to Chart: Apply the script to any ticker & timeframe.
Tune: Adjust your percentage threshold and lookback to match each instrument’s volatility.
Review Backtest: Check built-in strategy performance (drawdown, Sharpe, etc.) under the Strategy Tester tab.
Go Live: Once optimized, link to alerts or your trade execution system.
⚠️ Disclaimer
This script is provided “as-is” for educational purposes and backtesting only. Past performance does not guarantee future results. Always backtest thoroughly, manage your own risk, and consider market conditions before live trading.
Enjoy experimenting—and may your counter-trend entries catch the next big snapback!
GOLDEN TIME MARKER) + 7PM (Mondays)This indicator draws vertical lines at key session times in UTC+1 (Casablanca local time):
- Red line at 04:00 AM daily
- Green line at 04:00 PM daily
- Blue line at 07:00 PM only on Mondays (2024–2025)
Perfect for traders who want to mark important intraday levels for Forex, Crypto, or any asset class. Works on timeframes from 1 minute up to 1 hour. Customizable colors and full multi-market support.
CorrelationMulti-Timeframe Correlation Indicator
This Pine Script indicator measures the correlation between the current symbol and a reference symbol (default: GLD) across three different timeframes. It provides traders with valuable insights into how assets move in relation to each other over short, medium, and long-term periods.
Key Features
Multiple Timeframe Analysis: Calculates correlation coefficients over three customizable periods (default: 20, 50, and 200 bars)
Visual Reference Lines: Displays horizontal lines at +1, 0, and -1 to indicate perfect positive correlation, no correlation, and perfect negative correlation
Color-Coded Outputs: Shows short-term correlation in green, medium-term in yellow, and long-term in red for easy visual interpretation
Understanding Correlation
The correlation coefficient measures the statistical relationship between two data series, ranging from -1 to +1:
+1: Perfect positive correlation (both assets move together in the same direction)
0: No correlation (movements are random and independent)
-1: Perfect negative correlation (assets move in opposite directions)
How To Use This Indicator
Market Relationships: Identify how strongly your current asset correlates with the reference symbol
Diversification Analysis: Find assets with negative correlations to build a diversified portfolio
Divergence Opportunities: Watch for changes in correlation patterns that might signal trading opportunities
Trend Confirmation: Use correlation with benchmark assets to confirm broader market trends
Customization Options
Reference Symbol: Change the default GLD to any other symbol you want to compare against
Period Lengths: Adjust the short, medium, and long timeframes to match your trading strategy and timeframe
This indicator helps traders make more informed decisions by understanding the interrelationships between different assets across various timeframes, potentially improving portfolio construction and risk management strategies.
EMA Breakdown Strategytake sell position when price crosses below ema take a short position when price crosses below green candel low target size of green candle SL high of green candel RR 1:1
Grid + Trade Annotations & Liquidations## Introducing the “Grid + Trade Annotations & Liquidations” Pine Script Strategy
Imagine you could overlay a perfectly-spaced price grid on your favorite chart, backtest a simple moving-average crossover, see exactly where trades would have fired off in the past—and even know at what price you’d have been liquidated if you were running at 10× leverage. That’s exactly what this all-in-one TradingView **Pine Script® v6** strategy delivers.
### Why you’ll love it
* **Visual clarity:** A fixed-interval horizontal grid, centered on each bar’s close, helps you instantly spot round-number levels (e.g. every \$0.50).
* **Trade annotations:** Every historical entry/exit is automatically marked with arrows and labels—no more scrolling through Trade History.
* **Liquidation lines:** For each entry, the script computes your theoretical liquidation price, based on your chosen leverage, and draws it as a dashed line.
* **Performance metrics:** Total return, maximum drawdown, Sharpe ratio, and win rate are calculated and displayed on-chart, so you don’t have to wrestle with spreadsheets.
---
## How it’s structured
The code lives in a single **strategy**—add it via **Pine Editor → New Strategy** and click **Add to Chart**. Internally, it’s broken into four main sections:
1. **Grid setup:**
* **Inputs:** `gridStep`, `aboveLines`, `belowLines`, `gridColor`, `gridStyle`, `gridWidth`.
* **Persistent array:** stores `line` objects so they survive bar updates.
* **Draw/update logic:** on each confirmed historical bar, the script either recreates all lines (when you change the count) or simply repositions them around the new close.
2. **Entry/exit logic & annotations:**
* **Example system:** 20-period vs. 50-period simple moving-average crossover.
* **Labels & shapes:**
* Green triangles for long entries/exits, red for short.
* A “Long Liq:” or “Short Liq:” label at the point of entry.
3. **Liquidation calculations:**
* **Formula:**
* Long: `P_liq = P_entry × (1 − 1⁄L)`
* Short: `P_liq = P_entry × (1 + 1⁄L)`
* Let the script draw a dashed red (for longs) or dashed green (for shorts) line at each `P_liq`.
4. **Performance metrics:**
* **Built-ins:**
* `strategy.netprofit_percent` → total return %
* `strategy.max_drawdown_percent` → max drawdown %
* `strategy.wintrades` / `strategy.closedtrades` → win rate %
* **Sharpe ratio:** manually computed from per-bar returns, assuming a user-defined risk-free rate and bars-per-year count.
---
## Using & customizing the strategy
1. **Add to your chart.**
* Copy the full script into Pine Editor, select **Strategy**, and hit **Add to Chart**.
2. **Tune your grid.**
* **`Grid Interval ($)`**: e.g. `0.50` for \$0.50 steps.
* **`Lines Above`/`Below`**: how many lines to show on each side of the current price.
* **`Grid Style`**: choose Solid, Dashed, or Dotted; set line width and opacity via the color picker.
3. **Adjust your trading logic.**
* Out of the box, the script uses SMA(20) vs. SMA(50). Swap in any `ta.*` indicator calls you like.
4. **Set leverage & capital.**
* **`Leverage`**: affects the liquidation price.
* **`Initial Capital`** and **`Order Size`**: the strategy uses 100% of equity per trade by default—you can change that in the `strategy()` call.
5. **Review performance.**
* Metrics show up in the Strategy Tester and on-chart label.
* If you want data in the Data Window, expand the script’s name to see the hidden plots for return, drawdown, Sharpe, and win rate.
---
## Behind the code
Below is a high-level walkthrough of the key snippets:
```pinescript
//@version=6
strategy("Grid + Annotations & Liquidations", overlay=true,
initial_capital=100000, default_qty_type=strategy.percent_of_equity,
default_qty_value=100)
// ─ Grid inputs & style mapping ────────────────────────────────────────
gridStep = input.float(0.50, "Grid Interval ($)", minval=0)
aboveLines = input.int(5, "Lines Above", minval=0)
belowLines = input.int(5, "Lines Below", minval=0)
gridColor = input.color(color.new(color.gray, 80), "Grid Color")
gridStyle = input.string("Dashed", "Grid Style", options= )
gridWidth = input.int(1, "Grid Line Width", minval=1, maxval=5)
gridStyleConst = gridStyle == "Solid" ? line.style_solid :
gridStyle == "Dotted"? line.style_dotted :
line.style_dashed
```
* We map a simple string choice into Pine’s `line.style_*` constants.
* `gridStep` drives the spacing in dollars.
```pinescript
// Persist & update lines only when needed
var line gridLines = array.new_line()
if barstate.islastconfirmedhistory
total = aboveLines + belowLines + 1
if array.size(gridLines) != total
// delete & recreate
…
else
// only reposition
…
```
* Wrapping all drawing in `barstate.islastconfirmedhistory` avoids repaint issues.
* The script deletes and rebuilds lines only when you change `aboveLines`/`belowLines`, otherwise it simply moves them.
```pinescript
// MA crossover logic & liquidation labels
fast = ta.sma(close, 20)
slow = ta.sma(close, 50)
if ta.crossover(fast, slow)
strategy.entry("Long", strategy.long)
liq = close * (1 - 1.0 / leverage)
label.new(bar_index, low, text="Long Liq: " + str.tostring(liq))
line.new(…, y1=liq, y2=liq, color=color.red, style=line.style_dashed)
```
* Entries trigger both the `strategy.entry` call and a pair of visual cues: a label and a dashed line at the computed liquidation price.
```pinescript
// Performance metrics: draw from built-ins + manual Sharpe
totalRet = strategy.netprofit_percent
maxDD = strategy.max_drawdown_percent
winRate = strategy.closedtrades > 0 ?
(strategy.wintrades / strategy.closedtrades)*100 : 0
// Manual Sharpe calculation
… accumulate per-bar % returns … compute mean, stddev … apply formula …
```
* TradingView gives us return, drawdown, and trade counts out of the box.
* We calculate Sharpe ourselves so you can adjust the risk-free rate and periods per year.
---
## Wrapping up
This one-file strategy is designed to be both **educational** and **practical**:
* **Learn by reading:** every section is commented so you can see how Pine v6 handles arrays, loops, strategy functions, and labels.
* **Customize for your edge:** swap in your own indicators, change leverage, or hook up alerts.
* **Publish & share:** drop it into your public repo with this story as your README, and fellow traders will know exactly how to use it.
Feel free to fork, file issues, or submit pull requests. Happy charting—and may your grid lines always align!
CANDLE MARKER - 4AM, 4PM (Daily) + 7PM (Mondays)This indicator draws vertical lines at key session times in UTC+1 (Casablanca local time):
- Red line at 04:00 AM daily
- Green line at 04:00 PM daily
- Blue line at 07:00 PM only on Mondays (2024–2025)
Perfect for traders who want to mark important intraday levels for Forex, Crypto, or any asset class. Works on timeframes from 1 minute up to 1 hour. Customizable colors and full multi-market support.
VWAP Double Touch Alert (Timeframe-Aware)📌 VWAP Double Touch Alert — Smart Re-entry Signal for Precision Traders
Take your VWAP trading to the next level with this intelligent indicator that filters out the noise and zeroes in on high-probability re-entry setups.
💡 How it works:
This script tracks every time price touches the VWAP line and alerts you when it happens twice within a defined window of time (adjustable per your timeframe). This is often a sign of smart money accumulation, potential reversals, or explosive breakouts.
🔍 Why Traders Love It:
✅ Filters out weak signals — only alerts on confirmed double touches
✅ Fully adjustable VWAP zone sensitivity
✅ Selectable timeframe profiles or custom window (1m, 5m, 15m, 30m, etc.)
✅ Clean visual cues with minimal chart clutter
✅ Perfect for scalping, intraday reversals, or VWAP mean-reversion strategies
⚙️ Customization:
VWAP zone width (in %)
Time window in bars or automatic based on timeframe
Custom alert messages
Alert only triggers once per double-touch event to avoid spamming
🎯 Best For:
Crypto scalpers & day traders
VWAP bounce and mean-reversion traders
Traders who want clean, conclusive entry alerts without lag
Death Cross Max Drop % (Near DC)The "Death Cross Max Drop % (Near DC)" indicator is designed to help traders and analysts quantify the potential downside following a "Death Cross" event. A Death Cross typically occurs when a shorter-term Simple Moving Average (SMA) crosses below a longer-term SMA, often signaling a potential bearish trend. This indicator not only identifies these events but also measures the maximum percentage drop from the point of the Death Cross until the subsequent "Golden Cross" (shorter-term SMA crosses back above the longer-term SMA).
How it Works:
SMA Configuration: The indicator uses two Simple Moving Averages (SMAs). By default, these are the 100-period SMA and the 200-period SMA, but their lengths are configurable in the settings.
Death Cross Detection: It identifies when the shorter SMA (e.g., SMA 100) crosses below the longer SMA (e.g., SMA 200). This event is marked on the chart with a red downward triangle.
Measurement Period: Once a Death Cross is detected, the indicator records the closing price of that bar. It then tracks the lowest low price reached from that point until a Golden Cross (shorter SMA crosses above longer SMA) occurs, signaling the end of that specific bearish cycle for measurement purposes.
Percentage Drop Calculation: Upon the confirming Golden Cross, the indicator calculates the maximum percentage drop from the recorded Death Cross price to the lowest low observed during the cycle.
Label Display: The key feature is how this information is displayed. The calculated maximum percentage drop is shown in a label that is strategically placed on the chart at the bar index where the original Death Cross occurred. This provides a direct visual link between the bearish signal and its measured outcome.
Tooltip Information: The label also includes a detailed tooltip that appears when you hover over it, showing:
The cycle type (Death Cross to Golden Cross).
The price at the time of the Death Cross.
The lowest low price reached during the cycle.
The calculated maximum percentage drop.
Key Features:
Configurable SMA lengths for customized analysis.
Clear visual signals (red triangles) for Death Cross events.
Precise calculation of the maximum percentage drop within a defined bearish cycle.
Unique Label Placement: The result (max drop %) is plotted near the initiating Death Cross bar, making it easy to visually correlate the signal with its historical impact.
Informative tooltips for quick access to detailed cycle data.
Plots the SMAs for context.
How to Use / Interpretation:
This indicator can be a valuable tool for traders looking to understand the historical impact of Death Cross signals on a specific asset.
It can aid in backtesting strategies or assessing the typical extent of drawdowns after such a bearish signal.
By seeing the max drop percentage directly linked to the Death Cross event, users can quickly gauge the potential risk or severity associated with past occurrences.
Always use this indicator in conjunction with other forms of analysis and risk management practices. Past performance, as measured by this indicator, is not indicative of future results.
Settings:
SMA 100 Length: Default 100 (can be adjusted).
SMA 200 Length: Default 200 (can be adjusted).
Source: Price source for SMA calculations (default is 'close').
This indicator is written in Pine Script v5.
Death Cross Max Drop % (Near DC)This indicator identifies Death Cross events (when the 100-period SMA crosses below the 200-period SMA) and tracks the subsequent price decline until a Golden Cross (100-period SMA crosses above the 200-period SMA) signals a potential reversal or end of that downtrend phase.
For each completed Death Cross to Golden Cross cycle, the script calculates the maximum percentage drop from the closing price at the Death Cross to the lowest low price reached before the subsequent Golden Cross.
This maximum percentage drop is then displayed as a text label on the chart. The label is strategically positioned near the bar where the Death Cross originally occurred, offering a historical measure of the decline during that specific cycle. The tooltip for the label provides further details, including the price at the Death Cross, the lowest low reached, and the calculated maximum percentage drop.
Additionally, the indicator plots the 100-period and 200-period SMAs and visually marks Death Cross events on the chart with a downward-pointing red triangle. Users can customize the lengths of the SMAs and the price source (e.g., close, open) used for the calculations.
Key Features:
Calculates the maximum percentage drop from a Death Cross to the lowest low before the next Golden Cross.
Displays the result as a label (with a downward arrow style) positioned near the original Death Cross bar.
Plots SMA 100 and SMA 200.
Marks Death Cross events with a red triangle pointing down.
Configurable SMA lengths and price source.
Golden Cross Max Rise % (Near GC)This indicator identifies Golden Cross events (when the 100-period SMA crosses above the 200-period SMA) and tracks the subsequent price action until a Death Cross occurs (100-period SMA crosses below the 200-period SMA).
Upon the completion of a Golden Cross to Death Cross cycle, the script calculates the maximum percentage rise achieved from the closing price at the Golden Cross to the highest high recorded during that cycle.
This maximum percentage rise is then displayed as a text label on the chart. The label is strategically placed near the bar where the Golden Cross originally occurred, providing a historical performance insight for that specific cycle. The label includes the max rise percentage, the price at the Golden Cross, and the highest high reached.
Additionally, the indicator plots the 100-period and 200-period SMAs and visually marks Golden Cross events on the chart with an upward-pointing triangle. Users can customize the lengths of the SMAs and the price source used for calculations.
Key Features:
Calculates the maximum percentage rise between a Golden Cross and the subsequent Death Cross.
Displays the result as a label positioned near the original Golden Cross bar.
Plots SMA 100 and SMA 200.
Marks Golden Cross events with a shape.
Configurable SMA lengths and price source.
Stochastic RSI with MTF TableShort Description of the Script
The provided Pine Script indicator, titled "Stochastic RSI with MTF Table," calculates and displays the Stochastic RSI for the current timeframe and multiple other timeframes (5m, 15m, 30m, 60m, 240m, and daily). The Stochastic RSI is a momentum indicator that blends the Relative Strength Index (RSI) and Stochastic Oscillator to identify overbought and oversold conditions, as well as potential trend reversals via K and D line crossovers.
Key features of the script include:
Inputs: Customizable parameters such as K smoothing (default 3), D smoothing (default 3), RSI length (default 14), Stochastic length (default 14), source price (default close), and overbought/oversold levels (default 80/20).
MTF Table: A table displays the Stochastic RSI status for each timeframe:
"OB" (overbought) if K > 80, "OS" (oversold) if K < 20, or "N" (neutral) otherwise.
Crossovers: "K↑D" for bullish (K crosses above D) and "K↓D" for bearish (K crosses below D).
Visualization: Plots the K and D lines for the current timeframe, with horizontal lines at 80 (overbought), 50 (middle), and 20 (oversold), plus a background fill for clarity.
Table Position: Configurable to appear in one of four chart corners (default: top-right).
This indicator helps traders assess momentum across multiple timeframes simultaneously, aiding in the identification of trend strength and potential entry/exit points.
Trading Strategy with 50EMA and 200EMA for Highest Winning Rate
To create a strategy with the best probability of a high winning rate using the Stochastic RSI MTF indicator alongside the 50-period Exponential Moving Average (50EMA) and 200-period Exponential Moving Average (200EMA), we can combine trend identification with momentum-based entry timing. The 50EMA and 200EMA are widely used to determine medium- and long-term trends, while the Stochastic RSI MTF table provides multi-timeframe momentum signals. Here’s the strategy:
1. Determine the Overall Trend
Bullish Trend: The 50EMA is above the 200EMA on the current timeframe (e.g., daily or 60m chart). This suggests an uptrend, often associated with a "Golden Cross."
Bearish Trend: The 50EMA is below the 200EMA on the current timeframe. This indicates a downtrend, often linked to a "Death Cross."
Implementation: Plot the 50EMA and 200EMA on your chart and visually confirm their relative positions.
2. Identify Entry Signals Using the Stochastic RSI MTF Table
In a Bullish Trend (50EMA > 200EMA):
Look for timeframes in the MTF table showing:
Oversold (OS): K < 20, indicating a potential pullback in the uptrend where price may rebound.
Bullish Crossover (K↑D): K crosses above D, signaling rising momentum and a potential entry point.
Example: If the 60m and 240m timeframes show "OS" or "K↑D," this could be a buy signal.
In a Bearish Trend (50EMA < 200EMA):
Look for timeframes in the MTF table showing:
Overbought (OB): K > 80, suggesting a rally in the downtrend where price may reverse downward.
Bearish Crossover (K↓D): K crosses below D, indicating declining momentum and a potential short entry.
Example: If the 30m and daily timeframes show "OB" or "K↓D," this could be a sell/short signal.
Current Timeframe Check: Use the plotted K and D lines on your trading timeframe for precise entry timing (e.g., confirm a K↑D crossover on a 60m chart for a long trade).
3. Confirm Signals Across Multiple Timeframes
Strengthen the Signal: A higher winning rate is more likely when multiple timeframes align with the trend and signal. For instance:
Bullish trend + "OS" or "K↑D" on 60m, 240m, and daily = strong buy signal.
Bearish trend + "OB" or "K↓D" on 15m, 60m, and 240m = strong sell signal.
Prioritize Higher Timeframes: Signals from the 240m or daily timeframe carry more weight due to their indication of broader trends, increasing reliability.
4. Set Stop-Loss and Take-Profit Levels
Long Trades (Bullish):
Stop-Loss: Place below the most recent swing low or below the 50EMA, whichever is closer, to protect against trend reversals.
Take-Profit: Target a key resistance level or use a risk-reward ratio (e.g., 2:1 or 3:1) based on the stop-loss distance.
Short Trades (Bearish):
Stop-Loss: Place above the most recent swing high or above the 50EMA, whichever is closer.
Take-Profit: Target a key support level or apply a similar risk-reward ratio.
Trailing Stop Option: As the trend progresses, trail the stop below the 50EMA (for longs) or above it (for shorts) to lock in profits.
5. Risk Management
Position Sizing: Risk no more than 1-2% of your trading capital per trade to minimize losses from false signals.
Volatility Consideration: Adjust stop-loss distances and position sizes based on the asset’s volatility (e.g., wider stops for volatile stocks or crypto).
Avoid Overtrading: Wait for clear alignment between the EMA trend and MTF signals to avoid low-probability setups.
Example Scenario
Chart: 60-minute timeframe.
Trend: 50EMA > 200EMA (bullish).
MTF Table: 60m shows "OS," 240m shows "K↑D," and daily is "N."
Action: Enter a long position when the 60m K line crosses above D, confirming the table signal.
Stop-Loss: Below the recent 60m swing low (e.g., 2% below entry).
Take-Profit: At the next resistance level or a 3:1 reward-to-risk ratio.
Outcome: High probability of success due to trend alignment and multi-timeframe confirmation.
Why This Strategy Works
Trend Following: Trading in the direction of the 50EMA/200EMA trend reduces the risk of fighting the market’s momentum.
Momentum Timing: The Stochastic RSI MTF table pinpoints pullbacks or reversals within the trend, improving entry timing.
Multi-Timeframe Confirmation: Alignment across timeframes filters out noise, increasing the win rate.
Risk Control: Defined stop-loss and position sizing protect against inevitable losses.
Caveats
No strategy guarantees a 100% win rate; false signals can occur, especially in choppy markets.
Test this strategy on historical data or a demo account to verify its effectiveness for your asset and timeframe.
This approach leverages the strengths of both trend-following (EMA) and momentum (Stochastic RSI) tools, aiming for a high-probability, disciplined trading system.
RSIOMA IndicatorI trust the RSIOMA by itself when I am at work, on the road, at play, and using only my cell phone.
When I find the long, high plateau or the bottom river bed, my attention perks up.
I examine the nearby timeframes to see if there are any similar patterns.
Please don't use any of the middle crosses; they don't have the power out of the gate that the flat ones do.
I wait and wait for the smaller timeframe to make its cross and add one position.
At every pullback, I start adding positions. Each of you needs to become comfortable with this indicator and start trusting it first.
I am guilty of fading this flat top or bottom, but they can go forever, it seems.
But then that 200-point bar drops, and all the pain goes away with a considerable profit.
I reset and start scanning other charts for the same.
Long Faded 7 PM LineLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chartLong vertical line to mark out 7pm on chart
Mark 7 PMMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London openMark 7pm on chart every day for London open
BB Vicinity Reversal SignalsThis indicator detects potential intraday reversal opportunities based on price action near the outer edges of Bollinger Bands (±2.7 std dev). Unlike traditional Bollinger Band signals that require strict band touches or crossings, this tool identifies reversals that occur in the vicinity of the outer bands, increasing signal frequency while maintaining logical precision.
✅ Key Features:
Buy Signal: Triggered when a bullish candle with a strong body forms near the lower Bollinger Band.
Sell Signal: Triggered when a bearish candle with a strong body forms near the upper Bollinger Band.
Vicinity logic: User-adjustable % range from the outer bands (default: 20%) to define how close price must be.
Body-to-candle ratio filter: Ensures that only meaningful directional candles trigger signals.
No repainting: All signals are generated in real-time based on confirmed candle closes.
Built-in alerts: Receive instant notifications for buy and sell setups.
This tool is ideal for traders looking to capture high-probability mean-reversion trades without being overly restrictive. It works well on intraday timeframes like 5m, 15m, and 1h.
TLC sessionA Professional Intraday Session Tracker with VWAP and Economic Event Integration
Description
This indicator provides visual tracking of major trading sessions (Asian, London, New York) combined with VWAP calculations and macroeconomic event zones. It's designed for intraday traders who need to monitor session overlaps, liquidity periods, and high-impact news events.
The basic script of trading sessions was taken as a basis and refined for greater convenience.
Key Features:
Customizable Session Tracking: Visualize up to 3 trading sessions with adjustable time zones (supports IANA & GMT formats)
Dynamic VWAP Integration: Built-in Volume-Weighted Average Price calculation
Macro Event Zones: Highlights key economic announcement windows (adjustable for summer/winter time)
Price Action Visualization: Displays open/close prices, session ranges, and average price levels
Automatic DST Adjustment: Uses IANA timezone database for daylight savings awareness
How It Works
1. Trading Session Detection
Three fully configurable sessions (e.g., Asia, London, New York)
Each session displays:
Colored background zone
Opening price (dashed line)
Closing price (dashed line)
Average price (dotted line)
Optional label with session name
2. VWAP Calculation
Standard Volume-Weighted Average Price plotted as circled line
Helps identify fair value within each session
3. Macro Event Zones
Special highlighted period for economic news releases
Automatically adjusts for summer/winter time
Default set to 1000-1200 (summer) or 0900-1100 (winter) GMT-5 (US session open)
Why This Indicator is Unique
Multi-Session Awareness
Unlike simple session indicators, this tool:
Tracks price development within each session
Shows session overlaps (critical for volatility periods)
Maintains separate VWAP calculations across sessions
Professional-Grade Features
IANA timezone support (automatic DST handling)
Customizable visual elements (toggle labels, ranges, averages)
Object-based architecture (clean, efficient rendering)
News event integration (helps avoid trading during high-impact releases)
Usage Recommendations
Best Timeframes
1-minute to 1-hour charts (intraday focus)
Not recommended for daily+ timeframes
Trading Applications
1. Session Breakout Strategy: Trade breakouts when London/New York sessions open
2. VWAP Reversion: Fade moves that deviate too far from VWAP
3. News Avoidance: Reduce position sizing during macro event windows
Visual Example
Asian session (red)
London session (blue)
New York session (purple)
Macro event zone (white)
VWAP line (gold circles)
The basic script of trading sessions was taken as a basis and refined for greater convenience.