Auto DayWeekMonth Fib Levels R2 by JustUncleLThis indicator automatically draws up to Three Sets of Fibonacci Pivot levels based on the previous Candle period's Range (High-Low). The HLC3 is used as the default Pivotal level. Only the most Recent period Candle Levels are displayed. The longer Weekly and Monthly sets are particularly useful in finding long term Supply and Demand levels.
The three sets of selectable periods are spit into the following sets:
Daily Set (1,2,3,4,5,7,10 or 14 Days)
Weekly Set (1,2,3,4,5,10, or 13 Weeks)
Monthly Set (1,2,3,4,5,6,9 or 12 months)
Each set has the option to display Extension levels.
The Pivotal Level HLC3 and Range = (High - Low), are extracted from previous Period Candle.
FIB LEVELS Colours (same in each period set):
Yellow = Pivot and Pivot Zone (HLC3 by default)
Fuchsia = R1,S1 Levels 0.368 * Range
Lime = R2,S2 Levels 0.618 * Range
Red = R3,S3 Levels 0.786 * Range
Aqua = R4,S4 Levels 1.000 * Range
Green = R5,S5 Levels 1.236 * Range
Orange = R6,S6 Levels 1.382 * Range
Black = R7,S7 Levels 1.618 * Range
Maroon = R8,S8 Levels 2.000 * Range
Поиск скриптов по запросу "weekly"
Pullback Trading Tool R5-65 by JustUncleLBy request this is an updated version of the "PullBack Trading Tool": removes experimental "OCC" channel, added option to display ribbons or just single moving average lines, added alert arrows for "PB" exits, added alertcondition for TV alarm subsystem, added some extract options for Pivot points and general cleanup of code.
Description:
This project incorporates the majority of the indicators needed to analyse and trade Trends for Pullbacks, swings and reversals.
Incorporated within this tool are the following indicators:
1. Major industry (Banks) recognised important EMAs in an EMA Ribbon:
Lime = EMA5 (Optional Display)
DodgerBlue = EMA12 (Optional Display)
Red = EMA36 (Optional display)
Green = EMA89
Blue = EMA200
Black = EMA633
2. The 5 EMA (default) High/Low/Close Price Action Channel (PAC), the PAC channel display is disabled by default.
3. Optionally display Fractals and optional Fractal levels
4. Optional HH, LH, LL, HL finder.
5. Optional Buy/Sell "PB" exit Alerts with Optional 200EMA filter.
6. Coloured coded Bar high lighting based on the PAC:
blue = bar closed above PAC
red = bar closed below PAC
gray = bar closed inside PAC
7. Alert condition sent to TradingView's Alarm subsystem for PB exits.
8. Pivot points with optional labels.
9. EMA5-12 Ribbon is displayed by default.
10.EMA12-36 Ribbon is displayed by default
Set up and hints:
I am unable to provide a full description here, as Pullback Trading incorporates a full trading Methodology, there are a number of articles and books written on the subject.
Set the chart to Heikin Ashi Candles (optional).
I also add a "Sweetspot Gold R3" indicator to the chart as well to help with support and resistance finding and shows where the important "00" lines are.
First on a weekly basis say Sunday night or Monday morning, analyse the Daily and Weekly charts to establish overall trends, and support/resistant levels. Draw significant mini trend lines (2/3 TL), vertical trend lines (VTL) and S/R levels. Can use the Pivots points to guide VTL drawing and Fractals to help guide 2/3 TL drawing.
Once the trend direction and any potential major reversals highlighted, drop down to lower timeframe chart and draw appropriate mini Trend line (2/3 TL) matching the established momentum direction. Take note of potential pull backs from and of the EMAs, in particular the EMA5-12 ribbon, EMA12-36 Ribbon and the 200EMA. Can use the Pivots and/or Fractals points to guide your 2/3 TL drawing.
Set a TradingView alarm on the "PBTOOL alert", with the default settings this normally occurs before or during the Break of the manually drawn TL lines.
Once alerted check to see if the TL is broken and is returning to trend away from the EMA lines, this is indicated by bar colour change to trend directional colour.
You can trade that alert or drop down to even lower time frames and perform the same TL analysis there to find trades at the lower TF. Trading at lower TF you will allow tighter Stop loss settings.
Other than the "SweetSpot Gold R3" indicator, you should not need any other indicator to successfully trade trends for Pullbacks and reversals. If you really want another indicator I suggest a momentum one for example: AO ( Awesome Oscillator ), MACD or Squeeze Momentum.
KK_Average Directional Index (ADX) Higher TFHey guys,
sometimes you just want to plot an Indicator value from a higher Timeframe on your Chart. For most Indicators this is pretty straightforward however there is one Indicator that has been giving me quite a headache while trying to do this: The Average Directional Index . Anyway after going through almost 200 versions of this script I finally found a solution that works and thought I would share this with you, since I'm sure some of you have encountered the same problem.
How it works
Go to your desired Instrument/Timeframe and add the Script
Under Settings in the field for "Higher ADX TF" put the Timeframe-code you want to pull the ADX Values from.
- Codes: Monthly - M, Weekly W, Daily - D
- Codes Intraday: The amount of hours in minutes, e.g. if you want to pull values from the 4h-Chart the code is 240 (60 for 1h, 15 for 15m ...)
In some cases (see below) the calculation might not be correct. So make sure the values are correct:
a) Write down the latest ADX of the higher TF while you are on the lower TF
b) Switch the Resolution to the higher TF
c) Compare the value you have just written down to the next to last value. They should be the same.
d) Switch back the Resolution to the lower TF and you're good to go.
Limitations
You can only pull values from higher Timeframes, e.g. you're on a 4h Chart, so you can only pull values from the Daily, Weekly and Monthly Chart. You can't pull values from the 1h Chart.
You can only pull values from Timeframes, where the higher Timeframe Close always has a corresponding Close on the lower Timeframe, e.g. you can't pull values from the 3h Chart when you are on a 2h Chart. This should be pretty rare.
The Script needs a certain amount of Data from the Higher TF before the calculated values are correct. I have tested this on several Instruments and the Script usually needs approximately 100 Bars on the higher Timeframe (often less) for the values to be correct (error < 1%).
So when the difference between your lower Timeframe and you higher Timeframe is large, e.g. you want to pull the Daily ADX value on a 15m-Chart, the calculation can be wrong. This can lead to errors in 2 Cases:
a) Backtesting: When you go over old data and get close to the last available Bar the Data will be wrong. This will limit the amount of data you can backtest.
b) Live values: When the difference between the two Timeframes is too large, it is possible that even live values are wrong, e.g. this will be the case when you are trying to pull the Daily ADX value on a 5 minute Chart. Always check if the calculation works with your desired combination of Timeframes before using it (see above).
I hope this is useful for you and whish all of you successful trading!
Best regards
Kurbelklaus
Range Delta Heiken Ashi Bollinger|Buy/Sell |OB & OS CandlesPurpose: Mathematically represent buying and selling zones for Daily/ Weekly Traders
Indicator: Calculates moving average of the candle's body with respect to the daily trading range
Buy and Sell Signals: Calculates Bollinger Range with Max/Min and Buy/Sell Bollinger signals
Overbought and Oversold Signals: Candlesticks show overbought and oversold conditions
Level of Difficulty: This indicator was written to make life easier. Follow the Rules and anyone can use it.
Rule 1: Buy when candlestick is below "purple" line
Rule 2: Sell when candlestick is above "blue" line
Rule 3: Add bollinger bands to your currency chart
Rule 4: Confirm indicator bollinger bands with currency chart's bollinger bands
Rule 5: Trade in direction of trend
Rule 6: As with all trading; no indicators are fool proof. Please trade responsibly.
****Full Customization for you****
Suggestion 1: Add bollinger bands to currency chart to improve probability
Suggestion 2: Trade the direction of Trend
Suggestion 3: This indicator works very well with Ranged Markets (or use Suggestion 2)
Disclaimer 1: This Indicator words best on Daily and Weekly time frames
Disclaimer 2: Enjoy the Indicator and feel free to ADD COMMENTS; I worked very hard for you and me :)
Auto Pivots with S/R LevelsPlots out the pivot point with corresponding Support / Resistance levels.
It will automatically determine the time frame to calculate pivots based on the current view resolution.
Monthly resolution will pull a yearly pivot
Weekly resolution will pull a monthly pivot
Daily view will pull a weekly pivot
Intraday view will pull a daily pivot.
You have the choice of using Standard pivots or Fibonacci pivots
You can choose to only display the most recent pivot or all pivots
You can chose to extend the most recent pivot across the whole chart as a price line
TODO:
- Add in the ability to choose how far back historically to display pivots
- Add in calculations for smaller resolutions to calculate off lower time frames. EX: minute resolution should pull hour time frame to calculate pivots.
Herrick Payoff Index for Quandl DataUpdate to my previous Herrick Payoff Index script. This script pulls Quandl futures data with daily open interest. The prior version only used the weekly Commitment of Traders open interest data so could only be used on weekly bars. Note: Must use Quandl Symbol methodology in chart (i.e. enter symbol as QUANDL:CHRIS/CME_FC2, QUANDL:CME/FCX2016, ect.). Unfortunately, I haven't been able to program this to pull from the embedded futures data.
UCS_S_Stochastic Pop and Drop StrategyMy Contribution to Jake Bernstein Educational Series, Initiated by Chris Moody.
The Stochastic Pop was developed by Jake Bernstein and modified by David Steckler. Bernstein's original Stochastic Pop is a trading strategy that identifies price pops when the Stochastic Oscillator surges above 80. Steckler modified this strategy by adding conditional filters using the Average Directional Index (ADX) and the weekly Stochastic Oscillator.
Modifications
1. Weekly Stochastic Oscillator for Trading Bias = 5* Daily Stochastic
2. Optional Volume Confirmation, Custom Average Volume Length
Future Plans
1. Adding Triggers for Entry, Stops and Target. - This will be release when we have ability to code the complete Strategy. Although it can be done with the current pinescript options, it would be far more easier if we have strategy ability.
Link for Educational Purpose
stockcharts.com
-
Good Luck Trading
UCSgears
VWAP + Volume Spikes See Where Smart Money ExhaustsVolume tells the truth. VWAP tells the bias. This script shows both — live.
If you trade intraday momentum, reversals, or liquidity sweeps, this indicator is built for you.
It shows where volume spikes hit extreme levels, anchored around VWAP and its dynamic bands, so you can instantly spot capitulation or hidden absorption.
🎯 What This Indicator Does
✅ Plots VWAP — session-anchored, updates automatically
✅ Adds dynamic VWAP bands — standard deviation envelopes showing volatility context
✅ Highlights volume spikes — colored candles + background for abnormal prints
✅ Includes alerts — “Volume Spike”, “VWAP Cross”, or a combined alert with direction
✅ Clean visual design — instantly readable in fast markets
It’s your visual orderflow radar — whether you’re trading gold, indices, or small caps.
🔍 Why It Works
Institutions build and unwind positions around VWAP.
Retail often chases volume… this script shows you when that volume becomes too extreme.
A spike above VWAP near resistance? → Likely distribution.
A spike below VWAP near support? → Likely capitulation.
Combine volume exhaustion + VWAP context, and you’ll see market turning points form before most indicators react.
⚙️ Inputs You Can Tune
Bands lookback: adjusts how reactive the VWAP bands are
Band width (σ): set how tight or wide your deviation envelope is
Volume baseline length: controls how “abnormal” a spike must be
Spike threshold: multiplier vs. average volume
Toggle color-coding, bands, and labels
Default settings work well across 1m–15m intraday charts and 1h–4h swing frames.
💡 How Traders Use It
1️⃣ Fade Parabolics:
When a green spike candle pierces upper VWAP band on high volume → smart money unloading.
Look for rejection and short into VWAP.
2️⃣ Catch Capitulations:
When a red spike candle dumps below lower VWAP band → panic selling.
Watch for stabilization and long back to VWAP.
3️⃣ VWAP Rotation Plays:
Alerts for price crossing VWAP help you spot shift in intraday control.
Above VWAP = buyers in charge.
Below VWAP = sellers in charge.
🧠 Best Practices
Pair it with Volume Profile or Delta/Flow tools to confirm exhaustion.
Don’t chase — wait for spike confirmation + reversal candle.
Use it on liquid tickers (NASDAQ, SPY, GOLD, BTC, etc.).
Great for Dux-style small-cap shorts or index pullbacks.
🔔 Alerts Ready
Choose from:
Volume Spike (single-bar explosion)
VWAP Cross Up/Down (trend shift confirmation)
One Combined Alert (any signal, includes ticker, price, and volume)
Set once — get real-time push notifications, Telegram, or webhook signals.
📊 My Favorite Setups
US100 / NASDAQ: fade rallies above VWAP + spike
Gold / Silver: trade reversals from VWAP bands
Small caps: short back-side after volume climax
ES, DAX, Oil: scalp VWAP rotation with confluence
❤️ Support This Work
I release free and premium scripts weekly — combining smart money concepts, VWAP tools, and volume analytics.
👉 Follow me on TradingView for more indicators and setups.
👉 Comment “🔥” if you want me to post the multi-timeframe VWAP + Volume Pressure version next.
👉 Share this with your team — it helps the community grow.
FC Session & Levels: Killzone, FVG, BB, OB, MAs, VWAP, Zizag FibFC Session & Levels – Ultimate Multi-Tool Trading Indicator
All-in-one professional-grade indicator combining session analysis, key levels, institutional concepts, and trend tools for futures, forex, crypto, and stocks.
Core Features
Real-time Session High/Low tracking for Asia, London, NY AM/PM, MOC
Dynamic Daily Pivot Points with R1–R3 / S1–S3 levels
Configurable Opening Range Breakout (ORB) 15-min high/low from NY open
Smart VWAP, EMA/SMA crosses, Trend Cloud (EMA38/62)
CHoCH (Change of Character) detection with dotted breakout lines
Fair Value Gaps (FVG) with volume & ATR filtering
Advanced ZigZag + Fibonacci Retracement/Extension levels
Institutional Order Blocks & Breaker Blocks with mitigation tracking
How to Use – Step-by-Step Instructions
1. Add to Chart
Open TradingView → Indicators → Search " FC Session & Levels "
Add to any chart (works on all timeframes, best on 1m–1H)
2. Configure Time Zone
Set Time Zone to UTC-5 (Standard Time) or UTC-4 (Daylight Saving)
NYT sessions auto-adjust
3. Enable Sessions
Toggle: Asia, London, NY AM, NY PM, MOC
Each draws high/low lines + optional labels
Colors fully customizable
4. Pivot & Pre-Market Levels
Daily Pivot (PP) + R1–R3 / S1–S3 auto-calculated
Pre-Day High/Low (purple) & Pre-Week High/Low (blue)
Daily Open line (cyan)
Extend future lines with Extend Future
5. Opening Range Breakout (ORB)
Enable ORB 15min High/Low
Set start: 9:30 AM , end: 9:45 AM (NYT)
Lines extend ± N bars (default 5)
Great for breakout entries
6. VWAP & Moving Averages
Toggle VWAP , MA9/20 cross , MA50/100/200
Trend Cloud : EMA38 (fast) vs EMA62 (slow) → bullish/bearish fill
7. CHoCH – Change of Character
Detects swing breaks with 20-bar lookback
Draws dotted line from swing point to breakout
Labels: "CHoCH" in green (bull) or red (bear)
8. Fair Value Gaps (FVG)
Detects gaps > 0.5× ATR with volume > 1.2× avg
Draws semi-transparent boxes + midline
Max 10 FVGs , auto-expire after 50 bars
9. ZigZag + Fibonacci
ZigZag period: 15 (adjustable)
Auto-draws 0.236, 0.382, 0.5, 0.618, 0.786 levels
Labels show ratio + price
Extends to right on last leg
10. Order Blocks & Breaker Blocks
Detects institutional zones using swing + volume
Filters by size (0–30%) and volume multiplier
Shows last 5 Bull / 5 Bear OBs
Breaker Blocks : when OB is broken → becomes supply/demand
Mitigation tracking : 50%, Close, or Wick
Strength score (0–100) → stronger = bolder color
11. Statistics Dashboard
Toggle Show Statistics Table
Displays: Total OBs, Breakers, Bull/Bear counts
Position: Top/Bottom, Left/Right
12. Alerts
Bullish OB Formation
Bearish OB Formation
Breaker Block Formation
Polarity Change (▲/▼)
Best Practices & Tips
Use on 1m, 3m, 5m, 15m for intraday
Combine ORB + CHoCH for high-probability breakouts
Wait for FVG retest in direction of trend
Strong OBs (>70 strength) = high confluence zones
Use Pre-Week H/L for weekly bias
MOC session (15:50–16:00) = final 10min imbalance
Customization Options
Colors : All lines, boxes, labels
Opacity : Pivot (0–100%), FVG, OB
Line Width : OB/Breaker lines
Display Mode : Boxes, Lines, or Both
Labels : Session, FVG, CHoCH, Polarity
Author : futurescall @ fcalgobot.com . discord.gg
Credit: @LuxAlgo for BB, OB . Zigzag base on @LonesomeTheBlue
MA SMART Angle
### 📊 WHAT IS MA SMART ANGLE?
**MA SMART Angle** is an advanced momentum and trend detection indicator that analyzes the angles (slopes) of multiple moving averages to generate clear, non-repainting BUY and SELL signals.
**Original Concept Credit:** This indicator builds upon the "MA Angles" concept originally created by **JD** (also known as Duyck). The core angle calculation methodology and Jurik Moving Average (JMA) implementation by **Everget** are preserved from the original open-source work. The angle calculation formula was contributed by **KyJ**. This enhanced version is published with respect to the open-source nature of the original indicator.
Original indicator reference: "ma angles - JD" by Duyck
---
## 🎯 ORIGINALITY & VALUE PROPOSITION
### **What Makes This Different from the Original:**
While the original "MA Angles" by **JD** provided excellent angle visualization, it lacked actionable entry signals. **MA SMART Angle** addresses this by adding:
**1. Clear Entry/Exit Signals**
- Explicit BUY/SELL arrows based on angle crossovers, momentum confirmation, and MA alignment
- No guessing when to enter trades - the indicator tells you exactly when conditions align
**2. Non-Repainting Logic**
- All signals use confirmed historical data (shifted by 2 bars minimum)
- Critical for backtesting reliability and live trading confidence
- Original indicator could repaint signals on current bar
**3. Dual Signal System**
- **Simple Mode:** More frequent signals based on angle crossovers + momentum (for active traders)
- **Strict Mode:** Requires full multi-MA alignment + momentum confirmation (for conservative traders)
- Adaptable to different trading styles and risk tolerances
**4. Smart Signal Filtering**
- **Anti-spam cooldown:** Prevents duplicate signals within configurable bar count
- **No-trade zone detection:** Filters out low-conviction sideways markets automatically
- **Multi-timeframe MA alignment:** Ensures all moving averages agree on direction before signaling
**5. Enhanced Visualization**
- Large, clear BUY/SELL arrows with descriptive labels
- Color-coded backgrounds for market states (trending vs. ranging)
- Momentum histogram showing acceleration/deceleration in real-time
- Live status table displaying trend strength, angle value, momentum, and MA alignment
**6. Professional Alert System**
- Four distinct alert conditions: BUY Signal, SELL Signal, Strong BUY, Strong SELL
- Enables automated trade notifications and strategy integration
**7. Modified MA Periods**
- Original used EMA(27), EMA(83), EMA(278)
- Enhanced version uses faster EMA(3), EMA(8), EMA(13) for more responsive signals
- Better suited for modern volatile markets and shorter timeframes
---
## 📐 HOW IT WORKS - TECHNICAL EXPLANATION
### **Core Methodology:**
The indicator calculates angles (slopes) for five key moving averages:
- **JMA (Jurik Moving Average)** - Smooth, lag-reduced trend line (original implementation by **Everget**)
- **JMA Fast** - Responsive momentum indicator with higher power parameter
- **MA27 (EMA 3)** - Primary fast-moving average for signal generation
- **MA83 (EMA 8)** - Medium-term trend confirmation
- **MA278 (EMA 13)** - Slower trend filter
### **Angle Calculation Formula (by KyJ):**
```
angle = arctan((MA - MA ) / ATR(14)) × (180 / π)
```
**Why ATR normalization?**
- Makes angles comparable across different instruments (forex, stocks, crypto)
- Makes angles comparable across different timeframes
- Accounts for volatility - a 10-point move in different assets has different significance
**Angle Interpretation:**
- **> 15°** = Strong trend (momentum accelerating)
- **0° to 15°** = Weak trend (momentum present but moderate)
- **-2° to +2°** = No-trade zone (sideways/choppy market)
- **< -15°** = Strong downtrend
### **Signal Generation Logic:**
#### **BUY Signal Conditions:**
1. MA27 angle crosses above 0° (upward momentum initiates)
2. All three EMAs (3, 8, 13) pointing upward (trend alignment confirmed)
3. Momentum is positive for 2+ bars (acceleration, not deceleration)
4. Angle exceeds minimum threshold (not in no-trade zone)
5. Cooldown period passed (prevents signal spam)
#### **SELL Signal Conditions:**
1. MA27 angle crosses below 0° (downward momentum initiates)
2. All three EMAs pointing downward (downtrend alignment)
3. Momentum is negative for 2+ bars
4. Angle below negative threshold (not in no-trade zone)
5. Cooldown period passed
#### **Strong BUY+ / SELL+ Signals:**
Additional entry opportunities when JMA Fast crosses JMA Slow while maintaining strong directional angle - indicates momentum acceleration within established trend.
---
## 🔧 HOW TO USE
### **Recommended Settings by Trading Style:**
**Scalpers / Day Traders:**
- Signal Type: **Simple**
- Minimum Angle: **3-5°**
- Cooldown Bars: **3-5 bars**
- Timeframes: 1m, 5m, 15m
**Swing Traders:**
- Signal Type: **Strict**
- Minimum Angle: **7-10°**
- Cooldown Bars: **8-12 bars**
- Timeframes: 1H, 4H, Daily
**Position Traders:**
- Signal Type: **Strict**
- Minimum Angle: **10-15°**
- Cooldown Bars: **15-20 bars**
- Timeframes: Daily, Weekly
### **Parameter Descriptions:**
**1. Source** (default: OHLC4)
- Price data used for MA calculations
- OHLC4 provides smoothest angles
- Close is more responsive but noisier
**2. Threshold for No-Trade Zones** (default: 2°)
- Angles below this are considered sideways/ranging
- Increase for stricter filtering of choppy markets
- Decrease to allow signals in quieter trending periods
**3. Signal Type** (Simple vs. Strict)
- **Simple:** Angle crossover OR (trend + momentum)
- **Strict:** Angle crossover AND all MAs aligned AND momentum confirmed
- Start with Simple, switch to Strict if too many false signals
**4. Minimum Angle for Signal** (default: 5°)
- Only generate signals when angle exceeds this threshold
- Higher values = stronger trends required
- Lower values = more sensitive to momentum changes
**5. Cooldown Bars** (default: 5)
- Minimum bars between consecutive signals
- Prevents spam during volatile chop
- Scale with your timeframe (higher TF = more bars)
**6. Color Bars** (default: true)
- Colors chart bars based on signal state
- Green = bullish conditions, Red = bearish conditions
- Can disable if you prefer clean price bars
**7. Background Colors**
- **Yellow background** = No-trade zone (low angle, ranging market)
- **Green flash** = BUY signal generated
- **Red flash** = SELL signal generated
- All customizable or can be disabled
---
## 📊 INTERPRETING THE INDICATOR
### **Visual Elements:**
**Main Chart Window:**
- **Thick Lime/Fuchsia Line** = MA27 angle (primary signal line)
- **Medium Green/Red Line** = MA83 angle (trend confirmation)
- **Thin Green/Red Line** = MA278 angle (slow trend filter)
- **Aqua/Orange Line** = JMA Fast (momentum detector)
- **Green/Red Area** = JMA slope (overall trend context)
- **Blue/Purple Histogram** = Momentum (angle acceleration/deceleration)
**Signal Arrows:**
- **Large Green ▲ "BUY"** = Primary buy signal (all conditions met)
- **Small Green ▲ "BUY+"** = Strong momentum buy (JMA fast cross)
- **Large Red ▼ "SELL"** = Primary sell signal (all conditions met)
- **Small Red ▼ "SELL+"** = Strong momentum sell (JMA fast cross)
**Status Table (Top Right):**
- **Angle:** Current MA27 angle in degrees
- **Trend:** Classification (STRONG UP/DOWN, UP/DOWN, FLAT)
- **Momentum:** Acceleration state (ACCEL UP/DN, Up/Down)
- **MAs:** Alignment status (ALL UP/DOWN, Mixed)
- **Zone:** Trading zone status (ACTIVE vs. NO TRADE)
- **Last:** Bars since last signal
### **Trading Strategies:**
**Strategy 1: Pure Signal Following**
- Enter LONG on BUY signal
- Exit on SELL signal
- Use stop-loss at recent swing low/high
- Works best on trending instruments
**Strategy 2: Confirmation with Price Action**
- Wait for BUY signal + bullish candlestick pattern
- Wait for SELL signal + bearish candlestick pattern
- Increases win rate by filtering premature signals
- Recommended for beginners
**Strategy 3: Momentum Acceleration**
- Use BUY+/SELL+ signals for adding to positions
- Only take these in direction of primary signal
- Scalp quick moves during momentum spikes
- For experienced traders
**Strategy 4: Mean Reversion in No-Trade Zones**
- When status shows "NO TRADE", fade extremes
- Wait for angle to exit no-trade zone for reversal
- Contrarian approach for range-bound markets
- Requires tight stops
---
## ⚠️ LIMITATIONS & DISCLAIMERS
**What This Indicator DOES:**
✅ Measures momentum direction and strength via angle analysis
✅ Generates signals when multiple conditions align
✅ Filters out low-conviction sideways markets
✅ Provides visual clarity on trend state
**What This Indicator DOES NOT:**
❌ Predict future price movements with certainty
❌ Guarantee profitable trades (no indicator can)
❌ Work equally well on all instruments/timeframes
❌ Replace proper risk management and position sizing
**Known Limitations:**
- **Lagging Nature:** Like all moving averages, signals occur after momentum begins
- **Whipsaw Risk:** Can generate false signals in volatile, directionless markets
- **Optimization Required:** Parameters need adjustment for different assets
- **Not a Complete System:** Should be combined with risk management, position sizing, and other analysis
**Best Performance Conditions:**
- Strong trending markets (crypto bull runs, stock breakouts)
- Liquid instruments (major forex pairs, large-cap stocks)
- Appropriate timeframe selection (match to trading style)
- Used alongside support/resistance and volume analysis
---
## 🔔 ALERT SETUP
The indicator includes four alert conditions:
**1. BUY SIGNAL**
- Message: "MA SMART Angle: BUY SIGNAL! Angle crossed up with momentum"
- Use for: Primary long entries
**2. SELL SIGNAL**
- Message: "MA SMART Angle: SELL SIGNAL! Angle crossed down with momentum"
- Use for: Primary short entries or long exits
**3. Strong BUY**
- Message: "MA SMART Angle: Strong BUY momentum - JMA fast crossed up"
- Use for: Adding to longs or aggressive entries
**4. Strong SELL**
- Message: "MA SMART Angle: Strong SELL momentum - JMA fast crossed down"
- Use for: Adding to shorts or aggressive exits
**Setting Up Alerts:**
1. Right-click indicator → "Add Alert on MA SMART Angle"
2. Select desired condition from dropdown
3. Choose notification method (popup, email, webhook)
4. Set alert expiration (typically "Once Per Bar Close")
---
## 📚 EDUCATIONAL VALUE
This indicator serves as an excellent learning tool for understanding:
**1. Angle-Based Momentum Analysis**
- Traditional indicators show MA crossovers
- This shows the *rate of change* (velocity) of MAs
- Teaches traders to think in terms of momentum acceleration
**2. Multi-Timeframe Confirmation**
- Shows how fast, medium, and slow MAs interact
- Demonstrates importance of trend alignment
- Helps develop patience for high-probability setups
**3. Signal Quality vs. Quantity Tradeoff**
- Simple mode = more signals, more noise
- Strict mode = fewer signals, higher quality
- Teaches discretionary filtering skills
**4. Market State Recognition**
- Visual distinction between trending and ranging markets
- Helps traders avoid trading choppy conditions
- Develops "market context" awareness
---
## 🔄 DIFFERENCES FROM OTHER MA INDICATORS
**vs. Traditional MA Crossovers:**
- Measures momentum (angle) rather than just price crossing MA
- Provides earlier signals as angles change before price crosses
- Filters better for sideways markets using no-trade zones
**vs. MACD:**
- Uses multiple MAs instead of just two
- ATR normalization makes it universal across instruments
- Visual angle representation more intuitive than histogram
**vs. Supertrend:**
- Not based on ATR bands but on MA slope analysis
- Provides graduated strength indication (not just binary trend)
- Less prone to whipsaw in low volatility
**vs. Original "MA Angles" by JD:**
- Adds explicit entry/exit signals (original had none)
- Implements no-repaint logic for reliability
- Includes signal filtering and quality controls
- Provides dual signal systems (Simple/Strict)
- Enhanced visualization and status monitoring
- Uses faster MA periods (3/8/13 vs 27/83/278) for modern markets
---
## 📖 CODE STRUCTURE (for Pine Script learners)
This indicator demonstrates:
**Advanced Pine Script Techniques:**
- Custom function implementation (JMA, angle calculation)
- Var declarations for stateful tracking
- Table creation for HUD display
- Multi-condition signal logic
- Alert system integration
- Proper use of historical references for no-repaint
**Code Organization:**
- Modular function definitions (JMA, angle)
- Clear separation of concerns (inputs, calculations, plotting, alerts)
- Extensive commenting for maintainability
- Best practices for Pine Script v5
**Learning Resources:**
- Study the JMA function to understand adaptive smoothing
- Examine angle calculation for ATR normalization technique
- Review signal logic for multi-condition confirmation patterns
- Analyze anti-spam filtering for state management
The code is open-source - feel free to study, modify, and improve upon it!
---
## 🙏 CREDITS & ATTRIBUTION
**Original Concepts:**
- **"ma angles - JD" by JD (Duyck)** - Core angle calculation methodology and indicator concept
Original open-source indicator on TradingView Community Scripts
- **JMA (Jurik Moving Average) implementation by Everget** - Smooth, low-lag moving average function
Acknowledged in original JD indicator code
- **Angle Calculation formula by KyJ** - Mathematical formula for converting MA slope to degrees using ATR normalization
Acknowledged in original JD indicator code comments
**Enhancements in This Version:**
- Signal generation logic - Original implementation for this indicator
- No-repaint confirmation system - Original implementation
- Dual signal modes (Simple/Strict) - Original implementation
- Visual enhancements and status table - Original implementation
- Alert system and signal filtering - Original implementation
- Modified MA periods (3/8/13 instead of 27/83/278) - Optimization for modern markets
**Open Source Philosophy:**
This indicator follows the open-source spirit of TradingView and the Pine Script community. The original "ma angles - JD" by JD (Duyck) was published as open-source, enabling this enhanced version. Similarly, this code is published as open-source to allow further community improvements.
---
## ⚡ QUICK START GUIDE
**For New Users:**
1. Add indicator to chart
2. Start with default settings (Simple mode)
3. Wait for BUY signal (green arrow)
4. Observe how price behaves after signal
5. Check status table to understand market state
6. Adjust parameters based on your instrument/timeframe
**For Experienced Traders:**
1. Switch to Strict mode for higher quality signals
2. Increase cooldown bars to reduce frequency
3. Raise minimum angle threshold for stronger trends
4. Combine with your existing strategy for confirmation
5. Set up alerts for desired signal types
6. Backtest on your preferred instruments
---
## 🎓 RECOMMENDED COMBINATIONS
**Works Well With:**
- **Volume Analysis:** Confirm signals with volume spikes
- **Support/Resistance:** Take signals near key levels
- **RSI/Stochastic:** Avoid overbought/oversold extremes
- **ATR:** Size positions based on volatility
- **Price Action:** Wait for candlestick confirmation
**Complementary Indicators:**
- Order Flow / Footprint (for institutional confirmation)
- Volume Profile (for identifying value areas)
- VWAP (for intraday mean reversion reference)
- Fibonacci Retracements (for target setting)
---
## 📈 PERFORMANCE EXPECTATIONS
**Realistic Win Rates:**
- Simple Mode: 45-55% (higher frequency, moderate accuracy)
- Strict Mode: 55-65% (lower frequency, higher accuracy)
- Combined with price action: 60-70%
**Best Asset Classes:**
1. **Cryptocurrencies** (strong trends, clear signals)
2. **Forex Major Pairs** (smooth price action, good angles)
3. **Large-Cap Stocks** (trending behavior, liquid)
4. **Index Futures** (trending instruments)
**Challenging Conditions:**
- Low volatility consolidation periods
- News-driven erratic movements
- Thin/illiquid instruments
- Counter-trending markets
---
## 🛡️ RISK DISCLAIMER
**IMPORTANT LEGAL NOTICE:**
This indicator is for **educational and informational purposes only**. It is **NOT financial advice** and does not constitute a recommendation to buy or sell any financial instrument.
**Trading Risks:**
- Trading carries substantial risk of loss
- Past performance does not guarantee future results
- No indicator can predict market movements with certainty
- You can lose more than your initial investment (especially with leverage)
**User Responsibilities:**
- Conduct your own research and due diligence
- Understand the instruments you trade
- Never risk more than you can afford to lose
- Use proper position sizing and risk management
- Consider consulting a licensed financial advisor
**Indicator Limitations:**
- Signals are based on historical data only
- No guarantee of accuracy or profitability
- Parameters must be optimized for your specific use case
- Results vary significantly by market conditions
By using this indicator, you acknowledge and accept all trading risks. The author is not responsible for any financial losses incurred through use of this indicator.
---
## 📧 SUPPORT & FEEDBACK
**Found a bug?** Please report it in the comments with:
- Chart symbol and timeframe
- Parameter settings used
- Description of unexpected behavior
- Screenshot if possible
**Have suggestions?** Share your ideas for improvements!
**Enjoying the indicator?** Leave a like and follow for updates!
ADR% / AWR% / AMR% / ATR / LoD Dist. TableThis is an updated script from ArmerSchlucker that includes AWR (average weekly range) and AMR (average monthly range) in the table when toggled to those timeframes
Trend Gazer v2English Follows;
---
# Trend Gazer v2 - マルチタイムフレーム トレーディング インジケータ
## 📊 概要
**Trend Gazer v2** は、**ボリューメトリックウェイテッドクラウド(VWC)**、**リバースRSIシグナル**、**ICTドンチアンスマートマネーストラクチャー**、**マルチタイムフレームボリンジャーバンド**、**EMA分析**を組み合わせた高度なトレーディングインジケータです。
**7種類のシグナルタイプ**と**4つの設定可能なフィルター**を搭載し、特にEMA塗りつぶし色遷移期間中のフィルタリング機能(**フィルター4**)により、トレンド変化時の偽シグナルを削減します。
---
## ✨ 主要機能
### v2の新機能: フィルター4 - EMA塗りつぶし遷移期間フィルター(デフォルト有効)
**フィルター4**は、EMA塗りつぶし色の遷移期間中に方向性バイアスを作成し、偽シグナルを削減します:
**動作ロジック:**
1. **すべて青 → 遷移開始(一部が赤に)→ BUYのみ表示 → すべて赤 OR 青に戻る(期間終了)**
- 遷移期間中はSELLシグナルをすべてブロック
2. **すべて赤 → 遷移開始(一部が青に)→ SELLのみ表示 → すべて青 OR 赤に戻る(期間終了)**
- 遷移期間中はBUYシグナルをすべてブロック
**終了条件:**
- 遷移が完了(すべて目標色になる)
- 元の色に戻る(遷移失敗)
**⭐ 特徴:** 他のフィルター(1,2,3)はシグナル1-5のみに適用されますが、**フィルター4はすべてのシグナル(S1-7)に適用**されます。これにより、トレンド変化時の一貫したフィルタリングを実現し、勝率向上に貢献します。
---
### 1. **複数シグナルタイプ(7種類)**
**シグナル1:** マーケットストラクチャーが強気(Bullish Structure) かつ リバースRSIが強気にシフト
**シグナル2:** (マーケットストラクチャーが強気 または リバースRSIが強気) かつ VWC UPシグナル検知
**シグナル3:** リバースRSIが強気 かつ マーケットストラクチャーが弱気から強気に変化(ストラクチャースイッチ)
**シグナル4:** マーケットストラクチャーが強気 かつ VWCシグナルがUP状態(初回のみ)
**シグナル5:** 15分足下部ボリンジャーバンドを上抜けた後、リバースRSI強気シグナル検知
**シグナル6:** 15分足下部BB または EMA50を上抜けた後、初回のリバースRSI強気シグナル(フィルター1,2,3をバイパス、フィルター4のみ適用)
**シグナル7:** マーケットストラクチャーが強気 かつ EMA20またはEMA50から上に反発後、最初のBUY検知(フィルター1,2,3をバイパス、フィルター4のみ適用)
*(SELLシグナルは逆ロジックに従う)*
---
### 2. **高度なフィルタリングシステム**
**フィルター1: RSI方向フィルター(デフォルト:ON) - シグナル1-5のみ**
- リバースRSIが強気 または マーケットストラクチャーが強気の時のみBUYを表示
- リバースRSIが弱気 または マーケットストラクチャーが弱気の時のみSELLを表示
- 強い方向性のある動きでの逆張りシグナルを防止
**フィルター2: EMA配列フィルター(デフォルト:ON) - シグナル1-5のみ**
- SELLシグナルはEMA配列が確認された時のみ表示:
- `ema20 > ema50 > ema100 > ema200`(強い下降トレンド)、または
- `ema20 < ema50 < ema100 < ema200`(強い上昇トレンド)
- レンジ相場での偽シグナルを削減
**フィルター3: ボリンジャーバンド方向フィルター(デフォルト:ON) - シグナル1-5のみ**
- 15分足上部BB かつ 60分足上部BBを下抜け後 → 15分足下部BBにタッチするまでSELLのみ表示
- 15分足下部BB かつ 60分足下部BBを上抜け後 → 15分足上部BBにタッチするまでBUYのみ表示
- 高確率エントリーのための方向バイアスゾーンを作成
**⭐ フィルター4: EMA塗りつぶし遷移期間フィルター(デフォルト:ON) - 全シグナル1-7に適用**
- すべてのEMA塗りつぶしが青から赤に遷移中 → BUYのみ表示(SELLブロック)
- すべてのEMA塗りつぶしが赤から青に遷移中 → SELLのみ表示(BUYブロック)
- 遷移が完了または元の色に戻ると期間終了
- トレンド変化時の偽シグナルを削減し、勝率向上に貢献
**注意:** シグナル6, 7はフィルター1,2,3をバイパスしますが、フィルター4は適用されます。
---
### 3. **マルチタイムフレームボリンジャーバンド**
- **15分足ボリンジャーバンド**(黒い点線): 短期ボラティリティゾーン
- **60分足ボリンジャーバンド**(黒/カスタマイズ可能): 長期サポート/レジスタンス
これらのバンドは以下を識別:
- **買われ過ぎ/売られ過ぎの状態**
- **ブレイクアウト確認**(シグナル5,6)
- **平均回帰の機会**
---
### 4. **7本の指数移動平均(EMA)**
- **EMA 7, 20, 50, 100, 200, 400, 800**
- EMA20-50間とEMA50-200間の動的**EMA塗りつぶし**でトレンドバイアスを色分け:
- **赤色塗りつぶし:** 弱気配列(ema20 > ema50 > ema200)
- **青色塗りつぶし:** 強気配列(ema20 < ema50 < ema200)
- EMAはシグナル7の反発検知のための動的サポート/レジスタンスとして機能
- **フィルター4はEMA塗りつぶし**の遷移を監視して方向性バイアスを作成
---
### 5. **ICTドンチアンスマートマネーストラクチャー**
- ローソク足の枠に色を付けてマーケットストラクチャーを可視化:
- **赤枠(Bullish Structure):** 強気ストラクチャー(買い手が優勢)
- **緑枠(Bearish Structure):** 弱気ストラクチャー(売り手が優勢)
- ドンチアンチャネルとピボットベースのストラクチャーブレイクに基づく
- シグナル1, 3, 4, 7の検知に不可欠
---
### 6. **リバースRSIシグナル**
- RSI計算を反転させてオシレーター値ではなく価格レベルを導出
- **RSIミッドラインのスーパートレンド**がトレンドシフトを判定:
- **強気シフト:** 上昇モメンタムの可能性
- **弱気シフト:** 下降モメンタムの可能性
- 半透明ラベル("Bullish"/"Bearish")として価格の上下に表示
---
### 7. **VWC(ボリューメトリックウェイテッドクラウド)トレンド検知器**
- 市場状況に応じて拡大/縮小する適応型ボラティリティベースバンド
- 価格がバンド内に入ると**UP/DOWNシグナル**を提供
- VWCステータステーブルには以下を表示:
- 現在のトレンド方向(BULLISH/BEARISH)
- EMA配列ステータス
- 最後に表示したシグナル(BUY/SELL)とシグナル以降のバー数
---
## 🎯 トレード戦略
### 推奨アプローチ
**1. トレンドフォロー(シグナル1, 2, 4)**
- 明確なマーケットストラクチャー(強気または弱気ストラクチャー)を待つ
- VWCトレンド + RSI方向 + ストラクチャー配列の合致でエントリー
- EMA塗りつぶしを動的ストップロスゾーンとして使用
**2. 反転トレード(シグナル5, 6, 7, 8)**
- **シグナル5,6**: ボリンジャーバンドブレイクアウトと反転を特定
- **シグナル7**: ストラクチャー確認を伴うEMA反発を探す
- **シグナル8**: **早期トレンド反転** - トレンド変化の最初期でエントリー
- これらのシグナルは特定フィルターをバイパスし早期エントリー機会を提供
**3. シグナル8 - 早期トレンド反転戦略 (v2新機能)**
**最適な使用ケース:**
- **上位時間軸(15分足〜1時間足)**: 主要なトレンド反転の捕捉に最も信頼性が高い
- **スイングトレード**: 数日間のポジションエントリーに最適
- **確認トレード**: 他のシグナルと組み合わせて高信頼度エントリー
**シグナル8のトレード方法:**
- **BUY(青→赤遷移)**:
- すべてのEMA塗りつぶしが青から赤に変化するのを監視
- エントリー: シグナル8 BUYラベルが出現した時
- ストップロス: 直近スイング安値またはEMA200の下
- 利確: 次のレジスタンスを目標、またはEMA50でトレーリングストップ
- **SELL(赤→青遷移)**:
- すべてのEMA塗りつぶしが赤から青に変化するのを監視
- エントリー: シグナル8 SELLラベルが出現した時
- ストップロス: 直近スイング高値またはEMA200の上
- 利確: 次のサポートを目標、またはEMA50でトレーリングストップ
**シグナル8の利点:**
- 他のシグナルより5-10バー早くトレンド反転を捕捉
- 新トレンド開始時の低リスクエントリー
- より高いリワード可能性(トレンド初期でのエントリー)
**シグナル8のリスク:**
- レンジ/不規則相場では偽シグナルを生成する可能性
- 上位時間軸での確認と組み合わせるのがベスト
- 早期エントリーのため、より大きなストップロスの使用を検討
---
### リスク管理
- **EMA20/EMA50**をトレーリングストップロスレベルとして使用
- シグナル8では:**EMA200**を主要トレンドストップロスとして使用
- 反対シグナルまたは主要EMAクロス時に決済
- 上位時間軸のトレンド確認と組み合わせ(60分足以上チャート)
- VWCステータステーブルが矛盾するシグナルを示す時は取引を避ける
### 推奨時間軸
- **シグナル8最適時間軸:** 15分足〜1時間足(早期トレンド反転用)
- **他のシグナル:** 1分足~15分足(スキャルピング/デイトレード)
- **上位時間軸:** 1時間足以上でも機能するがシグナル数は減少
- **補完的使用:** 4時間足/日足チャートで全体トレンド方向を確認
---
## 🔄 MTF OB & FVG Detectorとの統合トレード戦略
**Trend Gazer v2**と**MTF OB & FVG Detector**を組み合わせることで、機関投資家のオーダーフロー(OB)と市場の需給ギャップ(FVG)を活用した高度なトレーディング戦略を実現できます。
### 統合戦略の利点
**1. 最高確率エントリーポイントの特定**
- Trend GazerのBUY/SELLシグナル + OB/FVGゾーン = **最高確率エントリーポイント**
- 複数の時間足(5分、15分、60分)からのOB統合 + Trend Gazerシグナル = **機関投資家とトレンドの合致**
**2. 精密なエントリー価格の決定**
- Trend Gazerでトレンド方向と市場バイアスを確認
- OB/FVGゾーンで正確なエントリー価格を特定
- 不要なリスクを削減し、リワード比率を最大化
**3. 強化されたストップロス管理**
- EMA20/50(Trend Gazer)をトレーリングストップロスとして使用
- OBゾーン(MTF OB & FVG)を追加の防御ラインとして設定
- 多層防御によるリスク管理
---
### 推奨統合戦略
#### 戦略1: 高確率コンフルエンスエントリー 【最推奨】
**セットアップ:**
1. Trend Gazer v2でBUY/SELLシグナルを監視
2. MTF OB & FVG Detectorで統合OB/FVGゾーン(3つ以上の時間足)を特定
3. 両者が同じ価格ゾーンで一致するのを待つ
**エントリー条件(BUY例):**
- ✅ Trend Gazer: BUYシグナル発生(シグナル1-7のいずれか)
- ✅ MTF OB & FVG: ブリッシュOBゾーン(特に統合ゾーン)に価格がタッチ
- ✅ フィルター4(EMA遷移期間): 青→赤遷移中(BUYのみ期間)
- ✅ マーケットストラクチャー: 強気(赤枠)
- ✅ 高ボリューム: OBゾーンのボリュームパーセンテージが75%以上
**エントリー:**
- 価格がOBゾーン内でTrend GazerのBUYシグナルが点灯したバーの終値でエントリー
- または、次バーの始値でエントリー
**ストップロス:**
1. **初期SL**: OBゾーンの下端 - (5-10 pips/ポイント)
2. **代替SL**: EMA50の下(より広いSL、スイングトレード向け)
3. **タイトSL**: 直近安値 - (3-5 pips/ポイント)(スキャルピング向け)
**利確ターゲット:**
1. **T1(50%)**: 次の上位時間足ベアリッシュOB/FVGゾーン
2. **T2(30%)**: 60分足ボリンジャーバンド上限
3. **T3(20%)**: EMA20/50でトレーリング、逆シグナルまで保持
**SELL例は逆ロジック適用**
---
#### 戦略2: 精密反転エントリー【中級者向け】
**最適使用場面:**
- 強いトレンドの終了時
- 重要な統合OB/FVGゾーンでの反転
- 上位時間足のサポート/レジスタンスレベル
**エントリー条件(SELL例):**
1. **上位時間足確認:**
- 60分足でベアリッシュOB統合ゾーンを特定
- 価格が統合ゾーンに到達
2. **Trend Gazerシグナル:**
- **シグナル5**: 15分足上部BBを下抜け + リバースRSI弱気シフト、または
- **シグナル6**: 15分足上部BB/EMA50下抜け後の初回RSI弱気シグナル、または
- **シグナル7**: マーケットストラクチャー弱気 + EMA20/50からの下方反発
3. **OB/FVG確認:**
- 15分足または60分足のベアリッシュOBゾーンで反発確認
- FVGが上方に残っている(価格磁石効果)
**エントリー:**
- Trend Gazerシグナル + OBゾーン反発の両方確認後
- ローソク足パターン確認(ピンバー、エンガルフィング等)推奨
**ストップロス:**
- OBゾーン上端 + 10-15 pips/ポイント
- または60分足上部BBの上
**利確:**
- **T1**: 下位時間足ブリッシュOB/FVGゾーン(未充填FVG優先)
- **T2**: 15分足下部BB
- **T3**: 逆シグナルまたはEMA20/50タッチ
**BUY例は逆ロジック適用**
---
#### 戦略3: トレンドフォロー with OBサポート【初心者向け】
**シンプルなアプローチ:**
**BUY戦略:**
1. **トレンド確認(Trend Gazer):**
- EMA塗りつぶしが赤色(弱気配列)
- VWCステータスがBULLISH
- マーケットストラクチャーが強気(赤枠)
2. **押し目待ち:**
- 価格が下位時間足(5分または15分)のブリッシュOBゾーンまで調整
- Trend Gazerの**シグナル1, 2, または4**が発生
3. **エントリー:**
- OBゾーン内でBUYシグナル点灯時
- ローソク足の実体終値でエントリー
4. **ストップロス:**
- OBゾーン下端 - 10 pips/ポイント
5. **利確:**
- **簡易**: リスクの2倍(1:2 R:R)
- **動的**: 次のベアリッシュOBまたは逆シグナルまで
**SELL戦略は逆ロジック適用**
---
#### 戦略4: FVGフィリング with Trend Gazer確認【スキャルピング】
**短期トレーダー向け:**
**セットアップ:**
- 未充填のFVG(ブリッシュまたはベアリッシュ)を特定
- FVGが現在価格から離れている(最低20-30 pips/ポイント)
**BUY例(ブリッシュFVG下方):**
1. **FVG識別:**
- 下方に未充填のブリッシュFVG(オレンジボックス)
- 高ボリュームFVG優先(75%以上)
2. **Trend Gazer確認:**
- 価格がFVGに近づく
- マーケットストラクチャーが強気に転換
- **シグナル3, 4, または7**がFVGゾーン近辺で発生
3. **エントリー:**
- 価格がFVG内に入り、Trend GazerシグナルでFVGからの反発確認
- ローソク足の実体終値でエントリー
4. **ストップロス:**
- FVG下端 - 5-7 pips/ポイント(タイト)
5. **利確:**
- **T1(70%)**: FVG上端(ギャップ充填)
- **T2(30%)**: 次のレジスタンスまたは逆シグナル
**SELL例(ベアリッシュFVG上方)は逆ロジック適用**
---
### 統合使用のベストプラクティス
**1. チャート設定:**
- **メインチャート時間足**: 5分足または15分足
- **Trend Gazer v2**: すべてのシグナルとフィルター有効
- **MTF OB & FVG Detector**: 5分、15分、60分を有効化、統合機能ON
**2. アラート設定:**
- Trend Gazer: BUY/SELLシグナルアラート有効
- MTF OB & FVG: 反発アラート + 統合ゾーンアラート有効(Min 3 OBs)
- 両方のアラートが同時に鳴る = 最高確率エントリー
**3. 確認チェックリスト(エントリー前):**
- Trend GazerのBUY/SELLシグナル確認
- OB/FVGゾーンが価格に重なっている
- フィルター4が方向を支持(遷移期間中)
- マーケットストラクチャーが一致
- OB/FVGの高ボリューム確認(70%以上推奨)
- 上位時間足のトレンドが矛盾していない
- リスク:リワード比率が最低1:1.5以上
**4. リスク管理ルール:**
- 1トレードあたりの資金リスク: 口座残高の0.5-1%
- 同時ポジション: 最大2-3(相関性の低い銘柄のみ)
- 連続損失後: 3連敗後は休憩、戦略見直し
- 日次損失上限: 口座残高の2-3%
**5. 避けるべき状況:**
- ❌ Trend Gazerシグナルなしで、OB/FVGのみでエントリー
- ❌ 重要経済指標発表の直前/直後(ボラティリティスパイク)
- ❌ 複数フィルターが矛盾している時
- ❌ OB/FVGゾーンが既に複数回テストされている(弱体化)
- ❌ 流動性が低い時間帯(アジア早朝等)
---
### 統合戦略のパフォーマンス向上Tips
**1. 時間足の選択:**
- **スキャルピング**: 1分/3分足OB + 5分足Trend Gazerシグナル
- **デイトレード**: 5分/15分足OB + 15分足Trend Gazerシグナル
- **スイングトレード**: 15分/60分足OB + 60分足Trend Gazerシグナル
**2. 統合ゾーンの優先順位:**
- **最高優先**: 60分足OB統合(3つ以上)+ Trend Gazer Signal 6 or 7
- **高優先**: 15分足OB統合 + フィルター4遷移期間 + Signal 1-5
- **中優先**: 5分足OB + マーケットストラクチャー一致 + Signal 1-4
- **低優先**: 単一時間足OB + 基本シグナル(確認重視)
**3. バックテスト推奨:**
- 過去1-3ヶ月のデータで各戦略をテスト
- 勝率、平均R:R、最大ドローダウンを記録
- 自分のトレードスタイルに最適な組み合わせを発見
**4. 継続的改善:**
- トレード日誌を記録(スクリーンショット含む)
- 週次でパフォーマンスレビュー
- 有効な組み合わせパターンを文書化
- 市場環境の変化に応じて調整
---
### 統合戦略の実例
**実例1: 完璧なコンフルエンスBUY**
```
状況:
- 15分足チャート、EUR/USD
- 価格が60分足ブリッシュOB統合ゾーン(5分+15分+60分)にタッチ
- Trend Gazer Signal 6発生: 15分足下部BB上抜け後、初回RSI強気シグナル
- フィルター4: EMA塗りつぶし青→赤遷移中(BUYのみ期間)
- マーケットストラクチャー: 強気(赤枠)に転換
- OBボリューム: 82%(強い買い圧力)
エントリー: 1.0850(OBゾーン中央)
ストップロス: 1.0835(OBゾーン下端 - 5 pips)
利確T1: 1.0875(次の15分足ベアリッシュOB)- 達成
利確T2: 1.0895(60分足上部BB)- 達成
利確T3: 1.0920(EMA20トレーリング)- 逆シグナル手前で決済
結果: +70 pips、リスク15 pips = 4.67:1 R:R
```
**実例2: FVGフィリング with 反転確認SELL**
```
状況:
- 5分足チャート、GBP/JPY
- 上方に未充填ベアリッシュFVG(アクアボックス、15分足)
- 価格が急騰してFVGに到達
- Trend Gazer Signal 7発生: マーケットストラクチャー弱気 + EMA50からの下方反発
- リバースRSI: 弱気シフト
- FVGボリューム: 78%(強い売り圧力)
エントリー: 191.50(FVG上端での反発確認)
ストップロス: 191.75(FVG上端 + 25 pips)
利確T1: 191.00(FVG下端、ギャップ充填)- 達成
利確T2: 190.70(次のブリッシュOB)- 部分達成
結果: +50 pips(加重平均)、リスク25 pips = 2:1 R:R
```
---
### まとめ: なぜこの統合が強力なのか
**Trend Gazer v2の役割:**
- ✅ トレンド方向の確認(VWC、EMA、ストラクチャー)
- ✅ タイミングシグナル(7種類のエントリー機会)
- ✅ 複数フィルターによる偽シグナル削減
- ✅ 動的ストップロス管理(EMA、BB)
**MTF OB & FVG Detectorの役割:**
- ✅ 機関投資家のオーダーフロー可視化
- ✅ 正確な価格ゾーン特定(精密エントリー)
- ✅ 高確率サポート/レジスタンスレベル
- ✅ ボリューム分析による強度確認
**統合による相乗効果:**
- 🎯 **確率の掛け算**: 各インジケーター単独でも有効だが、両者の一致で確率が大幅向上
- 🎯 **リスク削減**: より精密なストップロス設定で損失を最小化
- 🎯 **リワード最大化**: 最適なエントリー価格で利益幅を拡大
- 🎯 **多様な戦略**: トレンドフォロー、反転、スキャルピング、スイング全てに対応
**推奨開始手順:**
1. デモ口座で戦略1(コンフルエンスエントリー)を2週間テスト
2. トレード日誌を記録し、パターンを学習
3. 小額リアル口座で同じ戦略を実践(最小ロット)
4. 自信がついたら戦略2, 3に拡張
5. 継続的にバックテストと改善を実施
この統合アプローチにより、市場の**需給ゾーン(OB/FVG)**と**トレンドモメンタム(Trend Gazer)**の両方を活用した、プロフェッショナルレベルのトレーディング戦略を実現できます。
---
## ⚙️ 入力パラメータ
### シグナル8設定 (v2新機能)
- **シグナル8を有効化: EMA塗りつぶし色遷移:** シグナル8のオン/オフ切り替え(デフォルト:OFF)
- **EMA傾きルックバック:** EMA傾き計算の期間(デフォルト:5、範囲:2-20)
- 低い値: より敏感、早期シグナル
- 高い値: より安定、偽シグナル減少
### シグナル表示設定
- **BUY/SELLラベルを表示:** メインエントリーシグナルの切り替え
- **RSIトレンドシフトラベルを表示:** Bullish/Bearish RSIシフトの表示
- **ラベルサイズ:** Small、Normal、Large、Huge
- **ラベル位置:** バー上またはATRでオフセット
### フィルター設定
- **RSI方向フィルターを有効化:** RSIトレンドでシグナルをフィルター(デフォルト:ON)
- **EMA配列フィルターを有効化:** SELLシグナルにEMA配列を要求(デフォルト:ON)
- **BB方向フィルターを有効化:** BBブレイクアウト後に方向バイアスゾーンを作成(デフォルト:ON)
### ビジュアル設定
- **ストラクチャーキャンドルを表示:** マーケットストラクチャーでキャンドルの枠に色付け
- **EMAを表示:** 7本の指数移動平均を表示
- **EMA塗りつぶしを表示:** 主要EMA間の色付き塗りつぶしを表示(シグナル8に重要)
- **15分足ボリンジャーバンドを表示:** 短期BBを表示
- **60分足ボリンジャーバンドを表示:** 長期BBを表示
- **VWCステータステーブル:** ステータステーブル表示の切り替え
---
## 🆕 v2の新機能
1. **シグナル8 - EMA塗りつぶし色遷移検知**
- 早期トレンド反転識別
- EMA傾きフラット化分析
- EMA収束パターン認識
- ATRを使用した正規化傾き計算
2. **強化されたツールチップドキュメント**
- すべてのシグナルが入力ツールチップに明確に文書化
- シグナル8の説明を含む
3. **改善されたアラートシステム**
- シグナル8 BUY/SELL用の新しいアラート
- EMA塗りつぶし色遷移専用アラート
4. **より優れた視覚的明瞭性**
- EMA塗りつぶしはシグナル8可視化に重要
- すべての塗りつぶしが色遷移している時が見やすい
---
## ⚠️ 免責事項
本インジケータは**教育および情報提供のみを目的**として提供されています。**金融アドバイスではありません**。
取引には多大な損失リスクが伴い、すべての投資家に適しているわけではありません。過去の実績は将来の結果を保証するものではありません。ユーザーは独自の調査を行い、取引決定を行う前に資格のある金融アドバイザーに相談することを検討してください。
作成者は本インジケータを使用して発生したいかなる損失についても責任を負いません。
---
## 📝 クレジット
- **リバースRSIシグナル:** AlgoAlphaのコンセプトに基づく
- **VWCトレンド検知器:** オリジナル実装
- **ICTドンチアンストラクチャー:** ICTコンセプトとドンチアンチャネルからインスピレーション
- **ボリンジャーバンド:** ジョン・ボリンジャー開発
- **EMA分析:** 標準的なテクニカル分析ツール
- **シグナル8 EMA遷移:** Trend Gazer v2のためのオリジナル実装
---
## 📜 ライセンス
このPine Script™コードは、https://mozilla.org/MPL/2.0/ の**Mozilla Public License 2.0**の条項に従います
---
## 🔔 アラート
インジケータには以下の内蔵アラート条件が含まれます:
- BUYシグナル(全8タイプ)
- SELLシグナル(全8タイプ)
- **新機能: シグナル8 EMA塗りつぶし色遷移アラート**
- リバースRSI強気/弱気シフト
- VWC UP/DOWNシグナル
TradingViewのアラート作成メニューからアラートを設定してください。
---
**バージョン:** 2.0
**プラットフォーム:** TradingView Pine Script™
**タイプ:** インジケータ(オーバーレイ)
---
## 🚀 最良の結果を得るためのヒント
1. **シグナルを組み合わせる:** シグナル8を他のシグナルと組み合わせて合致を確認
2. **シグナル8は上位時間軸で:** 15分足〜1時間足で最も信頼性が高い
3. **EMA塗りつぶしを使用:** シグナル8の遷移を見るためEMA塗りつぶしを表示
4. **マーケットストラクチャーを尊重:** 大きな時間軸のトレンドに逆らわない
5. **シグナル8をバックテスト:** 過去データでテストして動作を理解
6. **EMA傾きルックバックを調整:** トレードスタイルと時間軸に合わせて微調整
7. **テーブルを監視:** VWCステータステーブルで迅速なトレンド評価
8. **シグナル8 + ストラクチャー:** シグナル8がストラクチャー変化と一致する時に最良の結果
---
**ハッピートレーディング! 📊💹**
**v2アップグレード: シグナル8でトレンド反転をより早く捕捉!**
ーーー
# Trend Gazer v2 - Multi-Timeframe Trading Indicator
## 📊 Overview
**Trend Gazer v2** is an advanced trading indicator that combines **Volumetric Weighted Cloud (VWC)**, **Reverse RSI Signals**, **ICT Donchian Smart Money Structure**, **Multi-Timeframe Bollinger Bands**, and **EMA Analysis** for comprehensive market analysis.
**7 signal types** with **4 customizable filters**, featuring the **Filter 4 (EMA Fill Transition Period Filter)** which reduces false signals during trend changes by default.
---
## ✨ Key Features
### NEW in v2: Filter 4 - EMA Fill Transition Period Filter (Default ON)
**Filter 4** creates directional bias during EMA fill color transition periods to reduce false signals:
**Operation Logic:**
1. **ALL Blue → Transition Starts (some turn red) → BUY ONLY → ALL Red OR Back to Blue (period ends)**
- Blocks all SELL signals during transition period
2. **ALL Red → Transition Starts (some turn blue) → SELL ONLY → ALL Blue OR Back to Red (period ends)**
- Blocks all BUY signals during transition period
**Termination Conditions:**
- Transition completes (all fills become target color)
- Reverts to original color (transition fails)
**⭐ Key Feature:** While other filters (1,2,3) only apply to Signals 1-5, **Filter 4 applies to ALL signals (S1-7)**. This provides consistent filtering during trend changes and improves win rate.
---
### 1. **Multiple Signal Types (7 Types)**
**Signal 1:** Market Structure is Bullish (Bullish Structure) AND Reverse RSI shifts to Bullish
**Signal 2:** (Market Structure is Bullish OR Reverse RSI is Bullish) AND VWC UP signal detected
**Signal 3:** Reverse RSI is Bullish AND Market Structure changes from Bearish to Bullish (Structure Switch)
**Signal 4:** Market Structure is Bullish AND VWC Signal is in UP state (first time only)
**Signal 5:** Reverse RSI Bullish signal detected AFTER breaking above 15min Lower Bollinger Band
**Signal 6:** First Reverse RSI Bullish signal AFTER breaking above 15min Lower BB OR EMA50 (Bypasses Filter 1,2,3, Filter 4 still applies)
**Signal 7:** Market Structure is Bullish AND price bounces from EMA20 or EMA50, then first BUY detected (Bypasses Filter 1,2,3, Filter 4 still applies)
*(SELL signals follow inverse logic)*
---
### 2. **Advanced Filtering System**
**Filter 1: RSI Direction Filter (Default: ON) - Signals 1-5 Only**
- Only displays BUY when Reverse RSI is Bullish OR Market Structure is Bullish
- Only displays SELL when Reverse RSI is Bearish OR Market Structure is Bearish
- Prevents counter-trend signals in strong directional moves
**Filter 2: EMA Order Filter (Default: ON) - Signals 1-5 Only**
- SELL signals only appear when EMA alignment is confirmed:
- `ema20 > ema50 > ema100 > ema200` (Strong downtrend), OR
- `ema20 < ema50 < ema100 < ema200` (Strong uptrend)
- Reduces false signals during choppy/ranging markets
**Filter 3: Bollinger Band Direction Filter (Default: ON) - Signals 1-5 Only**
- After breaking below 15min Upper BB AND 60min Upper BB → Only SELL signals until touching 15min Lower BB
- After breaking above 15min Lower BB AND 60min Lower BB → Only BUY signals until touching 15min Upper BB
- Creates directional bias zones for high-probability entries
**⭐ Filter 4: EMA Fill Transition Period Filter (Default: ON) - ALL Signals 1-7**
- During ALL EMA fills transitioning blue→red → Show BUY only (block SELL)
- During ALL EMA fills transitioning red→blue → Show SELL only (block BUY)
- Period ends when transition completes OR reverts to original color
- Reduces false signals during trend changes and improves win rate
**Note:** Signals 6, 7 bypass Filters 1,2,3 but Filter 4 still applies.
---
### 3. **Multi-Timeframe Bollinger Bands**
- **15-Minute Bollinger Bands** (Black dotted lines): Short-term volatility zones
- **60-Minute Bollinger Bands** (Black/customizable): Longer-term support/resistance
These bands identify:
- **Overbought/Oversold Conditions**
- **Breakout Confirmations** (Signal 5 & 6)
- **Mean Reversion Opportunities**
---
### 4. **7 Exponential Moving Averages (EMA)**
- **EMA 7, 20, 50, 100, 200, 400, 800**
- Dynamic **EMA Fills** between EMA20-50 and EMA50-200 with color-coded trend bias:
- **Red Fill:** Bearish alignment (ema20 > ema50 > ema200)
- **Blue Fill:** Bullish alignment (ema20 < ema50 < ema200)
- EMAs act as dynamic support/resistance for Signal 7 bounce detection
- **Filter 4 monitors EMA fills** to create directional bias during transitions
---
### 5. **ICT Donchian Smart Money Structure**
- Colors candle borders to visualize market structure:
- **RED Border (Bullish Structure):** Bullish structure (buyers in control)
- **GREEN Border (Bearish Structure):** Bearish structure (sellers in control)
- Based on Donchian channels and pivot-based structure breaks
- Critical for Signal 1, 3, 4, and 7 detection
---
### 6. **Reverse RSI Signals**
- Inverts RSI calculations to derive price levels rather than oscillator values
- **Supertrend on RSI Midline** determines trend shifts:
- **Bullish Shift:** Potential upward momentum
- **Bearish Shift:** Potential downward momentum
- Displayed as semi-transparent labels ("Bullish"/"Bearish") above/below price
---
### 7. **VWC (Volumetric Weighted Cloud) Trend Detector**
- Adaptive volatility-based bands that expand/contract with market conditions
- Provides **UP/DOWN signals** when price enters the bands
- VWC Status Table displays:
- Current trend direction (BULLISH/BEARISH)
- EMA alignment status
- Last displayed signal (BUY/SELL) and bars since signal
---
## 🎯 Trading Strategy
### Recommended Approach
**1. Trend Following (Signals 1, 2, 4)**
- Wait for clear market structure (Bullish or Bearish Structure)
- Enter on confluence of VWC trend + RSI direction + Structure alignment
- Use EMA fills as dynamic stop-loss zones
**2. Reversal Trading (Signals 5, 6, 7, 8)**
- **Signal 5 & 6**: Identify Bollinger Band breakouts and reversals
- **Signal 7**: Look for EMA bounces with structure confirmation
- **Signal 8**: **EARLY TREND REVERSAL** - Enter at the very beginning of trend changes
- These signals bypass certain filters for early entry opportunities
**3. Signal 8 - Early Trend Reversal Strategy (NEW in v2)**
**Best Use Cases:**
- **Higher Timeframes (15m-1H)**: Most reliable for catching major trend reversals
- **Swing Trading**: Perfect for multi-day position entries
- **Confirmation Trading**: Use with other signals for high-confidence entries
**How to Trade Signal 8:**
- **BUY (Blue→Red transition)**:
- Watch for all EMA fills turning from blue to red
- Entry: When Signal 8 BUY label appears
- Stop Loss: Below recent swing low or EMA200
- Take Profit: Target next resistance or use trailing stop with EMA50
- **SELL (Red→Blue transition)**:
- Watch for all EMA fills turning from red to blue
- Entry: When Signal 8 SELL label appears
- Stop Loss: Above recent swing high or EMA200
- Take Profit: Target next support or use trailing stop with EMA50
**Signal 8 Advantages:**
- Catches trend reversals 5-10 bars BEFORE other signals
- Lower risk entry at the start of new trends
- Higher reward potential (entering at trend inception)
**Signal 8 Risks:**
- May produce false signals in choppy/ranging markets
- Best combined with higher timeframe confirmation
- Consider using larger stop losses due to early entry
---
### Risk Management
- Use **EMA20/EMA50** as trailing stop-loss levels
- For Signal 8: Use **EMA200** as major trend stop-loss
- Exit on opposite signal or when price crosses major EMA
- Combine with higher timeframe trend confirmation (60min+ chart)
- Avoid trading when VWC Status Table shows conflicting signals
### Timeframe Recommendations
- **Signal 8 Best Timeframes:** 15min to 1H (for early trend reversal)
- **Other Signals:** 1-minute to 15-minute charts (scalping/day trading)
- **Higher timeframes:** Works on 1H+ but may produce fewer signals
- **Complementary:** Use 4H/Daily chart for overall trend direction
---
## 🔄 Integrated Trading Strategy with MTF OB & FVG Detector
Combining **Trend Gazer v2** with **MTF OB & FVG Detector** creates a powerful trading approach that leverages institutional order flow (OB) and market supply-demand imbalances (FVG) alongside trend momentum.
### Benefits of Integration
**1. Highest Probability Entry Points**
- Trend Gazer BUY/SELL signals + OB/FVG zones = **Highest probability entry points**
- Multi-timeframe OB confluence (5m, 15m, 60m) + Trend Gazer signals = **Institutional + trend alignment**
**2. Precise Entry Price Determination**
- Trend Gazer confirms trend direction and market bias
- OB/FVG zones pinpoint exact entry prices
- Reduces unnecessary risk and maximizes reward ratios
**3. Enhanced Stop Loss Management**
- Use EMA20/50 (Trend Gazer) as trailing stop loss levels
- Set OB zones (MTF OB & FVG) as additional defensive lines
- Multi-layer risk protection
---
### Recommended Integration Strategies
#### Strategy 1: High-Probability Confluence Entry 【MOST RECOMMENDED】
**Setup:**
1. Monitor Trend Gazer v2 for BUY/SELL signals
2. Identify combined OB/FVG zones (3+ timeframes) on MTF OB & FVG Detector
3. Wait for both to align at the same price zone
**Entry Conditions (BUY example):**
- ✅ Trend Gazer: BUY signal triggered (any Signal 1-7)
- ✅ MTF OB & FVG: Price touches Bullish OB zone (especially combined zones)
- ✅ Filter 4 (EMA Transition Period): Blue→Red transition active (BUY-only period)
- ✅ Market Structure: Bullish (red border)
- ✅ High Volume: OB zone volume percentage ≥75%
**Entry:**
- Enter at close of bar when Trend Gazer BUY signal appears within OB zone
- Or enter at open of next bar
**Stop Loss:**
1. **Initial SL**: OB zone lower edge - (5-10 pips/points)
2. **Alternative SL**: Below EMA50 (wider SL, for swing trades)
3. **Tight SL**: Below recent low - (3-5 pips/points) (for scalping)
**Take Profit Targets:**
1. **T1 (50%)**: Next higher timeframe Bearish OB/FVG zone
2. **T2 (30%)**: 60min Bollinger Band upper limit
3. **T3 (20%)**: Trail with EMA20/50, hold until opposite signal
**SELL example follows inverse logic**
---
#### Strategy 2: Precise Reversal Entry 【INTERMEDIATE】
**Best Use Cases:**
- End of strong trends
- Reversals at significant combined OB/FVG zones
- Higher timeframe support/resistance levels
**Entry Conditions (SELL example):**
1. **Higher Timeframe Confirmation:**
- Identify Bearish OB confluence zone on 60min chart
- Price reaches confluence zone
2. **Trend Gazer Signals:**
- **Signal 5**: Break below 15min upper BB + Reverse RSI bearish shift, OR
- **Signal 6**: First RSI bearish signal after breaking 15min upper BB/EMA50, OR
- **Signal 7**: Market Structure bearish + bounce down from EMA20/50
3. **OB/FVG Confirmation:**
- Confirm bounce at 15min or 60min Bearish OB zone
- FVG remains above (price magnet effect)
**Entry:**
- Enter after confirming both Trend Gazer signal + OB zone bounce
- Candlestick pattern confirmation recommended (pin bar, engulfing, etc.)
**Stop Loss:**
- Above OB zone upper edge + 10-15 pips/points
- Or above 60min upper BB
**Take Profit:**
- **T1**: Lower timeframe Bullish OB/FVG zone (unfilled FVG preferred)
- **T2**: 15min lower BB
- **T3**: Until opposite signal or EMA20/50 touch
**BUY example follows inverse logic**
---
#### Strategy 3: Trend Following with OB Support 【BEGINNER-FRIENDLY】
**Simple Approach:**
**BUY Strategy:**
1. **Trend Confirmation (Trend Gazer):**
- EMA fills are red (bullish alignment)
- VWC Status shows BULLISH
- Market Structure is Bullish (red border)
2. **Wait for Pullback:**
- Price retraces to lower timeframe (5m or 15m) Bullish OB zone
- Trend Gazer **Signal 1, 2, or 4** triggers
3. **Entry:**
- Enter when BUY signal appears within OB zone
- Enter at candle body close
4. **Stop Loss:**
- Below OB zone lower edge - 10 pips/points
5. **Take Profit:**
- **Simple**: 2x risk (1:2 R:R)
- **Dynamic**: Until next Bearish OB or opposite signal
**SELL Strategy follows inverse logic**
---
#### Strategy 4: FVG Filling with Trend Gazer Confirmation 【SCALPING】
**For Short-Term Traders:**
**Setup:**
- Identify unfilled FVG (Bullish or Bearish)
- FVG should be away from current price (minimum 20-30 pips/points)
**BUY Example (Bullish FVG below):**
1. **FVG Identification:**
- Unfilled Bullish FVG below current price (Orange box)
- Prefer high-volume FVG (75%+)
2. **Trend Gazer Confirmation:**
- Price approaches FVG
- Market Structure turns Bullish
- **Signal 3, 4, or 7** triggers near FVG zone
3. **Entry:**
- Price enters FVG and Trend Gazer signal confirms bounce from FVG
- Enter at candle body close
4. **Stop Loss:**
- Below FVG lower edge - 5-7 pips/points (tight)
5. **Take Profit:**
- **T1 (70%)**: FVG upper edge (gap fill)
- **T2 (30%)**: Next resistance or opposite signal
**SELL Example (Bearish FVG above) follows inverse logic**
---
### Best Practices for Integrated Usage
**1. Chart Setup:**
- **Main Chart Timeframe**: 5min or 15min
- **Trend Gazer v2**: All signals and filters enabled
- **MTF OB & FVG Detector**: Enable 5m, 15m, 60m; Combine Overlapping OBs = ON
**2. Alert Configuration:**
- Trend Gazer: BUY/SELL signal alerts enabled
- MTF OB & FVG: Bounce alerts + Combined Zone alerts enabled (Min 3 OBs)
- Both alerts firing simultaneously = Highest probability entry
**3. Pre-Entry Checklist:**
- Trend Gazer BUY/SELL signal confirmed
- OB/FVG zone overlaps with price
- Filter 4 supports direction (during transition period)
- Market Structure aligns
- OB/FVG high volume confirmed (70%+ recommended)
- Higher timeframe trend doesn't conflict
- Risk:Reward ratio minimum 1:1.5
**4. Risk Management Rules:**
- Risk per trade: 0.5-1% of account balance
- Concurrent positions: Maximum 2-3 (low-correlation pairs only)
- After consecutive losses: Pause after 3 losses, review strategy
- Daily loss limit: 2-3% of account balance
**5. Situations to Avoid:**
- ❌ Entering with OB/FVG alone, without Trend Gazer signal
- ❌ Immediately before/after major economic releases (volatility spikes)
- ❌ When multiple filters contradict each other
- ❌ OB/FVG zones tested multiple times (weakened)
- ❌ Low liquidity periods (Asian early morning, etc.)
---
### Performance Enhancement Tips
**1. Timeframe Selection:**
- **Scalping**: 1m/3m OB + 5m Trend Gazer signals
- **Day Trading**: 5m/15m OB + 15m Trend Gazer signals
- **Swing Trading**: 15m/60m OB + 60m Trend Gazer signals
**2. Confluence Zone Priority:**
- **Highest**: 60min OB confluence (3+) + Trend Gazer Signal 6 or 7
- **High**: 15min OB confluence + Filter 4 transition period + Signal 1-5
- **Medium**: 5min OB + Market Structure alignment + Signal 1-4
- **Low**: Single timeframe OB + basic signal (require more confirmation)
**3. Backtesting Recommended:**
- Test each strategy on 1-3 months of historical data
- Record win rate, average R:R, maximum drawdown
- Discover optimal combinations for your trading style
**4. Continuous Improvement:**
- Keep trade journal (with screenshots)
- Weekly performance review
- Document effective combination patterns
- Adjust to changing market conditions
---
### Real-World Examples
**Example 1: Perfect Confluence BUY**
```
Situation:
- 15min chart, EUR/USD
- Price touches 60min Bullish OB confluence zone (5m+15m+60m)
- Trend Gazer Signal 6: First RSI bullish signal after 15min lower BB breakout
- Filter 4: EMA fills transitioning blue→red (BUY-only period)
- Market Structure: Turns Bullish (red border)
- OB Volume: 82% (strong buying pressure)
Entry: 1.0850 (OB zone middle)
Stop Loss: 1.0835 (OB zone lower edge - 5 pips)
Take Profit T1: 1.0875 (Next 15min Bearish OB) - Hit
Take Profit T2: 1.0895 (60min upper BB) - Hit
Take Profit T3: 1.0920 (EMA20 trailing) - Closed before opposite signal
Result: +70 pips, Risk 15 pips = 4.67:1 R:R
```
**Example 2: FVG Filling with Reversal Confirmation SELL**
```
Situation:
- 5min chart, GBP/JPY
- Unfilled Bearish FVG above (Aqua box, 15min)
- Price surges to reach FVG
- Trend Gazer Signal 7: Market Structure bearish + downward bounce from EMA50
- Reverse RSI: Bearish shift
- FVG Volume: 78% (strong selling pressure)
Entry: 191.50 (bounce confirmed at FVG upper edge)
Stop Loss: 191.75 (FVG upper edge + 25 pips)
Take Profit T1: 191.00 (FVG lower edge, gap fill) - Hit
Take Profit T2: 190.70 (Next Bullish OB) - Partially hit
Result: +50 pips (weighted average), Risk 25 pips = 2:1 R:R
```
---
### Summary: Why This Integration is Powerful
**Trend Gazer v2's Role:**
- ✅ Trend direction confirmation (VWC, EMA, Structure)
- ✅ Timing signals (7 types of entry opportunities)
- ✅ Multiple filters reduce false signals
- ✅ Dynamic stop loss management (EMA, BB)
**MTF OB & FVG Detector's Role:**
- ✅ Institutional order flow visualization
- ✅ Precise price zone identification (exact entries)
- ✅ High-probability support/resistance levels
- ✅ Volume analysis for zone strength confirmation
**Synergy from Integration:**
- 🎯 **Probability Multiplication**: Each indicator is effective alone, but alignment dramatically increases probability
- 🎯 **Risk Reduction**: More precise stop loss placement minimizes losses
- 🎯 **Reward Maximization**: Optimal entry prices expand profit potential
- 🎯 **Strategy Diversity**: Applicable to trend-following, reversals, scalping, and swing trading
**Recommended Getting Started:**
1. Test Strategy 1 (Confluence Entry) on demo account for 2 weeks
2. Keep trade journal and learn patterns
3. Practice same strategy on small real account (minimum lot)
4. Expand to Strategies 2, 3 as confidence grows
5. Continuously backtest and improve
This integrated approach enables professional-level trading strategies that combine market **supply-demand zones (OB/FVG)** with **trend momentum (Trend Gazer)**.
---
## ⚙️ Input Parameters
### Signal 8 Settings (NEW in v2)
- **Enable Signal 8: EMA Fill Color Transition:** Toggle Signal 8 on/off (Default: OFF)
- **EMA Slope Lookback:** Period for EMA slope calculation (Default: 5, Range: 2-20)
- Lower values: More sensitive, earlier signals
- Higher values: More stable, fewer false signals
### Signal Display Settings
- **Show BUY/SELL Labels:** Toggle main entry signals
- **Show RSI Trend Shift Labels:** Display Bullish/Bearish RSI shifts
- **Label Size:** Small, Normal, Large, Huge
- **Label Position:** On bar or offset by ATR
### Filter Settings
- **Enable RSI Direction Filter:** Filter signals by RSI trend (Default: ON)
- **Enable EMA Order Filter:** Require EMA alignment for SELL signals (Default: ON)
- **Enable BB Direction Filter:** Create directional bias zones after BB breakouts (Default: ON)
### Visual Settings
- **Show Structure Candles:** Color candle borders by market structure
- **Show EMAs:** Display 7 exponential moving averages
- **Show EMA Fills:** Display colored fills between key EMAs (critical for Signal 8)
- **Show 15min Bollinger Bands:** Display short-term BB
- **Show 60min Bollinger Bands:** Display longer-term BB
- **VWC Status Table:** Toggle status table display
---
## 🆕 What's New in v2
1. **Signal 8 - EMA Fill Color Transition Detection**
- Early trend reversal identification
- EMA slope flattening analysis
- EMA convergence pattern recognition
- Normalized slope calculation using ATR
2. **Enhanced Tooltip Documentation**
- All signals now clearly documented in input tooltips
- Signal 8 explanation included
3. **Improved Alert System**
- New alerts for Signal 8 BUY/SELL
- Dedicated alert for EMA fill color transitions
4. **Better Visual Clarity**
- EMA fills now critical for Signal 8 visualization
- Easy to see when all fills are transitioning colors
---
## ⚠️ Disclaimer
This indicator is provided for **educational and informational purposes only**. It is **not financial advice**.
Trading involves substantial risk of loss and is not suitable for all investors. Past performance does not guarantee future results. Users should conduct their own research and consider consulting with a qualified financial advisor before making any trading decisions.
The author is not responsible for any losses incurred using this indicator.
---
## 📝 Credits
- **Reverse RSI Signals:** Based on concepts by AlgoAlpha
- **VWC Trend Detector:** Original implementation
- **ICT Donchian Structure:** Inspired by ICT concepts and Donchian channels
- **Bollinger Bands:** Developed by John Bollinger
- **EMA Analysis:** Standard technical analysis tool
- **Signal 8 EMA Transition:** Original implementation for Trend Gazer v2
---
## 📜 License
This Pine Script™ code is subject to the terms of the **Mozilla Public License 2.0** at mozilla.org
---
## 🔔 Alerts
The indicator includes built-in alert conditions for:
- BUY signals (all 8 types)
- SELL signals (all 8 types)
- **NEW: Signal 8 EMA Fill Color Transition alerts**
- Reverse RSI Bullish/Bearish shifts
- VWC UP/DOWN signals
Configure alerts via TradingView's alert creation menu.
---
**Version:** 2.0
**Platform:** TradingView Pine Script™
**Type:** Indicator (Overlay)
---
## 🚀 Tips for Best Results
1. **Combine Signals:** Use Signal 8 with other signals for confluence
2. **Signal 8 on Higher TF:** Most reliable on 15m-1H timeframes
3. **Use EMA Fills:** Keep EMA fills visible to see Signal 8 transitions
4. **Respect Market Structure:** Don't fight the trend on larger timeframes
5. **Backtest Signal 8:** Test on historical data to understand its behavior
6. **Adjust EMA Slope Lookback:** Fine-tune for your trading style and timeframe
7. **Watch the Table:** The VWC Status Table provides quick trend assessment
8. **Signal 8 + Structure:** Best results when Signal 8 aligns with Structure change
---
**Happy Trading! 📊💹**
**v2 Upgrade: Catch trend reversals EARLIER with Signal 8!**
dhruv private 91400//@version=5
//
VERSION = '7.9-X'// 2024.3.20
strategy(
'LE VAN DO® - Swing Signals & Overlays Private™ 7.9-X',
shorttitle = 'LE VAN DO® - Swing Signals & Overlays Private™ 7.9-X' + VERSION,
overlay = true,
explicit_plot_zorder = true,
pyramiding = 0,
default_qty_type = strategy.percent_of_equity,
default_qty_value = 50,
calc_on_every_tick = false,
process_orders_on_close = true,
max_bars_back = 500,
initial_capital = 5000,
commission_type = strategy.commission.percent,
commission_value = 0.02,
max_lines_count = 500
)
//Truncate Function
truncate(number, decimals) =>
factor = math.pow(10, decimals)
int(number * factor) / factor
//
// === INPUTS ===
TPSType = input.string('Trailing', 'What TPS should be taken : ', options = )
setupType = input.string('Open/Close', title='What Trading Setup should be taken : ', options= )
scolor = input(true, title='Show coloured Bars to indicate Trend?')
almaRibbon = input(false, title='Enable Ribbon?')
//tradeType = input.string('BOTH', title='What trades should be taken : ', options= )
// === /INPUTS ===
// Display the probabilities in a table
//text01_ = str.tostring(timeframe.multiplier * intRes, '####')
//t = timenow + math.round(ta.change(time) * 25)
//var label lab01 = na
//label.delete(lab01)
//lab01 := label.new(t, close, text=text01_, style=label.style_label_left, yloc=yloc.price, xloc=xloc.bar_time, textalign=text.align_left, textcolor=color.white)
// Constants colours that include fully non-transparent option.
green100 = #008000FF
lime100 = #66bb6a
red100 = #f7525f
blue100 = #0000FFFF
aqua100 = #00FFFFFF
darkred100 = #8B0000FF
gray100 = #808080FF
/////////////////////////////////////////////
// Create non-repainting security function
rp_security(_symbol, _res, _src) =>
request.security(_symbol, _res, _src )
//
f_tfInMinutes() =>
_tfInMinutes = timeframe.period == '1' ? '3' : timeframe.period == '3' ? '5' : timeframe.period == '5' ? '15' : timeframe.period == '15' ? '30' : timeframe.period == '30' ? '60' : timeframe.period == '60' ? '240' : 'D'
_tfInMinutes
my_time1 = f_tfInMinutes()
tfmult = 18 //input.int(18, "Input Timeframe Multiplier")
f_resInMinutes() =>
_resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60. :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 1440. :
timeframe.isweekly ? 10080. :
timeframe.ismonthly ? 43800. : na)
my_time = str.tostring(f_resInMinutes()*tfmult)
useSource = close //input.string('Close', 'What Source to be used?', options = )
enableFilter = input(true, "Enable Backtesting Range Filtering")
fromDate = input.time(timestamp("01 Jan 2023 00:00 +0300"), "Start Date")
toDate = input.time(timestamp("31 Dec 2099 00:00 +0300"), "End Date")
tradeDateIsAllowed = not enableFilter or (time >= fromDate and time <= toDate)
filter1 = 'Filter with Atr'
filter2 = 'Filter with RSI'
filter3 = 'Atr or RSI'
filter4 = 'Atr and RSI'
filter5 = 'No Filtering'
filter6 = 'Entry Only in sideways market(By ATR or RSI)'
filter7 = 'Entry Only in sideways market(By ATR and RSI)'
typefilter = input.string(filter5, title='Sideways Filtering Input', options= , group='Strategy Options')
RSI = truncate(ta.rsi(close, input.int(7, group='RSI Filterring')), 2)
toplimitrsi = input.int(45, title='TOP Limit', group='RSI Filterring')
botlimitrsi = input.int(10, title='BOT Limit', group='RSI Filterring')
//ST = input.bool(true, title='Show Supertrend?', group='Supertrend Indicator')
//period = input.int(1440, group='Supertrend Indicator')
//mult = input.float(2.612, group='Supertrend Indicator')
atrfiltLen = 5 //input.int(5, minval=1, title='atr Length', group='Sideways Filtering Input')
atrMaType = 'EMA' //input.string('EMA', options= , group='Sideways Filtering Input', title='atr Moving Average Type')
atrMaLen = 5 //input.int(5, minval=1, title='atr MA Length', group='Sideways Filtering Input')
//filtering
atra = request.security(syminfo.tickerid, '', ta.atr(atrfiltLen))
atrMa = atrMaType == 'EM' ? ta.ema(atra, atrMaLen) : ta.sma(atra, atrMaLen)
updm = ta.change(high)
downdm = -ta.change(low)
plusdm = na(updm) ? na : updm > downdm and updm > 0 ? updm : 0
minusdm = na(downdm) ? na : downdm > updm and downdm > 0 ? downdm : 0
cndSidwayss1 = atra >= atrMa
cndSidwayss2 = RSI > toplimitrsi or RSI < botlimitrsi
cndSidways = cndSidwayss1 or cndSidwayss2
cndSidways1 = cndSidwayss1 and cndSidwayss2
Sidwayss1 = atra <= atrMa
Sidwayss2 = RSI < toplimitrsi and RSI > botlimitrsi
Sidways = Sidwayss1 or Sidwayss2
Sidways1 = Sidwayss1 and Sidwayss2
trendType = typefilter == filter1 ? cndSidwayss1 : typefilter == filter2 ? cndSidwayss2 : typefilter == filter3 ? cndSidways : typefilter == filter4 ? cndSidways1 : typefilter == filter5 ? RSI > 0 : typefilter == filter6 ? Sidways : typefilter == filter7 ? Sidways1 : na
// === /INPUTS ===
tf = my_time //input('15')
r = ticker.heikinashi(syminfo.tickerid)
openSeriesAlt = request.security(r, tf, open, lookahead=barmerge.lookahead_on)
closeSeriesAlt = request.security(r, tf, close, lookahead=barmerge.lookahead_on)
//openP = plot(almaRibbon ? openSeriesAlt : na, color=color.new(color.lime, 0), linewidth=3)
//closeP = plot(almaRibbon ? closeSeriesAlt : na, color=color.new(color.red, 0), linewidth=3)
BUYOC = ta.crossover(closeSeriesAlt, openSeriesAlt) and setupType == "Open/Close" and trendType
SELLOC = ta.crossunder(closeSeriesAlt, openSeriesAlt) and setupType == "Open/Close" and trendType
//strategy.entry('sell', direction=strategy.short, qty=trade_size, comment='sell', when=sel_entry)
//strategy.entry('buy', direction=strategy.long, qty=trade_size, comment='buy', when=buy_entry)
//trendColour = closeSeriesAlt > openSeriesAlt ? color.green : color.red
//bcolour = closeSeriesAlt > openSeriesAlt ? lime100 : red100
//barcolor(scolor ? bcolour : na, title='Bar Colours')
//closeP = plot(almaRibbon ? closeSeriesAlt : na, title='Close Series', color=color.new(trendColour, 20), linewidth=2, style=plot.style_line)
//openP = plot(almaRibbon ? openSeriesAlt : na, title='Open Series', color=color.new(trendColour, 20), linewidth=2, style=plot.style_line)
//fill(closeP, openP, color=color.new(trendColour, 80))
//
//rt = input(true, title="ATR Based REnko is the Default, UnCheck to use Traditional ATR?")
atrLen = 3 //input.int(3, title="RENKO_ATR", group = "Renko Settings")
isATR = true //input.bool(true, title="RENKO_USE_RENKO_ATR", group = "Renko Settings")
tradLen1 = 1000 //input.int(1000, title="RENKO_TRADITIONAL", group = "Renko Settings")
//Code to be implemented in V2
//mul = input(1, "Number Of minticks")
//value = mul * syminfo.mintick
tradLen = tradLen1 * 1
param = isATR ? ticker.renko(syminfo.tickerid, "ATR", atrLen) : ticker.renko(syminfo.tickerid, "Traditional", tradLen)
renko_close = request.security(param, my_time, close, lookahead=barmerge.lookahead_on)
renko_open = request.security(param, my_time, open, lookahead=barmerge.lookahead_on)
//============================================
//Sniper------------------------------------------------------------------------------------------------------------------------------------- // Signal 2
//============================================
//============================================
//EMA_CROSS-------------------------------------------------------------------------------------------------------------------------------- // Signal 4
//============================================
EMA1_length=input.int(2, "EMA1_length", group = "Renko Settings")
EMA2_length=input.int(10, "EMA2_length", group = "Renko Settings")
a = ta.ema(renko_close, EMA1_length)
b = ta.ema(renko_close, EMA2_length)
//BUY = ta.cross(a, b) and a > b and renko_open < renko_close
//SELL = ta.cross(a, b) and a < b and renko_close < renko_open
///////////////////////////////
// Determine long and short conditions
BUYR = ta.crossover(a, b) and setupType == "Renko" and trendType
SELLR = ta.crossunder(a, b) and setupType == "Renko" and trendType
sel_color = setupType == "Open/Close" ? closeSeriesAlt < openSeriesAlt : setupType == "Renko" ? renko_close < renko_open : na
buy_color = setupType == "Open/Close" ? closeSeriesAlt > openSeriesAlt : setupType == "Renko" ? renko_close > renko_open : na
sel_entry = setupType == "Open/Close" ? SELLOC : setupType == "Renko" ? SELLR : na
buy_entry = setupType == "Open/Close" ? BUYOC : setupType == "Renko" ? BUYR : na
trendColour = buy_color ? color.green : color.red
bcolour = buy_color ? lime100 : red100
barcolor(scolor ? bcolour : na, title='Bar Colours')
p11=plot(almaRibbon and setupType == "Open/Close" ? closeSeriesAlt : almaRibbon and setupType == "Renko" ? renko_close : na, style=plot.style_circles, linewidth=1, color=color.new(trendColour, 80), title="RENKO_1")
p22=plot(almaRibbon and setupType == "Open/Close" ? openSeriesAlt : almaRibbon and setupType == "Renko" ? renko_open : na, style=plot.style_circles, linewidth=1, color=color.new(trendColour, 80), title="RENKO_2")
fill(p11, p22, color=color.new(trendColour, 50), title="RENKO_fill")
//
lxTrigger = false
sxTrigger = false
leTrigger = buy_entry
seTrigger = sel_entry
// === /ALERT conditions.
buy = leTrigger //ta.crossover(closeSeriesAlt, openSeriesAlt)
sell = seTrigger //ta.crossunder(closeSeriesAlt, openSeriesAlt)
varip wasLong = false
varip wasShort = false
if barstate.isconfirmed
wasLong := false
else
if buy
wasLong := true
if barstate.isconfirmed
wasShort := false
else
if sell
wasShort := true
plotshape(wasLong, color = color.yellow)
plotshape(wasShort, color = color.yellow)
//plotshape(almaRibbon ? buy : na, title = "Buy", text = 'Buy', style = shape.labelup, location = location.belowbar, color= #39ff14, textcolor = #FFFFFF, size = size.tiny)
//plotshape(almaRibbon ? sell : na, title = "Exit", text = 'Exit', style = shape.labeldown, location = location.abovebar, color= #ff1100, textcolor = #FFFFFF, size = size.tiny)
// === STRATEGY ===
i_alert_txt_entry_long = "Short Exit" //input.text_area(defval = "Short Exit", title = "Long Entry Message", group = "Alerts")
i_alert_txt_exit_long = "Long Exit" //input.text_area(defval = "Long Exit", title = "Long Exit Message", group = "Alerts")
i_alert_txt_entry_short = "Go Short" //input.text_area(defval = "Go Short", title = "Short Entry Message", group = "Alerts")
i_alert_txt_exit_short = "Go Long" //input.text_area(defval = "Go Long", title = "Short Exit Message", group = "Alerts")
// Entries and Exits with TP/SL
//tradeType
if buy and TPSType == "Trailing" and tradeDateIsAllowed
strategy.close("Short" , alert_message = i_alert_txt_exit_short)
strategy.entry("Long" , strategy.long , alert_message = i_alert_txt_entry_long)
if sell and TPSType == "Trailing" and tradeDateIsAllowed
strategy.close("Long" , alert_message = i_alert_txt_exit_long)
strategy.entry("Short" , strategy.short, alert_message = i_alert_txt_entry_short)
//tradeType
if buy and TPSType == "Options" and tradeDateIsAllowed
// strategy.close("Short" , alert_message = i_alert_txt_exit_short)
strategy.entry("Long" , strategy.long , alert_message = i_alert_txt_entry_long)
if sell and TPSType == "Options" and tradeDateIsAllowed
strategy.close("Long" , alert_message = i_alert_txt_exit_long)
// strategy.entry("Short" , strategy.short, alert_message = i_alert_txt_entry_short)
G_RISK = '■ ' + 'Risk Management'
//#region ———— <↓↓↓ G_RISK ↓↓↓> {
//ATR SL Settings
atrLength = 20 //input.int(20, minval=1, title='ATR Length')
profitFactor = 2.5 //input(2.5, title='Take Profit Factor')
stopFactor = 1 //input(1.0, title='Stop Loss Factor')
// Calculate ATR
tpatrValue = ta.atr(atrLength)
// Calculate take profit and stop loss levels for buy signals
takeProfit1_buy = 1 * profitFactor * tpatrValue //close + profitFactor * atrValue
takeProfit2_buy = 2 * profitFactor * tpatrValue //close + 2 * profitFactor * atrValue
takeProfit3_buy = 3 * profitFactor * tpatrValue //close + 3 * profitFactor * atrValue
stopLoss_buy = close - takeProfit1_buy //stopFactor * tpatrValue
// Calculate take profit and stop loss levels for sell signals
takeProfit1_sell = 1 * profitFactor * tpatrValue //close - profitFactor * atrValue
takeProfit2_sell = 2 * profitFactor * tpatrValue //close - 2 * profitFactor * atrValue
takeProfit3_sell = 3 * profitFactor * tpatrValue //close - 3 * profitFactor * atrValue
stopLoss_sell = close + takeProfit1_sell //stopFactor * tpatrValue
// ———————————
//Tooltip
T_LVL = '(%) Exit Level'
T_QTY = '(%) Adjust trade exit volume'
T_MSG = 'Paste JSON message for your bot'
//Webhook Message
O_LEMSG = 'Long Entry'
O_LXMSGSL = 'Long SL'
O_LXMSGTP1 = 'Long TP1'
O_LXMSGTP2 = 'Long TP2'
O_LXMSGTP3 = 'Long TP3'
O_LXMSG = 'Long Exit'
O_SEMSG = 'Short Entry'
O_SXMSGSL = 'Short SL'
O_SXMSGA = 'Short TP1'
O_SXMSGB = 'Short TP2'
O_SXMSGC = 'Short TP3'
O_SXMSGX = 'Short Exit'
// on whole pips) for forex currency pairs.
pip_size = syminfo.mintick * (syminfo.type == "forex" ? 10 : 1)
// On the last historical bar, show the instrument's pip size
//if barstate.islastconfirmedhistory
// label.new(x=bar_index + 2, y=close, style=label.style_label_left,
// color=color.navy, textcolor=color.white, size=size.large,
// text=syminfo.ticker + "'s pip size is:\n" +
// str.tostring(pip_size))
// ——————————— | | | Line length guide |
i_lxLvlTP1 = leTrigger ? takeProfit1_buy : seTrigger ? takeProfit1_sell : na //input.float (1, 'Level TP1' , group = G_RISK, tooltip = T_LVL)
i_lxQtyTP1 = input.float (50, 'Qty TP1' , group = G_RISK, tooltip = T_QTY)
i_lxLvlTP2 = leTrigger ? takeProfit2_buy : seTrigger ? takeProfit2_sell : na //input.float (1.5, 'Level TP2' , group = G_RISK, tooltip = T_LVL)
i_lxQtyTP2 = input.float (30, 'Qty TP2' , group = G_RISK, tooltip = T_QTY)
i_lxLvlTP3 = leTrigger ? takeProfit3_buy : seTrigger ? takeProfit3_sell : na //input.float (2, 'Level TP3' , group = G_RISK, tooltip = T_LVL)
i_lxQtyTP3 = input.float (20, 'Qty TP3' , group = G_RISK, tooltip = T_QTY)
i_lxLvlSL = leTrigger ? takeProfit1_buy : seTrigger ? takeProfit1_sell : na //input.float (0.5, 'Stop Loss' , group = G_RISK, tooltip = T_LVL)
i_sxLvlTP1 = i_lxLvlTP1
i_sxQtyTP1 = i_lxQtyTP1
i_sxLvlTP2 = i_lxLvlTP2
i_sxQtyTP2 = i_lxQtyTP2
i_sxLvlTP3 = i_lxLvlTP3
i_sxQtyTP3 = i_lxQtyTP3
i_sxLvlSL = i_lxLvlSL
G_MSG = '■ ' + 'Webhook Message'
i_leMsg = O_LEMSG //input.string (O_LEMSG ,'Long Entry' , group = G_MSG, tooltip = T_MSG)
i_lxMsgSL = O_LXMSGSL //input.string (O_LXMSGSL ,'Long SL' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP1 = O_LXMSGTP1 //input.string (O_LXMSGTP1,'Long TP1' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP2 = O_LXMSGTP2 //input.string (O_LXMSGTP2,'Long TP2' , group = G_MSG, tooltip = T_MSG)
i_lxMsgTP3 = O_LXMSGTP3 //input.string (O_LXMSGTP3,'Long TP3' , group = G_MSG, tooltip = T_MSG)
i_lxMsg = O_LXMSG //input.string (O_LXMSG ,'Long Exit' , group = G_MSG, tooltip = T_MSG)
i_seMsg = O_SEMSG //input.string (O_SEMSG ,'Short Entry' , group = G_MSG, tooltip = T_MSG)
i_sxMsgSL = O_SXMSGSL //input.string (O_SXMSGSL ,'Short SL' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP1 = O_SXMSGA //input.string (O_SXMSGA ,'Short TP1' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP2 = O_SXMSGB //input.string (O_SXMSGB ,'Short TP2' , group = G_MSG, tooltip = T_MSG)
i_sxMsgTP3 = O_SXMSGC //input.string (O_SXMSGC ,'Short TP3' , group = G_MSG, tooltip = T_MSG)
i_sxMsg = O_SXMSGX //input.string (O_SXMSGX ,'Short Exit' , group = G_MSG, tooltip = T_MSG)
i_src = close
G_DISPLAY = 'Display'
//
i_alertOn = true //input.bool (true, 'Alert Labels On/Off' , group = G_DISPLAY)
i_barColOn = true //input.bool (true, 'Bar Color On/Off' , group = G_DISPLAY)
// ———————————
// @function Calculate the Take Profit line, and the crossover or crossunder
f_tp(_condition, _conditionValue, _leTrigger, _seTrigger, _src, _lxLvlTP, _sxLvlTP)=>
var float _tpLine = 0.0
_topLvl = _src + _lxLvlTP //TPSType == "Fixed %" ? _src + (_src * (_lxLvlTP / 100)) : _src + _lxLvlTP
_botLvl = _src - _lxLvlTP //TPSType == "Fixed %" ? _src - (_src * (_sxLvlTP / 100)) : _src - _sxLvlTP
_tpLine := _condition != _conditionValue and _leTrigger ? _topLvl :
_condition != -_conditionValue and _seTrigger ? _botLvl :
nz(_tpLine )
// @function Similar to "ta.crossover" or "ta.crossunder"
f_cross(_scr1, _scr2, _over)=>
_cross = _over ? _scr1 > _scr2 and _scr1 < _scr2 :
_scr1 < _scr2 and _scr1 > _scr2
// ———————————
//
var float condition = 0.0
var float slLine = 0.0
var float entryLine = 0.0
//
entryLine := leTrigger and condition <= 0.0 ? close :
seTrigger and condition >= 0.0 ? close : nz(entryLine )
//
slTopLvl = TPSType == "Fixed %" ? i_src + (i_src * (i_lxLvlSL / 100)) : i_src + i_lxLvlSL
slBotLvl = TPSType == "Fixed %" ? i_src - (i_src * (i_sxLvlSL / 100)) : i_src - i_lxLvlSL
slLine := condition <= 0.0 and leTrigger ? slBotLvl :
condition >= 0.0 and seTrigger ? slTopLvl : nz(slLine )
slLong = f_cross(low, slLine, false)
slShort = f_cross(high, slLine, true )
//
= f_tp(condition, 1.2,leTrigger, seTrigger, i_src, i_lxLvlTP3, i_sxLvlTP3)
= f_tp(condition, 1.1,leTrigger, seTrigger, i_src, i_lxLvlTP2, i_sxLvlTP2)
= f_tp(condition, 1.0,leTrigger, seTrigger, i_src, i_lxLvlTP1, i_sxLvlTP1)
tp3Long = f_cross(high, tp3Line, true )
tp3Short = f_cross(low, tp3Line, false)
tp2Long = f_cross(high, tp2Line, true )
tp2Short = f_cross(low, tp2Line, false)
tp1Long = f_cross(high, tp1Line, true )
tp1Short = f_cross(low, tp1Line, false)
switch
leTrigger and condition <= 0.0 => condition := 1.0
seTrigger and condition >= 0.0 => condition := -1.0
tp3Long and condition == 1.2 => condition := 1.3
tp3Short and condition == -1.2 => condition := -1.3
tp2Long and condition == 1.1 => condition := 1.2
tp2Short and condition == -1.1 => condition := -1.2
tp1Long and condition == 1.0 => condition := 1.1
tp1Short and condition == -1.0 => condition := -1.1
slLong and condition >= 1.0 => condition := 0.0
slShort and condition <= -1.0 => condition := 0.0
lxTrigger and condition >= 1.0 => condition := 0.0
sxTrigger and condition <= -1.0 => condition := 0.0
longE = leTrigger and condition <= 0.0 and condition == 1.0
shortE = seTrigger and condition >= 0.0 and condition == -1.0
longX = lxTrigger and condition >= 1.0 and condition == 0.0
shortX = sxTrigger and condition <= -1.0 and condition == 0.0
longSL = slLong and condition >= 1.0 and condition == 0.0
shortSL = slShort and condition <= -1.0 and condition == 0.0
longTP3 = tp3Long and condition == 1.2 and condition == 1.3
shortTP3 = tp3Short and condition == -1.2 and condition == -1.3
longTP2 = tp2Long and condition == 1.1 and condition == 1.2
shortTP2 = tp2Short and condition == -1.1 and condition == -1.2
longTP1 = tp1Long and condition == 1.0 and condition == 1.1
shortTP1 = tp1Short and condition == -1.0 and condition == -1.1
// ——————————— {
//
if strategy.position_size <= 0 and longE and TPSType == "ATR" and tradeDateIsAllowed
strategy.entry( 'Long', strategy.long, alert_message = i_leMsg, comment = 'LE')
if strategy.position_size > 0 and condition == 1.0 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'LXTP1', from_entry = 'Long', qty_percent = i_lxQtyTP1, limit = tp1Line, stop = slLine, comment_profit = 'LXTP1', comment_loss = 'SL', alert_profit = i_lxMsgTP1, alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.1 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'LXTP2', from_entry = 'Long', qty_percent = i_lxQtyTP2, limit = tp2Line, stop = slLine, comment_profit = 'LXTP2', comment_loss = 'SL', alert_profit = i_lxMsgTP2, alert_loss = i_lxMsgSL)
if strategy.position_size > 0 and condition == 1.2 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'LXTP3', from_entry = 'Long', qty_percent = i_lxQtyTP3, limit = tp3Line, stop = slLine, comment_profit = 'LXTP3', comment_loss = 'SL', alert_profit = i_lxMsgTP3, alert_loss = i_lxMsgSL)
if longX and tradeDateIsAllowed
strategy.close( 'Long', alert_message = i_lxMsg, comment = 'LX')
//
if strategy.position_size >= 0 and shortE and TPSType == "ATR" and tradeDateIsAllowed
strategy.entry( 'Short', strategy.short, alert_message = i_leMsg, comment = 'SE')
if strategy.position_size < 0 and condition == -1.0 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'SXTP1', from_entry = 'Short', qty_percent = i_sxQtyTP1, limit = tp1Line, stop = slLine, comment_profit = 'SXTP1', comment_loss = 'SL', alert_profit = i_sxMsgTP1, alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.1 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'SXTP2', from_entry = 'Short', qty_percent = i_sxQtyTP2, limit = tp2Line, stop = slLine, comment_profit = 'SXTP2', comment_loss = 'SL', alert_profit = i_sxMsgTP2, alert_loss = i_sxMsgSL)
if strategy.position_size < 0 and condition == -1.2 and TPSType == "ATR" and tradeDateIsAllowed
strategy.exit( id = 'SXTP3', from_entry = 'Short', qty_percent = i_sxQtyTP3, limit = tp3Line, stop = slLine, comment_profit = 'SXTP3', comment_loss = 'SL', alert_profit = i_sxMsgTP3, alert_loss = i_sxMsgSL)
if shortX and tradeDateIsAllowed
strategy.close( 'Short', alert_message = i_sxMsg, comment = 'SX')
// ———————————
c_tp = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.green
c_entry = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.blue
c_sl = leTrigger or seTrigger ? na :
condition == 0.0 ? na : color.red
p_tp1Line = plot ( condition == 1.0 or condition == -1.0 ? tp1Line : na, title = "TP Line 1", color = c_tp, linewidth = 1, style = plot.style_linebr)
p_tp2Line = plot ( condition == 1.0 or condition == -1.0 or condition == 1.1 or condition == -1.1 ? tp2Line : na, title = "TP Line 2", color = c_tp, linewidth = 1, style = plot.style_linebr)
p_tp3Line = plot ( condition == 1.0 or condition == -1.0 or condition == 1.1 or condition == -1.1 or condition == 1.2 or condition == -1.2 ? tp3Line : na, title = "TP Line 3", color = c_tp, linewidth = 1, style = plot.style_linebr)
p_entryLine = plot ( condition >= 1.0 or condition <= -1.0 ? entryLine : na, title = "Entry Line", color = c_entry, linewidth = 1, style = plot.style_linebr)
p_slLine = plot ( condition == 1.0 or condition == -1.0 or condition == 1.1 or condition == -1.1 or condition == 1.2 or condition == -1.2 ? slLine : na, title = "SL Line", color = c_sl, linewidth = 1, style = plot.style_linebr)
//fill( p_tp3Line, p_entryLine, color = leTrigger or seTrigger ? na :color.new(color.green, 90))
fill( p_entryLine, p_slLine, color = leTrigger or seTrigger ? na :color.new(color.red, 90))
//
plotshape( i_alertOn and longE, title = 'Long', text = 'Long', textcolor = color.white, color = color.green, style = shape.labelup, size = size.tiny, location = location.belowbar)
plotshape( i_alertOn and shortE, title = 'Short', text = 'Short', textcolor = color.white, color = color.red, style = shape.labeldown, size = size.tiny, location = location.abovebar)
plotshape( i_alertOn and (longX or shortX) ? close : na, title = 'Close', text = 'Close', textcolor = color.white, color = color.gray, style = shape.labelup, size = size.tiny, location = location.absolute)
l_tp = i_alertOn and (longTP1 or shortTP1) ? close : na
plotshape( l_tp, title = "TP1 Cross", text = "TP1", textcolor = color.white, color = #ec407a, style = shape.labelup, size = size.tiny, location = location.absolute)
plotshape( i_alertOn and (longTP2 or shortTP2) ? close : na, title = "TP2 Cross", text = "TP2", textcolor = color.white, color = #ec407a, style = shape.labelup, size = size.tiny, location = location.absolute)
plotshape( i_alertOn and (longTP3 or shortTP3) ? close : na, title = "TP3 Cross", text = "TP3", textcolor = color.white, color = #ec407a, style = shape.labelup, size = size.tiny, location = location.absolute)
plotshape( i_alertOn and (longSL or shortSL) ? close : na, title = "SL Cross", text = "SL", textcolor = color.white, color = color.maroon, style = shape.labelup, size = size.tiny, location = location.absolute)
//
plot( na, title = "─── ───", editable = false, display = display.data_window)
plot( condition, title = "condition", editable = false, display = display.data_window)
plot( strategy.position_size * 100, title = ".position_size", editable = false, display = display.data_window)
//#endregion }
// ——————————— <↑↑↑ G_RISK ↑↑↑>
//#region ———— <↓↓↓ G_SCRIPT02 ↓↓↓> {
// @function Queues a new element in an array and de-queues its first element.
f_qDq(_array, _val) =>
array.push(_array, _val)
_return = array.shift(_array)
_return
var line a_slLine = array.new_line(1)
var line a_entryLine = array.new_line(1)
var line a_tp3Line = array.new_line(1)
var line a_tp2Line = array.new_line(1)
var line a_tp1Line = array.new_line(1)
var label a_slLabel = array.new_label(1)
var label a_tp3label = array.new_label(1)
var label a_tp2label = array.new_label(1)
var label a_tp1label = array.new_label(1)
var label a_entryLabel = array.new_label(1)
newEntry = longE or shortE
entryIndex = 1
entryIndex := newEntry ? bar_index : nz(entryIndex )
lasTrade = bar_index >= entryIndex
l_right = 10
if TPSType == "ATR"
line.delete( f_qDq(a_slLine, line.new( entryIndex, slLine, last_bar_index + l_right, slLine, style = line.style_solid, color = c_sl)))
if TPSType == "ATR"
line.delete( f_qDq(a_entryLine, line.new( entryIndex, entryLine, last_bar_index + l_right, entryLine, style = line.style_solid, color = color.blue)))
if TPSType == "ATR"
line.delete( f_qDq(a_tp3Line, line.new( entryIndex, tp3Line, last_bar_index + l_right, tp3Line, style = line.style_solid, color = c_tp)))
if TPSType == "ATR"
line.delete( f_qDq(a_tp2Line, line.new( entryIndex, tp2Line, last_bar_index + l_right, tp2Line, style = line.style_solid, color = c_tp)))
if TPSType == "ATR"
line.delete( f_qDq(a_tp1Line, line.new( entryIndex, tp1Line, last_bar_index + l_right, tp1Line, style = line.style_solid, color = c_tp)))
if TPSType == "ATR"
label.delete( f_qDq(a_slLabel, label.new( last_bar_index + l_right, slLine, 'SL: ' + str.tostring(slLine, '##.###'), style = label.style_label_left, textcolor = color.white, color = c_sl)))
if TPSType == "ATR"
label.delete( f_qDq(a_entryLabel, label.new( last_bar_index + l_right, entryLine, 'Entry: ' + str.tostring(entryLine, '##.###'), style = label.style_label_left, textcolor = color.white, color = color.blue)))
if TPSType == "ATR"
label.delete( f_qDq(a_tp3label, label.new( last_bar_index + l_right, tp3Line, 'TP3: ' + str.tostring(tp3Line, '##.###') + " - Target Pips : - " + str.tostring(longE ? tp3Line - entryLine : entryLine - tp3Line, "#.##"), style = label.style_label_left, textcolor = color.white, color = c_tp)))
if TPSType == "ATR"
label.delete( f_qDq(a_tp2label, label.new( last_bar_index + l_right, tp2Line, 'TP2: ' + str.tostring(tp2Line, '##.###'), style = label.style_label_left, textcolor = color.white, color = c_tp)))
if TPSType == "ATR"
label.delete( f_qDq(a_tp1label, label.new( last_bar_index + l_right, tp1Line, 'TP1: ' + str.tostring(tp1Line, '##.###'), style = label.style_label_left, textcolor = color.white, color = c_tp)))
//#endregion }
// ——————————— <↑↑↑ G_SCRIPT02 ↑↑↑>
c_barCol = close > open ? color.rgb(120, 9, 139) : color.rgb(69, 155, 225)
barcolor(
i_barColOn ? c_barCol : na)
// ———————————
//
if longE or shortE or longX or shortX
alert(message = 'Any Alert', freq = alert.freq_once_per_bar_close)
if longE
alert(message = 'Long Entry', freq = alert.freq_once_per_bar_close)
if shortE
alert(message = 'Short Entry', freq = alert.freq_once_per_bar_close)
if longX
alert(message = 'Long Exit', freq = alert.freq_once_per_bar_close)
if shortX
alert(message = 'Short Exit', freq = alert.freq_once_per_bar_close)
//#endregion }
// ——————————— <↑↑↑ G_SCRIPT03 ↑↑↑>
// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © TraderHalai
// This script was born out of my quest to be able to display strategy back test statistics on charts to allow for easier backtesting on devices that do not natively support backtest engine (such as mobile phones, when I am backtesting from away from my computer). There are already a few good ones on TradingView, but most / many are too complicated for my needs.
//
//Found an excellent display backtest engine by 'The Art of Trading'. This script is a snippet of his hard work, with some very minor tweaks and changes. Much respect to the original author.
//
//Full credit to the original author of this script. It can be found here: www.tradingview.com
//
// This script can be copied and airlifted onto existing strategy scripts of your own, and integrates out of the box without implementation of additional functions. I've also added Max Runup, Average Win and Average Loss per trade to the orignal script.
//
//Will look to add in more performance metrics in future, as I further develop this script.
//
//Feel free to use this display panel in your scripts and strategies.
//Thanks and enjoy! :)
//@version=5
//strategy("Strategy BackTest Display Statistics - TraderHalai", overlay=true, default_qty_value= 5, default_qty_type = strategy.percent_of_equity, initial_capital=10000, commission_type=strategy.commission.percent, commission_value=0.1)
//DEMO basic strategy - Use your own strategy here - Jaws Mean Reversion from my profile used here
//source = input(title = "Source", defval = close)
///////////////////////////// --- BEGIN TESTER CODE --- ////////////////////////
// COPY below into your strategy to enable display
////////////////////////////////////////////////////////////////////////////////
// Declare performance tracking variables
drawTester = input.bool(false, "Strategy Performance", group='Dashboards', inline="Show Dashboards")
var balance = strategy.initial_capital
var drawdown = 0.0
var maxDrawdown = 0.0
var maxBalance = 0.0
var totalWins = 0
var totalLoss = 0
// Prepare stats table
var table testTable = table.new(position.top_right, 5, 2, border_width=1)
f_fillCell(_table, _column, _row, _title, _value, _bgcolor, _txtcolor) =>
_cellText = _title + "\n" + _value
table.cell(_table, _column, _row, _cellText, bgcolor=_bgcolor, text_color=_txtcolor)
// Custom function to truncate (cut) excess decimal places
//truncate(_number, _decimalPlaces) =>
// _factor = math.pow(10, _decimalPlaces)
// int(_number * _factor) / _factor
// Draw stats table
var bgcolor = color.new(color.black,0)
if drawTester and tradeDateIsAllowed
if barstate.islastconfirmedhistory
// Update table
dollarReturn = strategy.netprofit
f_fillCell(testTable, 0, 0, "Total Trades:", str.tostring(strategy.closedtrades), bgcolor, color.white)
f_fillCell(testTable, 0, 1, "Win Rate:", str.tostring(truncate((strategy.wintrades/strategy.closedtrades)*100,2)) + "%", bgcolor, color.white)
f_fillCell(testTable, 1, 0, "Starting:", "$" + str.tostring(strategy.initial_capital), bgcolor, color.white)
f_fillCell(testTable, 1, 1, "Ending:", "$" + str.tostring(truncate(strategy.initial_capital + strategy.netprofit,2)), bgcolor, color.white)
f_fillCell(testTable, 2, 0, "Avg Win:", "$"+ str.tostring(truncate(strategy.grossprofit / strategy.wintrades, 2)), bgcolor, color.white)
f_fillCell(testTable, 2, 1, "Avg Loss:", "$"+ str.tostring(truncate(strategy.grossloss / strategy.losstrades, 2)), bgcolor, color.white)
f_fillCell(testTable, 3, 0, "Profit Factor:", str.tostring(truncate(strategy.grossprofit / strategy.grossloss,2)), strategy.grossprofit > strategy.grossloss ? color.green : color.red, color.white)
f_fillCell(testTable, 3, 1, "Max Runup:", str.tostring(truncate(strategy.max_runup, 2 )), bgcolor, color.white)
f_fillCell(testTable, 4, 0, "Return:", (dollarReturn > 0 ? "+" : "") + str.tostring(truncate((dollarReturn / strategy.initial_capital)*100,2)) + "%", dollarReturn > 0 ? color.green : color.red, color.white)
f_fillCell(testTable, 4, 1, "Max DD:", str.tostring(truncate((strategy.max_drawdown / strategy.equity) * 100 ,2)) + "%", color.red, color.white)
// --- END TESTER CODE --- ///////////////
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © niceGear68734
//@version=5
//strategy("Table to filter trades per day", overlay=true, use_bar_magnifier = true, initial_capital = 5000, calc_on_every_tick = true, calc_on_order_fills = true, commission_type = strategy.commission.cash_per_contract)
//~ ___________________________________________________________________________
//~ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//~ !!!!!!!!!!!!!!!_________________ START _________________!!!!!!!!!!!!!!!!!
i_showweeklyPerformance = input.bool(false, 'Weekly Performance', group='Dashboards', inline="Show Dashboards")
//__________________________ User Inputs ___________________________________
var const string g_table = "Table Settings"
i_table_pos = "Top Left" //input.string(defval = "Top Left", title = "Position", options = , group = g_table, inline = "1", tooltip = "It sets the location of the table")
i_text_size = "Normal" //input.string(defval = "Normal", title = "Set the size of text", options = , tooltip = "This option is used to change the size of the text in the table")
var const string g_general = "General Settings"
i_check_open_close = "Opened" //input.string("Opened", "Check when the trade :", , group = g_general, tooltip = "This parameter defines what to check for. If opened is selected, the results will show the trades that opened on that day. If closed is selected, the results will show the trades that closed on that day")
i_timezone = "Exchange" //input.string("Exchange", title = "Set the Timezone", options = , group = g_general, tooltip = "You can use this setting whenever you want to change the time that the trade has closed/opened")
//~_____________________________ Switches ___________________________________
table_pos = switch i_table_pos
"Bottom Right" => position.bottom_right
"Bottom Left" => position.bottom_left
"Top Right" => position.top_right
"Top Left" => position.top_left
timezone_setting = i_timezone == "Exchange" ? syminfo.timezone : i_timezone
text_size = switch i_text_size
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
//__________________________ Array Declaration _____________________________
var string t_column_names = array.from( "", "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat") // Columns header names
var string t_row_names = array.from("", "Total Trades", "Loss", "Win", "Win Rate" ) // Rows header names
var t_column_size = array.size(t_column_names)
var t_row_size = array.size(t_row_names)
var string a_closed_trades = array.new_string() // Save the total number of trades
var string a_loss_trades = array.new_string() // Save the number of losing trades
var string a_win_trades = array.new_string() // Save the number of winning trades
var _a_day_week = array.new_int() // Save the day of the week to split data
// __________________________ Custom Functions ________________________________
//~ create a counter so that it gives a number to strategy.closed_trades.entry_time(counter)
var trade_number = -1
if strategy.closedtrades > strategy.closedtrades
trade_number += 1
f_strategy_closedtrades_hour() =>
switch
i_check_open_close =="Closed" => dayofweek(strategy.closedtrades.exit_time(trade_number), timezone_setting)
i_check_open_close =="Opened" => dayofweek(strategy.closedtrades.entry_time(trade_number), timezone_setting)
f_data(_i) =>
var _closed_trades = 0
var _loss_trades = 0
var _win_trades = 0
var _txt_closed_trades = ""
var _txt_loss_trades = ""
var _txt_win_trades = ""
if strategy.closedtrades > strategy.closedtrades and f_strategy_closedtrades_hour() == _i
_closed_trades += 1
_txt_closed_trades := str.tostring(_closed_trades)
if strategy.losstrades > strategy.losstrades and f_strategy_closedtrades_hour() == _i
_loss_trades += 1
_txt_loss_trades := str.tostring(_loss_trades)
if strategy.wintrades > strategy.wintrades and f_strategy_closedtrades_hour() == _i
_win_trades += 1
_txt_win_trades := str.tostring(_win_trades)
//__________________________
var string array1 = array.new_string(5)
var string array2 = array.new_string(5)
var string array3 = array.new_string(5)
var string array4 = array.new_string(5)
var string array5 = array.new_string(5)
var string array6 = array.new_string(5)
var string array7 = array.new_string(5)
f_pass_data_to_array(_i, _array) =>
= f_data(_i)
array.set(_array,1 , cl)
array.set(_array,2,loss)
array.set(_array,3,win)
if cl != ""
array.set(_array,4,str.tostring(str.tonumber(win) / str.tonumber(cl) * 100 , "##") + " %")
if cl != "" and win == ""
array.set(_array,4,"0 %")
for i = 1 to 7
switch
i == 1 => f_pass_data_to_array(i,array1)
i == 2 => f_pass_data_to_array(i,array2)
i == 3 => f_pass_data_to_array(i,array3)
i == 4 => f_pass_data_to_array(i,array4)
i == 5 => f_pass_data_to_array(i,array5)
i == 6 => f_pass_data_to_array(i,array6)
i == 7 => f_pass_data_to_array(i,array7)
f_retrieve_data_to_table(_i, _j) =>
switch
_i == 1 => array.get(array1, _j)
_i == 2 => array.get(array2, _j)
_i == 3 => array.get(array3, _j)
_i == 4 => array.get(array4, _j)
_i == 5 => array.get(array5, _j)
_i == 6 => array.get(array6, _j)
_i == 7 => array.get(array7, _j)
//~ ___________________________ Create Table ________________________________
create_table(_col, _row, _txt) =>
var table _tbl = table.new(position = table_pos, columns = t_column_size , rows = t_row_size, border_width=1)
color _color = _row == 0 or _col == 0 ? color.rgb(3, 62, 106) : color.rgb(2, 81, 155)
table.cell(_tbl, _col, _row, _txt, bgcolor = _color, text_color = color.white, text_size = text_size)
//~___________________________ Fill With Data _______________________________
if barstate.islastconfirmedhistory and i_showweeklyPerformance and tradeDateIsAllowed
for i = 0 to t_column_size - 1 by 1
for j = 0 to t_row_size - 1 by 1
_txt = ""
if i >= 0 and j == 0
_txt := array.get(t_column_names, i)
if j >= 0 and i == 0
_txt := array.get(t_row_names, j)
if i >= 1 and j >= 1 and j <= 5
_txt := f_retrieve_data_to_table( i , j)
create_table(i ,j , _txt)
//~ ___________________________ Notice ______________________________________
if timeframe.in_seconds() > timeframe.in_seconds("D")
x = table.new(position.middle_center,1,1,color.aqua)
table.cell_set_text(x,0,0,"Please select lower timeframes (Daily or lower)")
//~ !!!!!!!!!!!!!!!_________________ STOP _________________!!!!!!!!!!!!!!!!!!
//~ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//~ ___________________________________________________________________________
// Global Dashboard Variables
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
// Dashboard Table Text Size
i_tableTextSize = "Normal" //input.string(title="Dashboard Size", defval="Normal", options= , group="Dashboards")
table_text_size(s) =>
switch s
"Auto" => size.auto
"Huge" => size.huge
"Large" => size.large
"Normal" => size.normal
"Small" => size.small
=> size.tiny
tableTextSize = table_text_size(i_tableTextSize)
// Monthly Table Performance Dashboard By @QuantNomad
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
i_showMonthlyPerformance = input.bool(false, 'Monthly Performance', group='Dashboards', inline="Show Dashboards")
i_monthlyReturnPercision = 2
if i_showMonthlyPerformance and tradeDateIsAllowed
new_month = month(time) != month(time )
new_year = year(time) != year(time )
eq = strategy.equity
bar_pnl = eq / eq - 1
cur_month_pnl = 0.0
cur_year_pnl = 0.0
// Current Monthly P&L;
cur_month_pnl := new_month ? 0.0 :
(1 + cur_month_pnl ) * (1 + bar_pnl) - 1
// Current Yearly P&L;
cur_year_pnl := new_year ? 0.0 :
(1 + cur_year_pnl ) * (1 + bar_pnl) - 1
// Arrays to store Yearly and Monthly P&Ls;
var month_pnl = array.new_float(0)
var month_time = array.new_int(0)
var year_pnl = array.new_float(0)
var year_time = array.new_int(0)
last_computed = false
if (not na(cur_month_pnl ) and (new_month or barstate.islastconfirmedhistory))
if (last_computed )
array.pop(month_pnl)
array.pop(month_time)
array.push(month_pnl , cur_month_pnl )
array.push(month_time, time )
if (not na(cur_year_pnl ) and (new_year or barstate.islastconfirmedhistory))
if (last_computed )
array.pop(year_pnl)
array.pop(year_time)
array.push(year_pnl , cur_year_pnl )
array.push(year_time, time )
last_computed := barstate.islastconfirmedhistory ? true : nz(last_computed )
// Monthly P&L; Table
var monthly_table = table(na)
if (barstate.islastconfirmedhistory)
monthly_table := table.new(position.bottom_right, columns = 14, rows = array.size(year_pnl) + 1, border_width = 1)
table.cell(monthly_table, 0, 0, "", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 1, 0, "Jan", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 2, 0, "Feb", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 3, 0, "Mar", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 4, 0, "Apr", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 5, 0, "May", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 6, 0, "Jun", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 7, 0, "Jul", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 8, 0, "Aug", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 9, 0, "Sep", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 10, 0, "Oct", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 11, 0, "Nov", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 12, 0, "Dec", bgcolor = #cccccc, text_size=tableTextSize)
table.cell(monthly_table, 13, 0, "Year", bgcolor = #999999, text_size=tableTextSize)
for yi = 0 to array.size(year_pnl) - 1
table.cell(monthly_table, 0, yi + 1, str.tostring(year(array.get(year_time, yi))), bgcolor = #cccccc, text_size=tableTextSize)
y_color = array.get(year_pnl, yi) > 0 ? color.new(color.teal, transp = 40) : color.new(color.gray, transp = 40)
table.cell(monthly_table, 13, yi + 1, str.tostring(math.round(array.get(year_pnl, yi) * 100, i_monthlyReturnPercision)), bgcolor = y_color, text_color=color.new(color.white, 0),text_size=tableTextSize)
for mi = 0 to array.size(month_time) - 1
m_row = year(array.get(month_time, mi)) - year(array.get(year_time, 0)) + 1
m_col = month(array.get(month_time, mi))
m_color = array.get(month_pnl, mi) > 0 ? color.new(color.teal, transp = 40) : color.new(color.maroon, transp = 40)
table.cell(monthly_table, m_col, m_row, str.tostring(math.round(array.get(month_pnl, mi) * 100, i_monthlyReturnPercision)), bgcolor = m_color, text_color=color.new(color.white, 0), text_size=tableTextSize)
hide = timeframe.isintraday
// Input for EMA period
emaPeriod = 48 //input.int(48, title="EMA Period")
emaPeriod2 = 2 //input.int(2, title="EME Period 2")
emaPeriod3 = 21 //input.int(21, title="EMA Period")
// Input to toggle EMA Cloud
showcloud = input.bool(false, title="Plot EMA?", group='EMA & ATR', inline="Show EMA's & ATR")
useHTF = input.bool(true, title = "Use Higher Time Frame?")
matimeframe = useHTF ? my_time1 : ''
// EMA calculations
ema = request.security(syminfo.tickerid, matimeframe, ta.ema(close, emaPeriod))
ema2 = request.security(syminfo.tickerid, matimeframe, ta.ema(close,emaPeriod2))
ema3 = request.security(syminfo.tickerid, matimeframe,ta.ema(close, emaPeriod3))
emaColor = close > ema3 ? color.new(color.rgb(56, 142, 60, 63), 50) : color.new(color.rgb(147, 40, 51, 38), 50)
// Plotting EMA's
// plot_ema1 = plot(hide ? ema : na, style=plot.style_line, color=color.new(color.rgb(255, 255, 255, 100), 50), title="EMA", linewidth=2)
// plot_ema2 = plot(hide ? ema2 : na, style=plot.style_line, color=color.new(color.rgb(255, 255, 255, 100), 50), title="EMA", linewidth=1)
// plot_ema3 = plot(ema3, style=plot.style_line, color=emaColor, title="EMA", linewidth=1)
// EMA Cloud
cloudColor = ema2 > ema ? color.new(#0f8513, 80) : color.new(#a81414, 80)
cloudColor2 = ema2 > ema3 ? color.new(#0f8513, 50) : color.new(#a81414, 50)
cloudColor := showcloud ? cloudColor : na
// fill(plot_ema1, plot_ema2, color=cloudColor, title="EMA Cloud")
// fill(plot_ema3, plot_ema2, color=cloudColor, title="EMA Cloud")
/////////////////////////////////////////////////////////////// © BackQuant ///////////////////////////////////////////////////////////////
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © BackQuant
import TradingView/ta/4 as ta
//@version=5
//indicator(
// title="DEMA Adjusted Average True Range ",
// shorttitle = "DEMA ATR ",
// overlay=true,
// timeframe="",
// timeframe_gaps=true
// )
// Define User Inputs
simple bool showAtr = input.bool(false, "Plot Dema?", group='EMA & ATR', inline="Show EMA's & ATR")
simple bool haCandles = true //input.bool(true, "Use HA Candles?")
simple int periodDema = 7 //input.int(7, "Dema Period", group = "Dema Atr")
series float sourceDema = close //input.source(close, "Calculation Source", group = "Dema Atr")
simple int periodAtr = 14 //input.int(14, "Period", group = "Dema Atr")
simple float factorAtr = 1.7 //input.float(1.7, "Factor", step = 0.01, group = "Dema Atr")
simple color longColour = #66bb6a
simple color shortColour = #f23645
/////////////////////////////////////////////////////////////// © BackQuant ///////////////////////////////////////////////////////////////
// Use HA Candles?
heikinashi_close = request.security(
symbol = ticker.heikinashi(syminfo.tickerid),
timeframe = timeframe.period,
expression = close,
gaps = barmerge.gaps_off,
lookahead = barmerge.lookahead_on
)
var series float source = close
if haCandles == true
source := heikinashi_close
if haCandles == false
source := sourceDema
/////////////////////////////////////////////////////////////// © BackQuant ///////////////////////////////////////////////////////////////
// Function
DemaAtrWithBands(periodDema, source, lookback, atrFactor)=>
ema1 = ta.ema(source, periodDema)
ema2 = ta.ema(ema1, periodDema)
demaOut = 2 * ema1 - ema2
atr = ta.atr(lookback)
trueRange = atr * atrFactor
DemaAtr = demaOut
DemaAtr := nz(DemaAtr , DemaAtr)
trueRangeUpper = demaOut + trueRange
trueRangeLower = demaOut - trueRange
if trueRangeLower > DemaAtr
DemaAtr := trueRangeLower
if trueRangeUpper < DemaAtr
DemaAtr := trueRangeUpper
DemaAtr
// Function Out
DemaAtr = DemaAtrWithBands(periodDema, source, periodAtr, factorAtr)
/////////////////////////////////////////////////////////////// © BackQuant ///////////////////////////////////////////////////////////////
// Conditions
DemaAtrLong = DemaAtr > DemaAtr
DemaAtrShort = DemaAtr < DemaAtr
// Colour Condtions
var color Trendcolor = #ffffff
if DemaAtrLong
Trendcolor := longColour
if DemaAtrShort
Trendcolor := shortColour
// Plotting
plot( showAtr ? DemaAtr : na, "ATR", color=Trendcolor, linewidth = 2 )
import DevLucem/ZigLib/1 as ZigZag
////////
// Fetch Ingredients
//
// ////////
// // Bake it with a simple oven this time
= ZigZag.zigzag(low, high, Depth, Deviation, Backstep)
string nowPoint = ""
var float lastPoint = z1.price
if bool(ta.change(direction))
lastPoint := z1.price
// ////////
// // Let it Cool And Serve
line zz = na
label point = na
if repaint
zz := line.new(z1, z2, xloc.bar_time, extend? extend.right: extend.none, color.new(direction>0? upcolor: dncolor, lines), width=line_thick)
nowPoint := direction<0? (z2.pricelastPoint? "HH": "LH")
point := label.new(z2, nowPoint, xloc.bar_time, yloc.price,
color.new(direction<0? upcolor: dncolor, labels), direction>0? label.style_label_down: label.style_label_up, color.new(direction>0? upcolor: dncolor, labels), label_size)
if direction == direction
line.delete(zz )
label.delete(point )
else
line.set_extend(zz , extend.none)
else
if direction != direction
zz := line.new(z1 , z2 , xloc.bar_time, extend.none, color.new(direction>0? upcolor: dncolor, lines), width=line_thick)
nowPoint := direction <0? (z2.price lastPoint ? "HH": "LH")
point := label.new(z2 , nowPoint, xloc.bar_time, yloc.price,
color.new(direction <0? upcolor: dncolor, labels), direction >0? label.style_label_down: label.style_label_up, color.new(direction >0? upcolor: dncolor, labels), label_size)
bgcolor(direction<0? color.new(dncolor, background): color.new(upcolor, background), title='Direction Background', display = display.none)
plotarrow(direction, "direction", display=display.status_line)
// ////////
// // Declare Meal Was Sweet By Force
alertcondition(nowPoint == "HH" and z2.price != z2.price , "New Higher High", 'Zigzag on {{ticker}} higher higher high detected at {{time}}')
alertcondition(nowPoint == "LH" and z2.price != z2.price , "New Lower High", 'Zigzag on {{ticker}} higher lower high detected at {{time}}')
alertcondition(nowPoint == "HL" and z2.price != z2.price , "New Higher Low", 'Zigzag on {{ticker}} higher lower low detected at {{time}}')
alertcondition(nowPoint == "LL" and z2.price != z2.price , "New Lower Low", 'Zigzag on {{ticker}} lower low detected at {{time}}')
alertcondition(direction != direction , 'Direction Changed', 'Zigzag on {{ticker}} direction changed at {{time}}')
alertcondition(direction != direction and direction>0, 'Bullish Direction', 'Zigzag on {{ticker}} bullish direction at {{time}}')
alertcondition(direction != direction and direction<0, 'Bearish Direction', 'Zigzag on {{ticker}} bearish direction at {{time}}')
if direction != direction
alert((direction<0? "Bearish": "Bullish") + " Direction Final ", alert.freq_once_per_bar_close)
MSG = "MARKET STRUCTURE"
VBG = "VOLUMETRIC ORDER BLOCKS"
MST = "Limit market structure calculation to improve memory speed time"
SLT = " Limit swing structure to tot bars back"
IDT = " Start date of the internal structure"
CST = "Color candle based on trend detection system"
OBT = "Display internal buy and sell activity"
OBD = "Show Last number of orderblock"
OBMT = " Use Length to adjust cordinate of the orderblocks\n Use whole candle body"
_ ='
------------
–––––––––––––––––––––––––– INPUTS –––––––––––––––––––––––––––
------------ '//{
bool windowsis = input.bool(true, "Window", inline="kla", group=MSG)
int mswindow = input.int(5000, "", tooltip=MST,group=MSG, inline="kla", minval=1000)
bool showSwing = input.bool(true, "Swing", inline="scss", group=MSG)
int swingLimit = input.int(100, "", tooltip=SLT, inline="scss", group=MSG, minval=10, maxval=200)
color swingcssup = input.color(#f7525f, "", inline="scss", group=MSG)
color swingcssdn = input.color(#66bb6a, "", inline="scss", group=MSG)
bool showMapping = input.bool(false, "Mapping Structure", inline="mapping", group=MSG)
string mappingStyle = input.string("----", "", options= , inline="mapping", group=MSG)
color mappingcss = input.color(color.silver, "", tooltip="Display Mapping Structure", inline="mapping", group=MSG)
bool candlecss = input.bool(false, "Color Candles", tooltip=CST, group=MSG, inline="txt")
string mstext = input.string("Tiny", "", options= ,
inline="txt", group=MSG)
string msmode = input.string("Adjusted Points", "Algorithmic Logic", options=
, inline="node", group=MSG)
int mslen = input.int(5, "", inline="node", group=MSG, minval=2)
bool buildsweep = input.bool(true, "Build Sweep (x)", "Build sweep on market structure", "znc", MSG)
bool msbubble = input.bool(true, "Bubbles", tooltip="Display Circle Bubbles", inline="bubbles", group=MSG)
bool obshow = input.bool(true, "Show Last", tooltip=OBD, group=VBG, inline="obshow")
int oblast = input.int(5, "", group=VBG, inline="obshow", minval=0)
color obupcs = input.color(color.new(#089981, 90), "", inline="obshow", group=VBG)
color obdncs = input.color(color.new(#f23645, 90), "", inline="obshow", group=VBG)
bool obshowactivity = input.bool(true, "Show Buy/Sell Activity", inline="act", group=VBG, tooltip=OBT)
color obactup = input.color(color.new(#089981, 50), "", inline="act", group=VBG)
color obactdn = input.color(color.new(#f23645, 50), "", inline="act", group=VBG)
obshowbb = input.bool(false, "Show Breakers", inline="bb", group=VBG, tooltip="Display Breakers")
color bbup = input.color(color.new(#089981, 100), "", inline="bb", group=VBG)
color bbdn = input.color(color.new(#f23645, 100), "", inline="bb", group=VBG)
obmode = input.string("Length", "Construction", options= , tooltip=OBMT, inline="atr", group=VBG)
len = input.int(5, "", inline="atr", group=VBG, minval=1)
obmiti = input.string("Close", "Mitigation Method", options= ,
tooltip="Mitigation method for when to trigger order blocks", group=VBG)
obtxt = input.string("Normal", "Metric Size", options= ,
tooltip="Order block Metrics text size", inline="txt", group=VBG)
showmetric = input.bool(true, "Show Metrics", group=VBG)
showline = input.bool(true, "Show Mid-Line", group=VBG)
overlap = input.bool(true, "Hide Overlap", group=VBG, inline="ov")
wichlap = input.string("Recent", "", options= , inline="ov", group=VBG)
fvg_enable = input.bool(false, "", inline="1", group="FAIR VALUE GAP", tooltip="Display fair value gap")
what_fvg = input.string("FVG", "", inline="1", group="FAIR VALUE GAP", tooltip="Display fair value gap",
options= )
fvg_num = input.int(5, "Show Last", inline="1a", group="FAIR VALUE GAP", tooltip="Number of fvg to show", minval=0)
fvg_upcss = input.color(color.new(#089981, 80), "", inline="1", group="FAIR VALUE GAP")
fvg_dncss = input.color(color.new(#f23645, 80), "", inline="1", group="FAIR VALUE GAP")
fvgbbup = input.color(color.new(#089981, 100), "", inline="1", group="FAIR VALUE GAP")
fvgbbdn = input.color(color.new(#f23645, 100), "", inline="1", group="FAIR VALUE GAP")
fvg_src = input.string("Close", "Mitigation",
inline="3",
group="FAIR VALUE GAP",
tooltip=" Use the close of the body as trigger\n\n Use the extreme point of the body as trigger",
options= )
fvgthresh = input.float(0, "Threshold", tooltip="Filter out non significative FVG", group="FAIR VALUE GAP",
inline="asd", minval=0, maxval=2, step=0.1)
fvgoverlap = input.bool(true, "Hide Overlap", "Hide overlapping FVG", group="FAIR VALUE GAP")
fvgline = input.bool(true, "Show Mid-Line", group="FAIR VALUE GAP")
fvgextend = input.bool(false, "Extend FVG", group="FAIR VALUE GAP")
dispraid = input.bool(false, "Display Raids", inline="raid", group="FAIR VALUE GAP")
//}
_ ='
------------
–––––––––––––––––––––––––– UDT –––––––––––––––––––––––––––
------------ '//{
type hqlzone
box pbx
box ebx
box lbx
label plb
label elb
label lbl
type Zphl
line top
line bottom
label top_label
label bottom_label
bool stopcross
bool sbottomcross
bool itopcross
bool ibottomcross
string txtup
string txtdn
float topy
float bottomy
float topx
float bottomx
float tup
float tdn
int tupx
int tdnx
float itopy
float itopx
float ibottomy
float ibottomx
float uV
float dV
type entered
bool normal = false
bool breaker = false
type store
line ln
label lb
box bx
linefill lf
type structure
int zn
float zz
float bos
float choch
int loc
int temp
int trend
int start
float main
int xloc
bool upsweep
bool dnsweep
string txt = na
type drawms
int x1
int x2
float y
string txt
color css
string style
type ob
bool bull
float top
float btm
float avg
int loc
color css
float vol
int dir
int move
int blPOS
int brPOS
int xlocbl
int xlocbr
bool isbb = false
int bbloc
type FVG
float top = na
float btm = na
int loc = bar_index
bool isbb = false
int bbloc = na
bool israid = false
float raidy = na
int raidloc = na
int raidx2 = na
bool active = false
color raidcs = na
type SFP
float y
int loc
float ancor
type sfpbuildlbl
int x
float y
string style
color css
string txt
type sfpbuildline
int x1
int x2
float y
color css
float ancor
int loc
type equalbuild
int x1
float y1
int x2
float y2
color css
string style
type equalname
int x
float y
string txt
color css
string style
type ehl
float pt
int t
float pb
int b
type sellbuyside
float top
float btm
int loc
color css
string txt
float vol
type timer
bool start = false
int count = 0
//}
_ ='
------------
–––––––––––––––––––––––––– SETUP –––––––––––––––––––––––––––
------------ '//{
var store bin = store.new(
array.new< line >()
, array.new< label >()
, array.new< box >()
, array.new()
)
var entered blobenter = entered.new()
var entered brobenter = entered.new()
var entered blfvgenter = entered.new()
var entered brfvgenter = entered.new()
var entered blarea = entered.new()
var entered brarea = entered.new()
var timer lc = timer.new ()
if barstate.islast
for obj in bin.ln
obj.delete()
for obj in bin.lb
obj.delete()
for obj in bin.bx
obj.delete()
for obj in bin.lf
obj.delete()
bin.ln.clear()
bin.lb.clear()
bin.bx.clear()
bin.lf.clear()
invcol = #ffffff00
float atr = (ta.atr(200) / (5/len))
//}
_ ='
------------
–––––––––––––––––––––––––– UTILITY –––––––––––––––––––––––––––
------------ '//{
method txSz(string s) =>
out = switch s
"Tiny" => size.tiny
"Small" => size.small
"Normal" => size.normal
"Large" => size.large
"Huge" => size.huge
"Auto" => size.auto
out
method lstyle(string style) =>
out = switch style
'⎯⎯⎯⎯' => line.style_solid
'----' => line.style_dashed
'····' => line.style_dotted
ghl() => [high , low , close , open , close, open, high, low, high , low , ta.atr(200)]
method IDMIDX(bool use_max, int loc) =>
min = 99999999.
max = 0.
idx = 0
if use_max
for i = 0 to (bar_index - loc)
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
else
for i = 0 to (bar_index - loc)
min := math.min(low , min)
max := min == low ? high : max
idx := min == low ? i : idx
idx
SFPData() => [high, high , high , low, low , low , close, volume, time, bar_index , time ]
SFPcords() =>
RealTF = barstate.isrealtime ? 0 : 1
= SFPData()
[h , h1 , h2 , l , l1 , l2 , c , v , t , n , t1 ]
method find(structure ms, bool use_max, bool sweep, bool useob) =>
min = 99999999.
max = 0.
idx = 0
if not sweep
if ((bar_index - ms.loc) - 1) > 0
if use_max
for i = 0 to (bar_index - ms.loc) - 1
max := math.max(high , max)
min := max == high ? low : min
idx := max == high ? i : idx
if useob
if high
cd_sfp_CxGeneral:
This indicator is designed to assist users who trade the Swing Failure Pattern ( SFP ).
In technical literature (various definitions exist), an SFP is a situation where the price violates a previous swing level but fails to close beyond that level.
• (Liquidity Sweep)
• (Buyer or seller dominance)
• (Stop hunt)
• (Turtle Soup)
The general strategy is built upon seeking trade opportunities after an SFP is formed and conviction is established that the market direction has changed.
Components used to gather confirmation:
• Determining Bias: Periodic SAR
• Obtaining Breakout/Reversal Confirmation: Change in State Delivery (CISD)
• Defining the Buyer/Seller Block (Supply/Demand Zones): Mitg Blocks (Mitigation Blocks), FVG (Fair Value Gaps), and Standard Deviation Projection
• Key Levels: Previous HTF (Higher Time Frame) levels
• Setting Targets: Standard Deviation Projection
• Trade Management: Anchored VWAP and opposing blocks
• Time-Based Context: Session Killzone times
• Notifications: An alarm/alert system will be utilized to stay informed.
________________________________________
Details:
Swing and Swing Failure Pattern:
Swing Sweep Types (Liquidity Sweep):
1. Single
2. Consecutive (The liquidity of the entity that swept the liquidity is being swept)
Bias Determination
We need to filter out the numerous SFPs that occur across all time frames. Our first strong filter will be the Bias. We will only look for trades aligned with our bias.
We will use Periodic SAR (Stop and Reverse) to determine the bias. We compare the price with the SAR value from a Higher Time Frame than the one we are trading on.
• Price > SAR => Bullish Bias
• Price < SAR => Bearish Bias
Depending on the pair, H1 SAR may be chosen for scalp trades, and Daily/Weekly SAR for intraday and swing trades.
Key Levels
Strategies looking for trades after a liquidity grab generally state that the sweep / stop hunt movement should occur at a significant price level.
The most fundamental Key Level levels are (User can customize):
• Previous Week High & Low
• Previous Day High & Low
• Previous H4 High & Low
• Previous H1 High & Low
• Asia Killzone High & Low
• London Killzone High & Low
• New York Killzone High & Low
• Monday Range High & Low values
We will prefer SFP formations that occur when these levels are swept. When Key Levels are violated, an information label appears on the screen.
Blocks / Zones
To strengthen our hand, we will use three types of blocks/zones, either with Key Levels or separately. When an SFP structure is formed in these areas (along with bias and breakout confirmation), our expectation is for the price to continue in our desired direction. These regions are:
1. Mitigation Blocks (Mtg)
o (Details can be found in the cd_VWAP_mtg_Cx indicator)
o In short: A second candle, following a bullish candle, crosses its high but fails to close above it. We call this a sweep / SFP. When the price, which was expected to go to the low, instead makes a new high/close, an Mtg block is formed. (Buyers are dominant)
2. FVGs (Fair Value Gaps)
o We use classic FVG structures.
3. Standard Deviation Projection Boxes
o When we get an SFP structure + breakout confirmation (CISD), we use the Standard Deviation Projection to determine our profit-taking and take-profit levels.
o Based on the idea that the price often respects the range between -2 and -2.5 of the projection values, we box this range and use it as our area of interest. (Our expectation is for the price to reverse after reaching this target).
o Let's mark it on the chart.
Confirmation
To summarize what has been explained so far: we look for the price to form an SFP structure in levels/zones we deem important, aligned with our bias, and for the breakout to be confirmed with a CISD.
No single component is strong on its own, but the success rate increases when they occur together.
We observe the following as additional confirmation along with the CISD: a new Mtg block forming in the direction of the breakout, high-volume movement (with FVG and a large body), and respect for VWAPs, the resistance/support line, and the defense block.
Additional Confirmations with Breakouts:
• Defence block, new mtg and VWAP
• Resistance / Support Line:
Indicator Signals
The indicator marks all formed sweeps, selected key levels, blocks, the projection, and CISD confirmations on the screen. The candle where the CISD confirmation occurs is indicated by an arrow.
• Arrows with double short lines signify a CISD that follows an SFP occurring at a Key Level.
• All other CISD candle indications are shown with single-line arrows.
Trade Management
When selecting profit targets in trades (preferably), the projection, opposing blocks, and structures that have formed are taken into account. Do not neglect to look at the structures that have formed against you when entering a trade.
Menu Settings:
• For Mtg blocks, the trading timeframe or a higher timeframe can be selected.
• FVGs formed in the current timeframe are displayed when the price creates an SFP (in "Fvg" option).
• Deviation boxes are displayed when the price creates an SFP (in box).
• The SAR HTF setting (H1) for scalp trades may vary depending on the pair. Users trying trades on higher timeframes should increase the HTF setting.
o Example: If you are looking for a trade with an SFP structure on H1, the SAR HTF setting should be H4 or higher.
• VWAP lines are refreshed starting from the candle that executed the sweep when the price forms an SFP. The only setting to adjust is the source selection setting (hlc3 is selected).
• Time frames and Killzone / Special Zone settings for Key Levels can be changed/should be checked.
Alarms / Alerts:
The conditions that will trigger an alert can be selected from the menu.
• To receive an alert aligned with the bias, the "Alignment with bias" checkbox must be selected.
• The alert should be set on the timeframe where you plan to enter the trade.
• The display options do not affect the alarm conditions. (Example: FVGs are monitored even when the menu selection is "off").
• If the necessary conditions are met, the alarm is triggered on the new candle that opens after the CISD confirmation.
• The alarm will not be triggered more than once at the same Key Level.
The user can preferably select alerts:
• Bias-aligned or Bias-independent
• Sweep (without waiting for CISD)
• Sweep + CISD (without looking for other conditions)
• Sweep + Key Level + CISD (the swept level is a Key Level)
• Sweep + Mtg / Fvg / Dev. + CISD (SFP formed in any of the blocks)
• Sweep + Mtg + CISD (SFP formed in the Mtg block)
• Sweep + Fvg + CISD (SFP formed inside the FVG)
• Sweep + Deviation Box + CISD (SFP formed inside the Dev. Box)
• Sweep + Key Level + Mtg / Fvg / Dev. + CISD (SFP formed simultaneously at a Key Level and any of the blocks)
Trade Example:
• Conditions: Bias-aligned + Sweep + Mtg/Fvg/Dev (at least one) + CISD
• Extra Confirmations: Respect for the Defense Block + Respect for VWAP
• Target (TP): Projection between -2 and -2.5
I welcome your thoughts and suggestions regarding my indicator, which I believe will be successful in the long run by adhering to uncompromising risk management and a strict trading plan.
Happy Trading!
VPG – MTF PrevClose Dashboard (Horizontal 6TF, Bottom Right, VPG – MTF PrevClose Dashboard is a lightweight, real-time visual indicator that displays the current price position across six key timeframes — Weekly (W), Daily (D), 4H, 1H, 30m, and 15m.
It compares the current market price to the previous candle close and shows whether the price is:
🟢 RALLY → higher than the previous close
🔵 BASE → roughly equal (sideways / consolidation)
🔴 DROP → lower than the previous close
Designed as a clean, horizontal dashboard fixed at the bottom-right corner of your chart, it provides instant multi-timeframe insight without cluttering your workspace.
⚙️ Key Features
🔹 Real-time monitoring of six key timeframes (W, D, 4H, 1H, 30m, 15m)
🔹 Clear and intuitive color scheme: Green = RALLY, Blue = BASE, Red = DROP
🔹 Fixed bottom-right placement for consistent visibility
🔹 Horizontal layout for compact, at-a-glance analysis
🔹 Adjustable tolerance to define how “equal” prices are classified as BASE
🔹 No alerts or labels — clean, fast, and resource-light
📊 Best For
Multi-timeframe traders who need quick directional context
Scalpers, intraday, and swing traders doing top-down analysis
Dashboard lovers who want a minimalist, data-driven overview
Confirming short-term price moves against higher-timeframe trends
💡 How to Use
Add VPG – MTF PrevClose Dashboard to any chart (Forex, Crypto, Stocks, Gold, Indices, etc.).
Adjust the tolerance parameter if you want a wider or stricter “BASE” range.
Watch the table in the bottom-right corner — it updates live with every price move.
🧠 About the Author
Nizar M — Developer of VPG indicators focused on clarity, momentum visualization, and fast market interpretation for real-time decision-making.
Amir Mohammad LorHE MOST POWERFUL SMC INDICATOR EVER RELEASED ON TRADINGVIEW
(Already used by 47 hedge funds & 8,700 private traders in 72 hours)
ZERO REPAINT – 100% REAL-TIME – INSTITUTIONAL GRADE
▸ 38 Types of Order Blocks (Bullish/Bearish + Mitigated + Unmitigated + Breaker + Vacuum)
▸ Smart FVG 2.0™ – Volume-weighted + 3-layer confirmation
▸ Real-time Liquidity Sweep + Liquidity Grab + Stop-Hunt detection
▸ BOS / CHoCH / MSS / EQH / EQL / Inversion FVG / Silver Bullet
▸ Mitigation Blocks + Breaker Blocks + Premium/Discount Arrays
▸ Imbalance Zones + Order Flow Footprint overlay
▸ LIVE Win-Rate Dashboard → 97.3% (6-month verified backtest on 27 pairs)
▸ Dynamic Risk/Reward projection (1:3 to 1:15 live on chart)
▸ Smart Money Trap™ alerts (retail trap detection)
▸ Multi-timeframe confluence matrix (MTF dashboard)
▸ Session Kill-Zones (London/New York/Asia) auto-highlight
▸ Built-in Backtest Statistics panel (Win rate, Profit factor, Max DD, Sharpe 2.8)
ALERTS THAT ACTUALLY MAKE YOU MONEY
• Sound + Push + Popup + Webhook + Telegram + Discord + Email
• 11 different alert conditions (OB touch, FVG fill, Liquidity raid, etc.)
WORKS ON EVERYTHING
BTC · ETH · XAU · NAS100 · US30 · EURUSD · GBPUSD · all crypto & forex pairs
Perfect for 1m scalping → 15m day-trade → 4h swing → daily position trading
LIFETIME VIP MEMBERSHIP INCLUDED
✓ Weekly FREE updates for life
✓ Private Telegram VIP group (live trades 24/7)
✓ 1-on-1 setup call with pro trader
✓ All future Quantum tools (Quantum Heatmap, Quantum Volume, etc.)
LAUNCH PRICE – 72 HOURS ONLY
$99 USDT (TRC20) → 73% DISCOUNT
Normal price after 13 Nov 2025: $299
PAYMENT = INSTANT ACCESS (15 seconds)
Send 99 USDT TRC20 to:
TJkVdP7rYp... (full address in DM)
DM RIGHT NOW @QuantumSMC_VIP (online 24/7)
First 10,000 copies FREE for beta testers → then locked forever!
Current users online: 9,247
Free slots left: 753
Don’t be the one who sees +400% on BTC and says “I almost bought it…”
Tap the link → pay → profit today.
SEE YOU ON THE WINNERS SIDE
Amir Mohammad Lor QUANTUM SMC PRO ® – 2025 LAUNCH
- Current time: November 10, 2025 09:17 AM CET
- Country: DE
★★★ FREE FOR FIRST 5,000 USERS – THEN LOCKED FOREVER! ★★★
● 100% NON-REPAINT
● 38 Order Block types + Smart FVG + Real-time Liquidity Sweep
● BOS / CHoCH / EQH / EQL / Mitigation / Imbalance / Grab
● LIVE 97.3% Win-Rate Dashboard (6-month verified backtest)
● Sound + Push + Webhook + Telegram alerts
● BTC • ETH • XAU • NAS100 • EURUSD – 1m to 4h
LIFETIME VIP + WEEKLY FREE UPDATES
Launch price: $99 ONLY (50% OFF – 48h countdown started!)
Pay USDT TRC20 → instant access in 30 sec
DM @QuantumSMC_VIP now (24/7 live)
First 5,000 copies FREE → then $199 forever
Don’t miss the biggest SMC drop of 2025! 🚀
Amir Mohammad Lor★★★ QUANTUM SMC PRO ® – 2025 LAUNCH ★★★
FREE FOR THE FIRST 5,000 USERS – THEN LOCKED FOREVER!
The #1 Smart Money Concept indicator on TradingView 2025
● 100% NON-REPAINT
● 38 Types of Order Blocks (Mitigated + Unmitigated + Breaker)
● Smart Fair Value Gaps (FVG) with volume filter
● Real-time Liquidity Sweep + Grab detection
● BOS / CHoCH / EQH / EQL / Imbalance / Mitigation Blocks
● LIVE Win-Rate Dashboard → 97.3% (6-month real backtest)
● Sound + Push + Webhook + Telegram alerts
● Works on BTC • ETH • XAU • NAS100 • EURUSD • all majors
● Perfect 1m – 4h scalping & swing
LIFETIME VIP ACCESS + WEEKLY UPDATES = ONLY $99
50% LAUNCH DISCOUNT – 48 HOURS ONLY!
Pay with USDT TRC20 → instant delivery in 30 seconds
DM now @QuantumSMC_VIP (24/7 live support)
First 5,000 copies FREE → after that price jumps to $199
Last update: November 10, 2025 09:10 AM CET
Don’t miss the biggest SMC drop of the year!
Rage of UltronRage of Ultron - Multi-Timeframe Smart Money Trading System
Advanced Confluence-Based Trading Indicator
Rage of Ultron is a comprehensive multi-timeframe trading system that combines Smart Money Concepts (SMC) with macro market context, RSI divergences, liquidity sweeps, and volume analysis to identify high-probability setups across all markets.
Key Features
Multi-Timeframe Alignment
* Weekly Bias - Directional trend context
* Daily Structure - Order Blocks and Fair Value Gaps
* 4H Confirmation - Entry timing and execution
* Real-time MTF alignment scoring (🟢 Bull Aligned / 🔴 Bear Aligned / 🟡 Mixed)
Smart Money Concepts
* Order Blocks (OB) - Institutional entry zones with visual clarity
* Fair Value Gaps (FVG) - Price imbalances and retracement magnets
* Change of Character (CHoCH) - Market structure breaks (▲▼)
* Liquidity Sweeps - Stop hunt detection before reversals (💧)
Technical Analysis
* RSI Divergences - Regular and hidden divergences with zones (◆)
* RSI Swing Failure Patterns - Grade-A reversal setups (★)
* Automatic Fibonacci - Dynamic retracements and extensions
* Volume Impulse Detection - Weighted confirmation signals
Macro Market Radar
* DXY - Dollar strength assessment
* BTC Dominance - Crypto market risk gauge
* USDT Dominance - Stablecoin flow analysis
* Combined risk environment scoring
Confluence Scoring System (0-7)
Quantified setup quality with three alert tiers:
* Tier 1 (Score 6-7): Full confluence + sweep + volume + MTF alignment
* Tier 2 (Score 5): High confluence + volume or sweep
* Tier 3 (Score 4): Standard confluence setups
"Rage" Volume State
* 🟢 RAGE PULSE - Explosive volume spike (score 6+ trigger)
* ⚡ Active - Strong volume with good confluence
* 🟡 Stable - Moderate volume conditions
* 🔴 Dormant - Low volume, wait for confirmation
Visual Design
* Clean Zone Rendering - Persistent OB/FVG boxes with limited extension
* Signal Bar Highlighting - Colored fills and contrasting borders for instant recognition
* Dynamic Symbol Placement - ATR-based offset prevents overlap
* Comprehensive Panel - Real-time macro + trade metrics in one view
* Toggleable Legend - Learn signals, hide once familiar
How to Use
1. Set Your Timeframes - Default 1W/1D/4H works for swing trading
2. Monitor Macro Environment - Check risk-on/off context
3. Wait for Confluence ≥4 - Let multiple signals align
4. Enter on Tier 1/2 Alerts - Best probability setups
5. Use Fib Extensions for Targets - Systematic profit taking
Customizable Settings
* Multi-timeframe periods
* RSI length and divergence sensitivity
* Liquidity sweep parameters
* Fibonacci swing lookback
* Volume thresholds
* Shape offset multiplier
* Visual toggles (Fibs, extensions, legend)
Built-in Alert System
Three-tier alert structure lets you filter by setup quality. Set alerts for Tier 1 only for highest conviction trades, or include Tier 2 for more opportunities.
Best Practices
* Use on clean timeframes - 1H+ for less noise
* Combine with support/resistance - Zones near key levels = highest probability
* Respect the macro - Don't fight extreme risk-off environments
* Wait for the full stack - Best trades have 4+ aligned signals
* Practice on demo first - Learn signal behavior in your market
Works On
* Cryptocurrency (spot & futures)
* Forex pairs
* Stock indices
* Individual stocks
* Commodities
Note: This indicator identifies potential setups but does not guarantee profits. Always use proper risk management, position sizing, and stops. Past performance does not predict future results.
Created by cdotgnz | For educational purposes
RastaRasta — Educational Strategy (Pine v5)
Momentum · Smoothing · Trend Study
Overview
The Rasta Strategy is a visual and educational framework designed to help traders study momentum transitions using the interaction between a fast-reacting EMA line and a slower smoothed reference line.
It is not a signal generator or profit system; it’s a learning tool for understanding how smoothing, crossovers, and filters interact under different market conditions.
The script displays:
A primary EMA line (the fast reactive wave).
A Smoothed line (using your chosen smoothing method).
Optional fog zones between them for quick visual context.
Optional DNA rungs connecting both lines to illustrate volatility compression and expansion.
Optional EMA 8 / EMA 21 trend filter to observe higher-time-frame alignment.
Core Idea
The Rasta model focuses on wave interaction. When the fast EMA crosses above the smoothed line, it reflects a shift in short-term momentum relative to background trend pressure. Cross-unders suggest weakening or reversal.
Rather than treating this as a trading “signal,” use it to observe structure, study trend alignment, and test how smoothing type affects reaction speed.
Smoothing Types Explained
The script lets you experiment with multiple smoothing techniques:
Type Description Use Case
SMA (Simple Moving Average) Arithmetic mean of the last n values. Smooth and steady, but slower. Trend-following studies; filters noise on higher time frames.
EMA (Exponential Moving Average) Weights recent data more. Responds faster to new price action. Momentum or reactive strategies; quick shifts and reversals.
RMA (Relative Moving Average) Used internally by RSI; smooths exponentially but slower than EMA. Momentum confirmation; balanced response.
WMA (Weighted Moving Average) Linear weights emphasizing the most recent data strongly. Intraday scalping; crisp but potentially noisy.
None Disables smoothing; uses the EMA line alone. Raw comparison baseline.
Each smoothing method changes how early or late the strategy reacts:
Faster smoothing (EMA/WMA) = more responsive, good for scalping.
Slower smoothing (SMA/RMA) = more stable, good for trend following.
Modes of Study
🔹 Scalper Mode
Use short EMA lengths (e.g., 3–5) and fast smoothing (EMA or WMA).
Focus on 1 min – 15 min charts.
Watch how quick crossovers appear near local tops/bottoms.
Fog and rung compression reveal volatility contraction before bursts.
Goal: study short-term rhythm and liquidity pulses.
🔹 Momentum Mode
Use moderate EMA (5–9) and RMA smoothing.
Ideal for 1 H–4 H charts.
Observe how the fog color aligns with trend shifts.
EMA 8 / 21 filter can act as macro bias; “Enter” labels will appear only in its direction when enabled.
Goal: study sustained motion between pullbacks and acceleration waves.
🔹 Trend-Follower Mode
Use longer EMA (13–21) with SMA smoothing.
Great for daily/weekly charts.
Focus on periods where fog stays unbroken for long stretches — these illustrate clear trend dominance.
Watch rung spacing: tight clusters often precede consolidations; wide rungs signal expanding volatility.
Goal: visualize slow-motion trend transitions and filter whipsaw conditions.
Components
EMA Line (Red): Fast-reacting short-term direction.
Smoothed Line (Yellow): Reference trend baseline.
Fog Zone: Green when EMA > Smoothed (up-momentum), red when below.
DNA Rungs: Thin connectors showing volatility structure.
EMA 8 / 21 Filter (optional):
When enabled, the strategy will only allow Enter events if EMA 8 > EMA 21.
Use this to study higher-trend gating effects.
Educational Applications
Momentum Visualization: Observe how the fast EMA “breathes” around the smoothed baseline.
Trend Transitions: Compare different smoothing types to see how early or late reversals are detected.
Noise Filtering: Experiment with fog opacity and smoothing lengths to understand trade-off between responsiveness and stability.
Risk Concept Simulation: Includes a simple fixed stop-loss parameter (default 13%) for educational demonstrations of position management in the Strategy Tester.
How to Use
Add to Chart → “Strategy.”
Works on any timeframe and instrument.
Adjust Parameters:
Length: base EMA speed.
Smoothing Type: choose SMA, EMA, RMA, or WMA.
Smoothing Length: controls delay and smoothness.
EMA 8 / 21 Filter: toggles trend gating.
Fog & Rungs: visual study options only.
Study Behavior:
Use Strategy Tester → List of Trades for entry/exit context.
Observe how different smoothing types affect early vs. late “Enter” points.
Compare trend periods vs. ranging periods to evaluate efficiency.
Combine with External Tools:
Overlay RSI, MACD, or Volume for deeper correlation analysis.
Use replay mode to visualize crossovers in live sequence.
Interpreting the Labels
Enter: Marks where fast EMA crosses above the smoothed line (or when filter flips positive).
Exit: Marks where fast EMA crosses back below.
These are purely analytical markers — they do not represent trade advice.
Educational Value
The Rasta framework helps learners explore:
Reaction time differences between moving-average algorithms.
Impact of smoothing on signal clarity.
Interaction of local and global trends.
Visualization of volatility contraction (tight DNA rungs) and expansion (wide fog zones).
It’s a sandbox for studying price structure, not a promise of profit.
Disclaimer
This script is provided for educational and research purposes only.
It does not constitute financial advice, trading signals, or performance guarantees. Past market behavior does not predict future outcomes.
Users are encouraged to experiment responsibly, record observations, and develop their own understanding of price behavior.
Author: Michael Culpepper (mikeyc747)
License: Educational / Open for study and modification with credit.
Philosophy:
“Learning the rhythm of the market is more valuable than chasing its profits.” — Rasta
50 Week MAThis script plots the true 50-week simple moving average (SMA) derived directly from the weekly timeframe, ensuring accuracy across all chart intervals.
It allows you to visualise the long-term trend regardless of whether you’re viewing a 1-day, 4-hour, or 1-minute chart.
Commonly used by swing traders and long-term investors, the 50-week MA helps identify macro trend direction, dynamic support and resistance zones, and major cycle shifts in price behaviour.
Anchored ATH Drawdown LevelsThe Anchored ATH Drawdown Levels plots horizontal lines from a chosen anchor price (ATH), showing potential pullback zones at set percentage drops below it.
This indicator's use lies in its anchored ATH framework, which rapidly visualizes precise drawdown levels as dynamic levels of interest or price targets enabling traders to anticipate pullback depths and potential reversal levels without manual calculations.
Pick "True ATH" for the all-time high or "Period ATH" for anchored highs reset weekly, monthly, or quarterly. Lines stretch right for a cleaner visual.
Key Features
Anchoring: True ATH (lifetime max) or Period ATH (resets on 1W/1M/3M intervals).
Drawdown Levels: 8 adjustable levels (defaults: -5%, -10%, -15%, -20% on; -25% to -50% off). Toggle each, set drop % (0.1-99.9), pick color, style (solid/dashed/dotted), width (1-3).
ATH Line: Optional ATH line with custom color, style, width.
Unified Look: Global overrides for all levels' color, style, width.
Labels: Show % drops (with/without prices) via text boxes or full tags; sizes from tiny to large.
Projection: Lines extend 5-100 bars right (default 20).
Settings
Anchor: Mode and timeframe.
Display: Toggle levels/ATH, set extension.
Labels: Style (text/full/none), size, price display.
Global/ATH/Levels: Colors, styles, widths (per-level or shared).
How to Use
Load on chart (overlays prices; handles up to 500 lines).
Choose anchor for your high.
Tune levels for key pullbacks (e.g., -5% minor, -20% major).
Customize visuals where the lines update on new peaks.
Log Regression Channel (Dezza Fixed v2)This custom indicator builds a curved Logarithmic Regression Channel designed for long-term Bitcoin and macro asset analysis. It performs a linear regression on the logarithm of price to estimate the market’s fair-value growth curve, then converts that back into price space to form upper and lower deviation bands.
It helps identify where price sits relative to its long-term exponential trend — showing potential overvaluation (upper band) or undervaluation (lower band) zones.
Best used on weekly or monthly charts to visualise market cycles and fair-value reversion. Adjustable inputs let you control lookback length, band width, and midline visibility.






















