חפש סקריפטים עבור "daily"
Daily Returns & STDWhat happened last time when xx increased by xx%? - Start collecting some stats!
You can choose the ticker and the timeframe you're interested in
RSI Oversold/UndersoldThe study script will place GREEN BUY arrows BELOW oversold conditions and RED SHORT arrows ABOVE overbought conditions. You can configure the period
Most RSI(14) indicators use a 14-period, I prefer a 5-period. The period, overbought and oversold periods are settings that can easily be changed by adding this study to your chart and clicking the "gear" icon next to the study inside your chart.
Daily SMAThis pine script on intraday chart is exactly the same SMA as built-in MovingAverage on a 1Day chart (with the same lengths)
Wyckoff Method - Comprehensive Analysis# WYCKOFF METHOD - QUICK REFERENCE CHEAT SHEET
## 🟢 STRONGEST BUY SIGNALS
### 1. SPRING ⭐⭐⭐⭐⭐
- **What:** False breakdown below support on LOW volume
- **Look for:** Quick reversal, close above support
- **Entry:** When price closes back in range
- **Stop:** Below spring low
- **Target:** Top of range minimum
### 2. SOS (Sign of Strength) ⭐⭐⭐⭐
- **What:** Breakout above resistance on HIGH volume
- **Look for:** Wide spread up bar, strong close
- **Entry:** On breakout or wait for LPS pullback
- **Stop:** Below range top
- **Target:** Height of range projected up
### 3. SHAKEOUT ⭐⭐⭐⭐
- **What:** Sharp move below support with HIGH volume, immediate reversal
- **Look for:** Long lower wick, closes strong
- **Entry:** When price reclaims support
- **Stop:** Below shakeout low
- **Target:** Previous resistance
---
## 🔴 STRONGEST SELL SIGNALS
### 1. UTAD (Upthrust After Distribution) ⭐⭐⭐⭐⭐
- **What:** False breakout above resistance, quick rejection
- **Look for:** Spike high, weak close, often high volume
- **Entry:** When price closes back in range
- **Stop:** Above UTAD high
- **Target:** Bottom of range minimum
### 2. SOW (Sign of Weakness) ⭐⭐⭐⭐
- **What:** Breakdown below support on HIGH volume
- **Look for:** Wide spread down bar, weak close
- **Entry:** On breakdown or wait for LPSY rally
- **Stop:** Above range bottom
- **Target:** Height of range projected down
### 3. UPTHRUST ⭐⭐⭐⭐
- **What:** Move above resistance on LOW volume, weak close
- **Look for:** Long upper wick, closes in lower half
- **Entry:** When resistance holds
- **Stop:** Above upthrust high
- **Target:** Support level
---
## 📊 ACCUMULATION PHASES (Bottom Formation)
```
PHASE A: Stopping the Downtrend
├─ PS (Preliminary Support) - First buying
├─ SC (Selling Climax) - Panic bottom ⚠️ KEY EVENT
├─ AR (Automatic Rally) - Relief bounce
└─ ST (Secondary Test) - Retest SC low
PHASE B: Building the Cause
├─ Trading range forms
├─ Multiple tests of support
├─ Volume decreasing
└─ Absorption occurring
PHASE C: The Test
├─ SPRING - False breakdown ⚠️ KEY EVENT
└─ TEST - Support holds on low volume
PHASE D: Dominance Emerges
├─ SOS - Breakout ⚠️ KEY EVENT
├─ LPS - Last Point of Support (pullback)
└─ BU - Backup
PHASE E: Markup
└─ New uptrend, strong momentum
```
**Background Color:** Blue → Green (getting brighter)
**Action:** Buy in Phase C/D, Hold through Phase E
---
## 📊 DISTRIBUTION PHASES (Top Formation)
```
PHASE A: Stopping the Uptrend
├─ PSY (Preliminary Supply) - First selling
├─ BC (Buying Climax) - Euphoric top ⚠️ KEY EVENT
├─ AR (Automatic Reaction) - Sharp drop
└─ ST (Secondary Test) - Retest BC high
PHASE B: Building the Cause
├─ Trading range forms
├─ Multiple tests of resistance
├─ Demand being absorbed
└─ Volume patterns change
PHASE C: The Test
└─ UTAD - False breakout ⚠️ KEY EVENT
PHASE D: Dominance Emerges
├─ SOW - Breakdown ⚠️ KEY EVENT
└─ LPSY - Last Point of Supply (rally to exit)
PHASE E: Markdown
└─ New downtrend, strong selling
```
**Background Color:** Orange → Red (getting darker)
**Action:** Sell in Phase C/D, Stay out during Phase E
---
## 💰 VOLUME SPREAD ANALYSIS (VSA)
| Signal | Meaning | Color | Implication |
|--------|---------|-------|-------------|
| **ND** (No Demand) | Up bar, LOW volume | 🟠 Orange | Weakness - uptrend ending |
| **NS** (No Supply) | Down bar, LOW volume | 🔵 Blue | Strength - downtrend ending |
| **SV** (Stopping Volume) | VERY HIGH volume, narrow spread | 🟣 Purple | Potential reversal |
| **UT** (Upthrust) | Above resistance, LOW vol, weak close | 🔴 Red | Sell signal |
| **SO** (Shakeout) | Below support, HIGH vol, strong close | 🟢 Green | Buy signal |
---
## 🎯 VOLUME INTERPRETATION
| Volume Level | Bar Color | Meaning |
|--------------|-----------|---------|
| **VERY HIGH** (>2x average) | Dark Green/Red | Climax, potential reversal |
| **HIGH** (>1.5x average) | Light Green/Red | Strong interest |
| **NORMAL** | Gray | Average trading |
| **LOW** (<0.7x average) | Faint Gray | Testing, no interest |
---
## ⚖️ EFFORT vs RESULT
| Scenario | Volume | Spread | Meaning |
|----------|--------|--------|---------|
| **High Effort, Low Result** | HIGH | Narrow | ⚠️ Potential reversal |
| **Low Effort, High Result** | LOW | Wide | ⚠️ Trend weakening |
| **High Effort, High Result** | HIGH | Wide | ✅ Strong trend |
| **Low Effort, Low Result** | LOW | Narrow | 😴 No interest |
---
## 📏 TRADING RULES
### ✅ DO:
- ✅ Wait for confirmation before entering
- ✅ Trade in direction of higher timeframe
- ✅ Use springs and UTAD as primary signals
- ✅ Measure trading range for targets
- ✅ Place stops outside the range
- ✅ Look for volume confirmation
- ✅ Check multiple timeframes
- ✅ Focus on Phase C and D events
### ❌ DON'T:
- ❌ Buy during Phase E Markdown
- ❌ Sell during Phase E Markup
- ❌ Trade against major trend
- ❌ Ignore volume signals
- ❌ Enter without clear stop loss
- ❌ Trade every signal
- ❌ Use on very low timeframes without practice
- ❌ Ignore the context
---
## 🎪 COMPOSITE OPERATOR (Smart Money)
### 💰 Green Money Symbol (Bottom)
- **Meaning:** Institutions accumulating
- **Location:** Demand zones, springs, tests
- **Action:** Follow the smart money - buy
### 💰 Red Money Symbol (Top)
- **Meaning:** Institutions distributing
- **Location:** Supply zones, UTAD, weak rallies
- **Action:** Follow the smart money - sell
---
## 📍 SUPPLY & DEMAND ZONES
### 🟢 Demand Zones (Green Boxes)
- **Created at:** SC, Spring, Shakeout
- **Represents:** Where smart money bought
- **Action:** Look for bounces
### 🔴 Supply Zones (Red Boxes)
- **Created at:** BC, UTAD, Upthrust
- **Represents:** Where smart money sold
- **Action:** Look for rejections
---
## 🎯 TARGET CALCULATION
### Measured Move Method
```
1. Measure trading range height
Example: Top at 120, Bottom at 100 = 20 points
2. Add to breakout point (accumulation)
Breakout at 120 + 20 = Target: 140
3. Or subtract from breakdown (distribution)
Breakdown at 100 - 20 = Target: 80
```
### Multiple Targets
- **Conservative:** 1x range height (100% probability reached)
- **Moderate:** 1.5x range height (70% probability)
- **Aggressive:** 2x range height (40% probability)
---
## ⏰ TIMEFRAME GUIDE
| Timeframe | Use For | Reliability | Recommended For |
|-----------|---------|-------------|-----------------|
| **Weekly** | Major trends | ⭐⭐⭐⭐⭐ | Position traders |
| **Daily** | Swing trades | ⭐⭐⭐⭐⭐ | Most traders |
| **4-Hour** | Active swing | ⭐⭐⭐⭐ | Active traders |
| **1-Hour** | Day trading | ⭐⭐⭐ | Experienced only |
| **15-Min** | Scalping | ⭐⭐ | Experts only |
**Golden Rule:** Always check one timeframe higher for context!
---
## 🚨 ALERT PRIORITY
### 🔔 MUST-HAVE ALERTS
1. Spring
2. UTAD
3. SOS
4. SOW
### 🔔 NICE-TO-HAVE ALERTS
5. Selling Climax (SC)
6. Buying Climax (BC)
7. Smart Money Accumulation
8. Smart Money Distribution
### 🔔 CONFIRMATION ALERTS
9. Phase E Markup
10. Phase E Markdown
---
## 💡 QUICK DECISION TREE
```
Is there a clear trading range?
├─ YES
│ ├─ Did price break BELOW support?
│ │ ├─ Volume LOW + Quick reversal = SPRING → BUY ✅
│ │ └─ Volume HIGH + Stays down = Breakdown → SELL ⚠️
│ │
│ └─ Did price break ABOVE resistance?
│ ├─ Volume LOW + Quick reversal = UTAD → SELL ✅
│ └─ Volume HIGH + Stays up = Breakout → BUY ⚠️
│
└─ NO
├─ Strong uptrend = Wait for re-accumulation
└─ Strong downtrend = Wait for re-distribution
```
---
## 📝 PRE-TRADE CHECKLIST
Before entering any trade:
- Identified the current Wyckoff phase
- Confirmed with volume analysis
- Checked higher timeframe trend
- Located supply/demand zones
- Identified clear entry point
- Set stop loss level
- Calculated target (risk:reward >1:2)
- Verified position size (risk 1-2%)
- Have at least 2 confirming signals
- Not trading against major trend
---
## 🧠 REMEMBER
**The Three Laws:**
1. **Supply & Demand** - Price is determined by imbalance
2. **Cause & Effect** - Range size predicts move size
3. **Effort & Result** - Volume should confirm price movement
**The Key Principle:**
> "Trade with the Composite Operator (smart money), not against them"
**Best Setups:**
1. Spring in accumulation (Phase C)
2. UTAD in distribution (Phase C)
3. SOS breakout (Phase D)
4. SOW breakdown (Phase D)
**When in Doubt:**
- ❓ Stay out
- 📈 Use higher timeframe
- 📚 Review the documentation
- 🎯 Wait for clearer signal
---
## 📱 INDICATOR SETTINGS QUICK SETUP
**For Stocks/Crypto (Good Volume Data):**
- Volume MA Length: 20
- High Volume Multiplier: 1.5
- Climax Volume: 2.0
- Swing Length: 5
**For Forex (Limited Volume Data):**
- Volume MA Length: 20
- High Volume Multiplier: 1.3
- Climax Volume: 1.8
- Swing Length: 7
- Turn OFF "Volume Confirmation"
**For Day Trading:**
- Swing Length: 3
- All other settings: Default
**For Position Trading:**
- Swing Length: 7-10
- Volume MA Length: 30
- Use Daily/Weekly charts
---
## 🎓 SKILL PROGRESSION
### Beginner (Month 1-2)
- Focus on: SC, Spring, SOS
- Timeframe: Daily only
- Goal: Identify phases correctly
### Intermediate (Month 3-6)
- Add: All accumulation events
- Timeframe: Daily + 4H
- Goal: Trade springs profitably
### Advanced (Month 6-12)
- Add: Distribution events, VSA
- Timeframe: Multiple timeframes
- Goal: Trade complete cycles
### Expert (Year 2+)
- Master: All events, all timeframes
- Combine: With other methodologies
- Goal: Consistent profitability
---
**Print this sheet and keep it next to your trading desk!**
*Remember: Quality over quantity. Wait for the best setups.*
# Wyckoff Method - Comprehensive Analysis Indicator
## Complete Implementation Guide for TradingView Pine Script
---
## TABLE OF CONTENTS
1. (#overview)
2. (#installation)
3. (#theory)
4. (#components)
5. (#signals)
6. (#strategies)
7. (#settings)
8. (#alerts)
9. (#patterns)
10. (#troubleshooting)
---
## OVERVIEW
This indicator implements Richard Wyckoff's complete trading methodology, including:
- **All 5 Phases** of Accumulation and Distribution
- **18+ Wyckoff Events** (PS, SC, AR, ST, Spring, SOS, LPS, BC, UTAD, SOW, etc.)
- **Volume Spread Analysis (VSA)** principles
- **Supply & Demand Zone** detection
- **Composite Operator** logic (Smart Money tracking)
- **Effort vs Result** analysis
- **Three Wyckoff Laws**: Supply/Demand, Cause/Effect, Effort/Result
---
## INSTALLATION
### Step 1: Copy the Code
1. Open the `wyckoff_comprehensive.pine` file
2. Select all code (Ctrl+A / Cmd+A)
3. Copy to clipboard (Ctrl+C / Cmd+C)
### Step 2: Add to TradingView
1. Go to TradingView.com
2. Open any chart
3. Click "Pine Editor" at the bottom of the screen
4. Click "New" or "Open"
5. Paste the entire code
6. Click "Save" and give it a name
7. Click "Add to Chart"
### Step 3: Verify Installation
You should see:
- Labels on the chart (PS, SC, Spring, SOS, etc.)
- Background colors indicating phases
- Volume analysis in the lower pane
- A table in the top-right corner showing current phase
---
## WYCKOFF METHOD THEORY
### The Three Fundamental Laws
#### 1. **Law of Supply and Demand**
- Price rises when demand exceeds supply
- Price falls when supply exceeds demand
- The indicator tracks volume vs price movement to identify imbalances
#### 2. **Law of Cause and Effect**
- A period of accumulation (cause) leads to markup (effect)
- A period of distribution (cause) leads to markdown (effect)
- Trading ranges build "cause" for future price movement
#### 3. **Law of Effort vs Result**
- **Effort** = Volume (energy put into the market)
- **Result** = Price movement (spread of the bar)
- High effort with low result = potential reversal
- Low effort with high result = trend weakness
### The Five Phases
#### **ACCUMULATION CYCLE**
**Phase A: Stopping the Downtrend**
- Preliminary Support (PS): First sign of buying
- Selling Climax (SC): Panic selling exhaustion
- Automatic Rally (AR): Bounce from SC
- Secondary Test (ST): Test of SC low on lower volume
**Phase B: Building the Cause**
- Trading range develops
- Supply being absorbed by composite operator
- Multiple tests of support and resistance
- Volume generally decreases
**Phase C: The Test (Spring)**
- False breakdown below support
- Traps late sellers
- Quick reversal on low volume
- Last chance to accumulate before markup
**Phase D: Dominance Emerges**
- Sign of Strength (SOS): Break above resistance
- Last Point of Support (LPS): Pullback opportunity
- Backup (BU): Final consolidation
- Demand clearly exceeds supply
**Phase E: Markup**
- New uptrend established
- Price moves rapidly higher
- Phase E can last months/years
- Original trading range becomes support
#### **DISTRIBUTION CYCLE**
**Phase A: Stopping the Uptrend**
- Preliminary Supply (PSY): First sign of selling
- Buying Climax (BC): Euphoric buying exhaustion
- Automatic Reaction (AR): Sharp selloff from BC
- Secondary Test (ST): Test of BC high on lower volume
**Phase B: Building the Cause**
- Trading range at top
- Demand being absorbed by composite operator
- Multiple tests of support and resistance
**Phase C: The Test (UTAD)**
- Upthrust After Distribution
- False breakout above resistance
- Traps late buyers
- Quick reversal
**Phase D: Dominance Emerges**
- Sign of Weakness (SOW): Break below support
- Last Point of Supply (LPSY): Rally opportunity to exit
- Supply clearly exceeds demand
**Phase E: Markdown**
- New downtrend established
- Price moves rapidly lower
- Original trading range becomes resistance
---
## INDICATOR COMPONENTS
### 1. EVENT LABELS
#### Accumulation Events (Green labels)
- **PS** = Preliminary Support
- **SC** = Selling Climax (largest label, most important)
- **AR** = Automatic Rally
- **ST** = Secondary Test
- **SPRING** = Spring (critical buy signal)
- **TEST** = Test of support
- **SOS** = Sign of Strength (breakout)
- **LPS** = Last Point of Support
- **BU** = Backup
#### Distribution Events (Red labels)
- **PSY** = Preliminary Supply
- **BC** = Buying Climax (largest label, most important)
- **AR** = Automatic Reaction
- **ST** = Secondary Test
- **UTAD** = Upthrust After Distribution (critical sell signal)
- **SOW** = Sign of Weakness
- **LPSY** = Last Point of Supply
#### VSA Events (Small colored labels)
- **ND** (Orange) = No Demand - weakness
- **NS** (Blue) = No Supply - strength
- **SV** (Purple) = Stopping Volume
- **UT** (Red) = Upthrust - weakness
- **SO** (Green) = Shakeout - strength
#### Composite Operator (💰 symbols)
- Green 💰 at bottom = Smart Money Accumulation
- Red 💰 at top = Smart Money Distribution
### 2. BACKGROUND COLORS
- **Light Blue** = Phase A (Accumulation)
- **Light Orange** = Phase A (Distribution)
- **Very Light Green** = Phase C (Accumulation Testing)
- **Very Light Red** = Phase C (Distribution Testing)
- **Light Green** = Phase D (Accumulation Strength)
- **Light Red** = Phase D (Distribution Weakness)
- **Green** = Phase E (Markup - Bull trend)
- **Red** = Phase E (Markdown - Bear trend)
### 3. SUPPLY & DEMAND ZONES
- **Green boxes** = Demand zones (where smart money accumulated)
- **Red boxes** = Supply zones (where smart money distributed)
- Zones extend 20 bars into the future
- Price reactions at these zones are significant
### 4. VOLUME PANEL
- **Dark Green/Red bars** = Very High Volume (climax)
- **Light Green/Red bars** = High Volume
- **Gray bars** = Normal Volume
- **Faint Gray bars** = Low Volume
- **Blue line** = Volume Moving Average
### 5. INFORMATION TABLE (Top Right)
Displays real-time analysis:
- **Current Phase** (A, B, C, D, or E)
- **Status** (description of what's happening)
- **Volume** (Very High, High, Normal, Low)
- **Spread** (Wide, Normal, Narrow)
- **Effort/Result** (Poor, Normal, Good)
- **Range** (YES if in trading range)
- **Bias** (BULLISH, BEARISH, or NEUTRAL)
---
## HOW TO READ THE SIGNALS
### STRONG BUY SIGNALS (in order of strength)
1. **SPRING** (strongest)
- False breakdown below support
- Look for: Low volume, quick reversal, close above support
- Entry: When price closes back above support level
- Stop: Below the spring low
2. **SOS (Sign of Strength)**
- Break above trading range resistance
- Look for: High volume, wide spread up bar
- Entry: On breakout or pullback to LPS
- Stop: Below trading range
3. **Shakeout (SO)**
- Similar to spring but more violent
- Look for: High volume, penetration of support, strong close
- Entry: When price reclaims support
- Stop: Below shakeout low
4. **LPS (Last Point of Support)**
- Pullback after SOS
- Look for: Low volume, shallow pullback
- Entry: When support holds
- Stop: Below LPS
5. **No Supply (NS)**
- Down bar on very low volume
- Indicates lack of selling pressure
- Confirms accumulation phase
### STRONG SELL SIGNALS (in order of strength)
1. **UTAD (Upthrust After Distribution)** (strongest)
- False breakout above resistance
- Look for: High volume spike, rejection, close below resistance
- Entry: When price closes back below resistance
- Stop: Above UTAD high
2. **SOW (Sign of Weakness)**
- Break below trading range support
- Look for: High volume, wide spread down bar
- Entry: On breakdown or rally to LPSY
- Stop: Above trading range
3. **Upthrust (UT)**
- Move above resistance on low volume, weak close
- Look for: Low volume, close in lower half of bar
- Entry: When resistance becomes resistance again
- Stop: Above upthrust high
4. **LPSY (Last Point of Supply)**
- Rally after SOW
- Look for: Low volume, weak rally
- Entry: When rally fails
- Stop: Above LPSY
5. **No Demand (ND)**
- Up bar on very low volume
- Indicates lack of buying pressure
- Confirms distribution phase
### NEUTRAL/WARNING SIGNALS
- **High Effort, Low Result** = Potential reversal coming
- **Stopping Volume** = Trend may be ending
- **Absorption** = Large volume with small movement (accumulation/distribution)
---
## TRADING STRATEGY EXAMPLES
### Strategy 1: Accumulation Range Breakout
**Setup:**
1. Identify trading range (blue background in Phase B)
2. Wait for Spring or Test (Phase C)
3. Wait for SOS breakout (Phase D)
**Entry:**
- Option A: Buy on SOS breakout
- Option B: Wait for LPS pullback (better risk/reward)
**Stop Loss:**
- Below the spring low or trading range bottom
**Target:**
- Measure height of trading range (cause)
- Project upward from breakout point (effect)
- Minimum target = range height
**Example:**
```
Trading Range: 100 to 120 (20 point range)
SOS Breakout at: 120
Target: 120 + 20 = 140 minimum
```
### Strategy 2: Distribution Range Breakdown
**Setup:**
1. Identify trading range after uptrend
2. Wait for UTAD (Phase C)
3. Wait for SOW breakdown (Phase D)
**Entry:**
- Option A: Sell on SOW breakdown
- Option B: Wait for LPSY rally (better risk/reward)
**Stop Loss:**
- Above the UTAD high or trading range top
**Target:**
- Measure height of trading range
- Project downward from breakdown point
- Minimum target = range height
### Strategy 3: Spring Trading
**Setup:**
1. Strong downtrend followed by range
2. Price breaks below range bottom
3. Volume is LOW on breakdown
4. Price quickly reverses and closes above support
**Entry:**
- When candle closes above support level
- Or on retest of support
**Stop Loss:**
- Below spring low (usually tight)
**Target:**
- Top of trading range
- Previous swing high
**Risk/Reward:**
- Typically 1:3 or better
### Strategy 4: Smart Money Tracking
**Setup:**
1. Look for 💰 symbols in demand zones
2. Multiple accumulation signals (PS, SC, ST, Test)
3. Volume decreasing during range
**Entry:**
- At next demand zone test
- On SOS breakout
**Confirmation:**
- Background turning green (Phase D/E)
- Table shows "BULLISH" bias
### Strategy 5: VSA Reversal
**Setup:**
1. Strong trend in place
2. Stopping Volume (SV) appears at extreme
3. Followed by No Demand (ND) or No Supply (NS)
**Entry:**
- When trend breaks down/up
- On retest of extreme
**Example (Bullish):**
```
Downtrend → Stopping Volume → No Supply → Up bar
Entry: Buy when price moves above SV bar
```
---
## SETTINGS & CUSTOMIZATION
### Volume Analysis Settings
**Volume MA Length** (default: 20)
- Shorter = More sensitive to volume changes
- Longer = Smoother, less noise
- Recommended: 15-25 for most timeframes
**High Volume Multiplier** (default: 1.5)
- Threshold for "high volume"
- Lower = More signals
- Higher = Only extreme volume
- Recommended: 1.3-2.0
**Climax Volume Multiplier** (default: 2.0)
- Threshold for climax events (SC, BC)
- Should be significantly higher than normal
- Recommended: 2.0-3.0
### Phase Detection Settings
**Swing Detection Length** (default: 5)
- How many bars to look left/right for swing points
- Shorter = More swings detected (more noise)
- Longer = Fewer swings (cleaner, might miss some)
- Recommended: 3-7
**Range Expansion Threshold** (default: 1.5)
- Multiplier for "wide spread" bars
- Higher = Only very wide bars qualify
- Recommended: 1.3-2.0
**Volume Confirmation** (default: ON)
- Requires volume confirmation for events
- Turn OFF for very low volume instruments
- Keep ON for stocks, forex, crypto
### Display Options
Toggle on/off:
- ✅ **Show Accumulation/Distribution Phases** - Background colors
- ✅ **Show Wyckoff Events** - All labeled events
- ✅ **Show Volume Spread Analysis** - VSA labels
- ✅ **Show Supply/Demand Zones** - Boxes on chart
- ✅ **Show Composite Operator Signals** - 💰 symbols
### Color Customization
- **Bullish Color** - All accumulation events
- **Bearish Color** - All distribution events
- **Neutral Color** - Range/neutral signals
---
## ALERT SETUP
### Available Alerts
1. **Selling Climax (SC)** - Potential bottom forming
2. **Spring** - Strong buy signal
3. **Sign of Strength (SOS)** - Bullish breakout
4. **Buying Climax (BC)** - Potential top forming
5. **UTAD** - Strong sell signal
6. **Sign of Weakness (SOW)** - Bearish breakdown
7. **Phase E Markup** - Uptrend confirmed
8. **Phase E Markdown** - Downtrend confirmed
9. **Smart Money Accumulation** - Institutions buying
10. **Smart Money Distribution** - Institutions selling
### How to Set Up Alerts
1. Click the "⏰" icon on TradingView
2. Select "Create Alert"
3. Condition: Choose the indicator and alert type
4. Example: "Wyckoff Method - Spring"
5. Set notification preferences (popup, email, webhook)
6. Click "Create"
### Recommended Alert Strategy
**Conservative Trader:**
- Spring
- SOS
- UTAD
- SOW
**Aggressive Trader:**
- Add: SC, BC, Smart Money signals
**Long-term Investor:**
- Phase E Markup
- Phase E Markdown
- Smart Money Accumulation
---
## COMMON PATTERNS
### Pattern 1: Classic Accumulation
```
Phase A: Downtrend → PS → SC → AR → ST
Phase B: Range building (4-12 weeks typical)
Phase C: Spring (false breakdown)
Phase D: SOS → LPS → BU
Phase E: Markup (new uptrend)
```
**What to do:**
- Mark the range boundaries
- Wait for spring
- Buy on LPS or SOS
- Hold through markup
### Pattern 2: Classic Distribution
```
Phase A: Uptrend → PSY → BC → AR → ST
Phase B: Range building (topping process)
Phase C: UTAD (false breakout)
Phase D: SOW → LPSY
Phase E: Markdown (new downtrend)
```
**What to do:**
- Mark the range boundaries
- Wait for UTAD
- Sell on LPSY or SOW
- Stay out during markdown
### Pattern 3: Re-Accumulation
```
Uptrend → Trading Range → Spring → Uptrend continues
```
- Occurs during existing uptrend
- Shorter accumulation period
- Often no clear SC (trend is already up)
- Spring is the key signal
### Pattern 4: Re-Distribution
```
Downtrend → Trading Range → UTAD → Downtrend continues
```
- Occurs during existing downtrend
- Shorter distribution period
- Often no clear BC (trend is already down)
- UTAD is the key signal
### Pattern 5: Failed Breakout
**Bullish Failed Breakout:**
```
Range → Breakdown → Immediate reversal (Spring)
```
- Price breaks support
- Volume is LOW
- Immediate strong reversal
- Very bullish
**Bearish Failed Breakout:**
```
Range → Breakout → Immediate reversal (UTAD)
```
- Price breaks resistance
- Volume may be high initially
- Quick rejection and reversal
- Very bearish
---
## TIMEFRAME RECOMMENDATIONS
### Daily Charts (Most Reliable)
- Best for swing trading
- Clear phases and events
- Less noise
- Recommended for beginners
### 4-Hour Charts
- Good for active swing traders
- Faster signals than daily
- Still reliable
### 1-Hour Charts
- For day traders
- More false signals
- Need to filter carefully
- Use in conjunction with higher timeframe
### 15-Minute / 5-Minute
- Only for experienced traders
- High noise level
- Many false signals
- Use daily chart for context
**Golden Rule:** Always check higher timeframe first!
---
## MULTI-TIMEFRAME ANALYSIS
### Top-Down Approach (Recommended)
1. **Weekly Chart** - Identify major trend and phase
2. **Daily Chart** - Find current accumulation/distribution
3. **4H Chart** - Identify entry timing
4. **Entry Timeframe** - Execute trade
### Example Analysis:
**Weekly:** Phase E Markup (bullish)
**Daily:** Phase B Re-accumulation
**4-Hour:** Spring detected
**Action:** Buy on daily LPS
---
## WYCKOFF + OTHER INDICATORS
### Complementary Tools
1. **Moving Averages**
- 20/50 SMA for trend context
- Already plotted on indicator
2. **RSI**
- Divergences at SC/BC
- Confirms overbought/oversold
3. **MACD**
- Confirms trend change in Phase D
- Divergences support Wyckoff events
4. **Volume Profile**
- Identifies value areas
- Confirms supply/demand zones
5. **Order Flow / Footprint Charts**
- See institutional activity
- Confirms smart money signals
**Don't Over-Complicate:**
- Wyckoff is a complete system
- Other indicators are supplementary
- When in doubt, trust Wyckoff
---
## TROUBLESHOOTING
### Issue: Too Many Labels
**Solution:**
- Increase swing length (Settings → 7 or 10)
- Increase volume multipliers
- Turn off VSA labels if not needed
- Focus on major events only (SC, Spring, SOS, BC, UTAD, SOW)
### Issue: Missing Expected Events
**Solution:**
- Decrease swing length (Settings → 3)
- Decrease volume multipliers
- Turn OFF volume confirmation
- Check timeframe (use daily chart)
### Issue: False Signals
**Solution:**
- Use higher timeframe
- Wait for confirmation
- Don't trade against major trend
- Look for multiple signal convergence
### Issue: Can't See Background Colors
**Solution:**
- Check "Show Phases" is enabled
- Increase monitor brightness
- Colors are subtle by design (not to obscure price)
### Issue: Volume Shows Incorrectly
**Solution:**
- Ensure volume data is available for your symbol
- Some symbols have poor volume data
- Forex spot pairs have no real volume
- Use futures or stock markets for best results
### Issue: No Trading Range Detected
**Solution:**
- Market may be trending strongly
- Trading range might be too small
- Wait for price to consolidate
- Not all markets have clear ranges
---
## ADVANCED TIPS
### 1. Count Point & Figure Charts
- Wyckoff used P&F to measure "cause"
- Width of range × height = minimum move target
- Longer accumulation = larger markup
### 2. Watch for Absorption
- High volume + narrow spread = someone absorbing
- In downtrend = accumulation
- In uptrend = distribution
### 3. Multiple Timeframe Springs
- Spring on daily + spring on weekly = very strong
- Increases probability significantly
### 4. Failed Signals Are Signals Too
- Failed spring = weakness, expect lower
- Failed UTAD = strength, expect higher
### 5. Context is King
- Don't buy during Phase E Markdown
- Don't sell during Phase E Markup
- Respect the major trend
### 6. Volume Precedes Price
- Study volume changes first
- Price follows volume
- Decreasing volume in range = building energy
### 7. Composite Operator Mindset
- Think like institutions
- Where would smart money buy/sell?
- They need liquidity (retail traders)
---
## RISK MANAGEMENT
### Position Sizing
**Conservative:**
- Risk 1% per trade
- Wider stops at range boundaries
**Moderate:**
- Risk 1-2% per trade
- Stops below spring/above UTAD
**Aggressive:**
- Risk 2-3% per trade
- Tight stops
- Higher win rate needed
### Stop Loss Placement
**Accumulation:**
- Below spring low
- Below trading range bottom
- Below demand zone
**Distribution:**
- Above UTAD high
- Above trading range top
- Above supply zone
### Take Profit Strategy
**Method 1: Measured Move**
- Range height = minimum target
- 2x range height = extended target
**Method 2: Fibonacci Extensions**
- 1.0 = range height
- 1.618 = extended target
- 2.618 = maximum target
**Method 3: Trail the Stop**
- Move stop to breakeven at 1R
- Trail under swing lows in markup
- Lock in profits progressively
---
## BACKTESTING CHECKLIST
Before trading with real money:
- Backtest on 50+ historical examples
- Record all signals in trading journal
- Calculate win rate (aim for >50%)
- Calculate average R:R (aim for >1:2)
- Test on multiple instruments
- Test on multiple timeframes
- Test in different market conditions
- Verify signal consistency
- Practice on demo account
- Start small with real money
---
## RECOMMENDED READING
### Books
1. **"Studies in Tape Reading"** - Richard D. Wyckoff
2. **"The Richard D. Wyckoff Method"** - Rubén Villahermosa
3. **"Charting the Stock Market: The Wyckoff Method"** - Jack Hutson
4. **"Master the Markets"** - Tom Williams (VSA)
### Courses
1. Wyckoff Analytics - Official Wyckoff course
2. TradeVSA - Volume Spread Analysis
3. StockCharts - Wyckoff education
### Communities
1. Wyckoff Analytics Forum
2. Reddit r/Wyckoff
3. TradingView Wyckoff ideas section
---
## FREQUENTLY ASKED QUESTIONS
**Q: Can I use this on crypto?**
A: Yes, works well on major cryptocurrencies with good volume.
**Q: Does it work on forex?**
A: Yes, but use futures volume (like 6E for EUR/USD) for better accuracy.
**Q: What's the best timeframe?**
A: Daily chart for most traders. 4H for more active trading.
**Q: How long does accumulation last?**
A: Typically 2-12 weeks. Longer accumulation = bigger markup.
**Q: Can I automate this?**
A: You can use the alerts, but manual analysis is recommended.
**Q: What's the win rate?**
A: With proper filtering: 60-70% on major signals (Spring, UTAD, SOS, SOW).
**Q: Should I trade every signal?**
A: No. Focus on Spring, UTAD, SOS, and SOW in trending markets.
**Q: What if I see conflicting signals?**
A: Use higher timeframe for context. When in doubt, stay out.
**Q: How do I know which phase I'm in?**
A: Check the table in top-right corner. Also look at background color.
**Q: Can I use this for options trading?**
A: Yes, excellent for timing option entries (especially around Spring/UTAD).
---
## FINAL THOUGHTS
The Wyckoff Method is:
- **A complete trading system** (not just an indicator)
- **Based on 100+ years** of market wisdom
- **Used by institutions** and professional traders
- **Requires practice** and screen time
- **Highly effective** when applied correctly
**Success Tips:**
1. Start with daily charts
2. Focus on major events (SC, Spring, SOS, BC, UTAD, SOW)
3. Always check higher timeframe context
4. Wait for confirmation before entering
5. Manage risk properly
6. Keep a trading journal
7. Be patient - wait for the best setups
**Remember:**
- Not every range will have all events
- Some phases may be abbreviated
- Context and confluence matter most
- Practice makes perfect
---
## SUPPORT & UPDATES
For questions, improvements, or bug reports:
- Check TradingView script comments
- Join Wyckoff trading communities
- Study historical examples
- Practice on demo accounts
**Good luck and happy trading!**
---
*Disclaimer: This indicator is for educational purposes. Always do your own analysis and risk management. Past performance does not guarantee future results.*
# WYCKOFF VISUAL SETUP EXAMPLES
## ACCUMULATION SCHEMATIC #1 (Classic Bottom)
```
Price Chart View:
│ PHASE E
│ MARKUP
│ ╱
│ ╱
┌─SOS─────┤ ╱
│ │ ╱
┌───────────┤ ┌LPS │╱
│ PHASE B │ │ │
│ (Cause) └──┴──────┤
┌AR──┤ │
┌────┤ │ ┌─Spring │ PHASE D
│ └ST──┤ │ │
│ │ │ │
────SC────────┴─────────┴───────────┴──────────
│
PS
│ PHASE A
│
Downtrend
```
### PHASE A - Stopping the Downtrend
```
PS: │ High volume down bar
▼ First sign of support
■ Not bottom yet
SC: │ VERY HIGH volume
▼ Panic selling exhaustion
█ Long lower wick
█ This is the low
AR: │ Automatic rally
▲ Relief bounce
■ High volume acceptable
ST: │ Secondary test
▼ Low volume (KEY!)
■ Tests SC low
```
### PHASE B - Building the Cause
```
┌─────────┐
│ ~~~ │ Multiple tests
│ ~ ~ │ Volume decreases
│~ ~ │ Range gets tighter
└─────────┘
Duration: 2-12 weeks typical
The longer, the bigger the eventual move
```
### PHASE C - The Test (SPRING)
```
║ False breakdown
─────╨─────
▼ Low volume
█ Breaks below support
■
█ Quick reversal
▲ Closes ABOVE support
CRITICAL: Volume must be LOW
Close must be strong
Happens quickly (1-3 bars)
```
### PHASE D - Strength Emerges
```
SOS: ▲ Sign of Strength
────╥──── Break above resistance
║ High volume
║ Wide spread
LPS: ▼ Last Point Support
■ Pullback on LOW volume
▲ Great entry point
BU: ▲ Backup
■ Final consolidation
▲ Before markup
```
### PHASE E - Markup
```
╱
╱
╱ Strong uptrend
╱ High momentum
╱ Can last months/years
──╱──
```
---
## DISTRIBUTION SCHEMATIC #2 (Classic Top)
```
Price Chart View:
Uptrend
│
PSY
│ PHASE A
────BC────────┬─────────┬───────────┬──────────
│ │ UTAD │
│ PHASE B │ │ PHASE D
┌AR──┤ ┌LPSY │ │
│ │ │ └───────────┤
│ └──┴──────┐ │╲
└ST──┤ │ │ ╲
│ └───────────┤ ╲
└─SOW─────┤ │ ╲
│ │ ╲
│ PHASE C │ ╲
│ │ PHASE E
│ │ MARKDOWN
```
### PHASE A - Stopping the Uptrend
```
PSY: │ High volume up bar
▲ Preliminary supply
■ Selling starting
BC: │ VERY HIGH volume
▲ Buying climax
█ Euphoric top
█ Long upper wick
AR: │ Automatic reaction
▼ Sharp selloff
■ High volume
ST: │ Secondary test
▲ Low volume (KEY!)
■ Tests BC high
```
### PHASE C - The Test (UTAD)
```
▲ False breakout
────╥────
║ Breaks ABOVE resistance
║ Often high volume spike
▼
█ Rejection / weak close
█ Closes BELOW resistance
▼
CRITICAL: Closes weak
Quick rejection
Traps buyers
```
### PHASE D - Weakness Emerges
```
SOW: ▼ Sign of Weakness
────╨──── Break below support
║ High volume
║ Wide spread
LPSY: ▲ Last Point Supply
■ Rally on LOW volume
▼ Last chance to exit
```
---
## VOLUME PATTERNS (Critical to Understanding)
### ACCUMULATION Volume Pattern
```
Volume
│ SC
█
█ ST
■ ■ Spring
■ ■ ■ SOS LPS
──┴────┴────┴──────█───■────►
│ │ │ │ │
│ │ │ │ │
A A C D D
Pattern: HIGH → low → low → HIGH → low
Key: Volume DECREASES during range
INCREASES on breakout
```
### DISTRIBUTION Volume Pattern
```
Volume
│ BC
█
█ ST
■ ■ UTAD
■ ■ ■ SOW LPSY
──┴────┴────┴──────█───■────►
│ │ │ │ │
│ │ │ │ │
A A C D D
Pattern: HIGH → low → varies → HIGH → low
Key: Volume MAY increase on UTAD
Definitely HIGH on breakdown (SOW)
```
---
## REAL TRADE SETUPS
### Setup #1: SPRING BUY
```
Entry Conditions:
1. Clear trading range identified
2. Price breaks BELOW support
3. Volume is LOW (critical!)
4. Price reverses QUICKLY
5. Closes ABOVE support level
Entry: Next bar or on retest
Stop: Below spring low
Target: Top of range (minimum)
Example:
Support: $100
Spring low: $98 (low volume)
Close: $101
Entry: $102
Stop: $97.50
Target: $120 (range top)
Risk/Reward: 1:4
```
### Setup #2: UTAD SELL
```
Entry Conditions:
1. Clear trading range identified (after uptrend)
2. Price breaks ABOVE resistance
3. Often high volume spike
4. Price reverses QUICKLY
5. Closes BELOW resistance level
Entry: Next bar or on retest
Stop: Above UTAD high
Target: Bottom of range (minimum)
Example:
Resistance: $200
UTAD high: $205 (spike)
Close: $198
Entry: $197
Stop: $206
Target: $180 (range bottom)
Risk/Reward: 1:2
```
### Setup #3: SOS BREAKOUT
```
Entry Conditions:
1. Clear accumulation range
2. Spring already occurred (ideal)
3. Price breaks ABOVE resistance
4. HIGH volume on breakout
5. Wide spread up bar
Entry Option A: On breakout ($120)
Entry Option B: Wait for LPS pullback ($115)
Stop: Below range or LPS
Target: Range height projected up
Example:
Range: $100-$120 (20 points)
SOS breakout: $120
Entry A: $120
Stop: $115
Target 1: $140 (100%)
Target 2: $150 (150%)
```
---
## VSA SPECIFIC PATTERNS
### Pattern 1: No Demand (Weakness)
```
▲
■ Up bar
■ Low volume ◄── KEY
▲ Small body
Context: After uptrend
Meaning: Buyers exhausted
Action: Prepare to sell
```
### Pattern 2: No Supply (Strength)
```
▼
■ Down bar
■ Low volume ◄── KEY
▼ Small body
Context: After downtrend
Meaning: Sellers exhausted
Action: Prepare to buy
```
### Pattern 3: Stopping Volume
```
═ Very high volume
█ Narrow spread ◄── KEY
═ Price not moving
Context: At extremes
Meaning: Absorption
Action: Expect reversal
```
---
## COMMON MISTAKES (What NOT to Do)
### ❌ Mistake 1: Buying Prematurely
```
WRONG:
SC
▼
█ ← DON'T BUY HERE
CORRECT:
Spring
─────╨─────
▼
█ ← BUY HERE
▲
```
### ❌ Mistake 2: Ignoring Volume
```
WRONG: "It broke below support, must be spring"
─────╨───── High volume
█
This is a BREAKDOWN, not a spring!
CORRECT Spring:
─────╨───── LOW volume ✓
■ Quick reversal ✓
▲
```
### ❌ Mistake 3: Trading Against Trend
```
WRONG:
Markdown Phase E
╲
╲ ← Trying to buy here
╲
╲
CORRECT:
Wait for new accumulation to complete
```
---
## MULTI-TIMEFRAME EXAMPLE
### Weekly Chart: Phase E Markup (Bullish)
```
╱
╱
╱ Long-term uptrend
╱
───╱─────
```
### Daily Chart: Re-Accumulation Phase C
```
┌─────────┐
│ Spring │ ← We are here
│ ▼ │
─────┴────█────┴─────
▲
```
### 4-Hour Chart: Entry Timing
```
Last 48 hours:
─────╨───── Spring occurred
█
▲ ← Enter now
■
```
**Result:** Triple confirmation across timeframes = High probability trade
---
## PROFIT TARGETS (Visual Guide)
### Method 1: Basic Measured Move
```
Resistance: 120 ┐ ─────────
│
│ 20 points
│
Support: 100 ┘ ─────────
Breakout: 120
Target: 120 + 20 = 140
╱╱╱ 140 (Target)
╱╱╱
╱╱╱
──────◄ 120 (Breakout)
│
Range │ 20
│
──────┘ 100
```
### Method 2: Multiple Targets
```
╱╱╱ 150 (Target 3: 2.5x) - 20% position
╱╱╱
╱╱╱ 140 (Target 2: 2x) - 30% position
╱╱╱
─────◄╱ 130 (Target 1: 1x) - 50% position
│
10 │ 120 (Breakout)
│
─────┘ 110 (Support)
```
### Method 3: Trailing Stop
```
1. Move stop to breakeven at Target 1
2. Trail stop under swing lows
3. Let winners run
╱╱╱
╱ ╱╱ ← Trail stop here
╱╱ ╱
╱ ╱ ← Then here
─────◄──╱
← Start here (breakeven)
```
---
## TIMING ENTRIES (Exact Bar Patterns)
### Perfect Spring Entry
```
Bar 1: ▼ Breaks below (Low vol)
█
Bar 2: ▲ Reverses (Closes strong)
█ ◄─ ENTER HERE
Bar 3: ■ Confirms
▲
DON'T WAIT for Bar 3!
Enter on Bar 2 close
```
### Perfect UTAD Entry
```
Bar 1: ▲ Breaks above (Spike vol OK)
█
Bar 2: ▼ Reverses (Closes weak)
█ ◄─ ENTER HERE
Bar 3: ■ Confirms
▼
SHORT on Bar 2 close
Don't wait for more confirmation
```
---
## COMPOSITE OPERATOR PSYCHOLOGY
### What Smart Money Does (Follow Them)
**Accumulation:**
```
1. Create fear (PS, SC)
2. Shake out weak hands (Spring)
3. Absorb supply quietly (Phase B)
4. Test for remaining supply (Test)
5. Mark it up (SOS → Phase E)
💰 They buy LOW when retail panics
```
**Distribution:**
```
1. Create euphoria (PSY, BC)
2. Trap late buyers (UTAD)
3. Distribute to buyers (Phase B)
4. Test for remaining demand (ST)
5. Mark it down (SOW → Phase E)
💰 They sell HIGH when retail buys
```
### Where to Look for Smart Money
```
💰 Buy signals appear at:
- Demand zones (green boxes)
- Springs and shakeouts
- Tests of support
- After selling climax
💰 Sell signals appear at:
- Supply zones (red boxes)
- UTAD and upthrusts
- Weak rallies (LPSY)
- After buying climax
```
---
## PRACTICE EXERCISES
### Exercise 1: Identify the Phase
Look at any chart and ask:
1. Is there a trading range? (Phase B likely)
2. Did we just stop a trend? (Phase A)
3. Was there a spring/UTAD? (Phase C)
4. Is there a breakout? (Phase D)
5. Is trend running? (Phase E)
### Exercise 2: Volume Analysis
For each bar, note:
- Volume level (High/Normal/Low)
- Spread (Wide/Normal/Narrow)
- Effort vs Result (Matching? Diverging?)
### Exercise 3: Find Historical Springs
Go back 6 months:
- Mark all springs you can find
- Note the setup before each
- Track what happened after
- Calculate win rate
---
## FINAL VISUALIZATION: The Complete Cycle
```
ACCUMULATION → MARKUP → DISTRIBUTION → MARKDOWN → ACCUMULATION...
Distribution Accumulation
(Top) (Bottom)
┌───────────────┐ ┌───────────────┐
│ BC UTAD │ │ Spring SC │
│ │ │ │ │ │ │ │
────┴───┴───┴───────┴─╲ ╱────────┴───┴───┴────
╲ ╱
Markdown ╲ ╱ Markup
(Phase E) ╲ ╱ (Phase E)
╲ ╱
╲ ╱
╲ ╱
╲ ╱
V
The market cycles endlessly
Your job: Identify where you are in the cycle
Trade accordingly
```
---
**Remember:**
- 📊 Study charts daily
- 📝 Journal every setup
- 🎯 Wait for the best signals
- 💰 Follow smart money
- ⏰ Be patient
- 🚀 Let winners run
**The indicator does the heavy lifting - you make the decisions!**
EBP Auto Fibonacci Drawer 👑 Daily EBP Trading Strategy (Final Refined Summary)
This is a daily price action strategy that combines a specific reversal candle (EBP) with a Fibonacci retracement for a confirmed trend continuation entry.
1. 🕯️ The Signal Candle (EBP Confirmation)
Wait for a single daily candle to close that meets two strict criteria:
Liquidity Sweep: The candle's low must first wick below the low of the preceding day.
Strong Reversal: The candle must then reverse and close above the high of the preceding day (confirming a strong move).
2. 📐 Fibonacci Retracement Setup
The Fibonacci Retracement tool is applied to the newly confirmed EBP Candle to define the retracement and entry zone for the next day.
Drawing the Fib (for a Buy Setup): Draw the Fib from the EBP Candle's Close to the EBP Candle's Low.
3. 🎯 Entry and Risk Management
The trade is executed on the next candle (Day 2) after the price retraces and then reverses, confirmed by a candle close.
Action Retracement & Entry Condition Stop Loss (SL) Placement Target (TP) Placement
Buy (Long) Price retraces into the Fib levels, and then the candle CLOSES above any of the key breakout levels: 0%, 25%, 50%, 75%, or 100%. Placed at the Most Recent Swing Low (The lowest point before the EBP candle's move). The EBP Candle's High Wick.
Sell (Short) (Inverse) Price retraces into the Fib levels, and then the candle CLOSES below any of the key breakout levels: 0%, 25%, 50%, 75%, or 100%. Placed at the Most Recent Swing High (The highest point before the EBP candle's move). The EBP Candle's Low Wick.
Export to Sheets
Key Takeaways:
Timeframe: Daily candles are used for all signals and entries.
Entry Trigger: A confirmed candle close outside the Fib level is required, not just a wick or price crossing.
Risk Control: The Stop Loss is set at a structural point (the recent swing) for better protection.
Would you like to search for examples of this "Engineered Block Pricing" (EBP) candle pattern on a chart? That clarification makes sense, as placing the Stop Loss (SL) at the recent swing low (or high for a short) is a more conservative and structurally sound location than just the immediate EBP candle's wick.
Here is the final, fully refined summary of the Daily EBP Trading Strategy, incorporating all criteria: the specific signal candle, the Fibonacci retracement levels, the candle close entry trigger, and the recent swing low/high for the stop loss.
👑 Daily EBP Trading Strategy (Final Refined Summary)
This is a daily price action strategy that combines a specific reversal candle (EBP) with a Fibonacci retracement for a confirmed trend continuation entry.
1. 🕯️ The Signal Candle (EBP Confirmation)
Wait for a single daily candle to close that meets two strict criteria:
Liquidity Sweep: The candle's low must first wick below the low of the preceding day.
Strong Reversal: The candle must then reverse and close above the high of the preceding day (confirming a strong move).
2. 📐 Fibonacci Retracement Setup
The Fibonacci Retracement tool is applied to the newly confirmed EBP Candle to define the retracement and entry zone for the next day.
Drawing the Fib (for a Buy Setup): Draw the Fib from the EBP Candle's Close to the EBP Candle's Low.
3. 🎯 Entry and Risk Management
The trade is executed on the next candle (Day 2) after the price retraces and then reverses, confirmed by a candle close.
Action Retracement & Entry Condition Stop Loss (SL) Placement Target (TP) Placement
Buy (Long)
Price retraces into the Fib levels, and then the candle CLOSES above any of the key breakout levels: 0%, 25%, 50%, 75%, or 100%.
Placed at the Most Recent Swing Low (The lowest point before the EBP candle's sharp move). The EBP Candle's High Wick.
Sell (Short) (Inverse) Price retraces into the Fib levels, and then the candle CLOSES below any of the key breakout levels: 0%, 25%, 50%, 75%, or 100%.
Placed at the Most Recent Swing High (The highest point before the EBP candle's sharp move). The EBP Candle's Low Wick.
Triple VWAP: Anchored# Triple VWAP: Anchored + Last 2 Sessions
## 📊 Overview
**Triple VWAP** is a professional-grade Volume Weighted Average Price (VWAP) indicator designed for serious traders who need multi-timeframe volume analysis on a single chart. This indicator combines three powerful VWAP calculations: a custom **Anchored VWAP** from any historical date, a real-time **Current Session VWAP**, and **Previous Session VWAP** reference levels—all with configurable standard deviation bands.
Perfect for intraday traders, swing traders, and institutional-level analysis on Indian markets (Nifty, BankNifty) and global instruments.
***
## ✨ Key Features
### 🎯 Three Independent VWAP Calculations
**📍 Anchored VWAP (Long-term Reference)**
- Anchor VWAP from any specific date and time (year, month, day, hour, minute)
- Ideal for tracking price action from significant market events, earnings, or trend reversals
- Maintains accumulation from your chosen anchor point throughout the entire timeframe
**📅 Current Session VWAP (Real-Time)**
- Automatically resets at the start of each trading day
- Calculates dynamically as new bars form during the session
- Shows institutional trading levels and intraday fair value
**📆 Previous Session VWAP (Reference Levels)**
- Displays yesterday's final VWAP as horizontal reference lines
- Helps identify support/resistance zones from prior session
- Useful for gap analysis and opening range strategies
### 📐 Standard Deviation Bands
Each VWAP calculation includes optional standard deviation bands:
- **±1 SD** - Identifies normal price deviation zones
- **±2 SD** - Marks extreme price movements (high probability reversal zones)
- **±3 SD** - Ultra-extreme levels (rare price extensions)
Configure which SD levels to display for each VWAP type independently.
### 🎨 Customizable Visual Settings
- **Independent Color Schemes**: Assign unique colors to each VWAP type and its SD bands
- **Adjustable Line Widths**: Configure VWAP and SD line thickness (1-5 for VWAP, 1-3 for SD)
- **Plot Styles**: Previous session plots use cross-style for clear differentiation from real-time plots
- **Background Zones**: Optional colored zones when price extends beyond ±2 SD levels
- **Session Labels**: Automatic date labels marking each VWAP anchor point
### 📊 Information Dashboard
Real-time statistics table displaying:
- Current VWAP values for all three calculations
- Live standard deviation values
- ±1 SD levels for quick reference
- Distance from price to each VWAP (percentage format)
- Session tracking counter
- Color-coded proximity indicators
***
## 🔧 How to Use
### For Intraday Trading
1. **Current Session VWAP** acts as dynamic support/resistance—price above VWAP indicates bullish bias, below indicates bearish bias
2. Use **±1 SD bands** for profit targets and stop-loss placement
3. **±2 SD touches** often signal mean reversion opportunities
4. **Previous Session VWAP** provides overnight gap reference levels
### For Swing Trading
1. **Anchored VWAP** from significant events (breakouts, earnings, trend changes) shows institutional cost basis
2. Price trading consistently above/below anchored VWAP confirms trend strength
3. SD band rejections provide high-probability entry zones
### For Multi-Timeframe Analysis
1. Combine all three VWAPs to identify confluence zones
2. When current session VWAP aligns with previous session and anchored VWAP, expect strong support/resistance
3. Monitor distance percentage to gauge overextension
***
## ⚙️ Input Parameters
**📍 Anchored VWAP Configuration**
- `Enable Anchored VWAP` - Toggle on/off
- `Year, Month, Day, Hour, Minute` - Set your custom anchor point (requires confirmation)
**📅 Session VWAP Toggles**
- `Enable Current Session VWAP` - Toggle real-time daily VWAP
- `Enable Previous Session VWAP` - Toggle yesterday's reference VWAP
**General Settings**
- `VWAP Source` - Choose calculation source (default: HLC3)
- `Show ±1/2/3 SD` - Enable/disable each standard deviation level
**Visual Customization**
- Individual color pickers for each VWAP type and SD bands
- Line width adjustments
- `Show VWAP Labels` - Date labels at anchor points
- `Show Info Table` - Statistics dashboard toggle
- `Show SD Zones` - Background coloring beyond ±2 SD
***
## 💡 Trading Applications
✅ **Mean Reversion Trades**: Enter when price touches ±2 SD with reversal confirmation
✅ **Trend Following**: Trade in direction when price holds above/below VWAP
✅ **Institutional Levels**: Anchored VWAP reveals where large players accumulated positions
✅ **Gap Trading**: Use previous session VWAP to gauge gap fill probability
✅ **Volume Profile Analysis**: VWAP represents fair value based on actual volume traded
✅ **Support/Resistance Confluence**: Multiple VWAP alignment creates high-probability zones
***
## 🎓 Understanding VWAP
VWAP is the average price weighted by volume—representing the true average price paid by all market participants during a specific period. Unlike simple moving averages, VWAP gives more weight to price levels with higher trading volume, making it particularly valuable for:
- Institutional traders executing large orders
- Algorithmic trading systems
- Identifying fair value and overextended prices
- Minimizing market impact on large trades
***
## 📈 Chart Setup Recommendations
**Best Timeframes**: 1-minute to 15-minute charts for intraday; 1-hour to 4-hour for swing trading
**Compatible Markets**: Stocks, Indices (Nifty 50, Bank Nifty), Futures, Forex, Crypto
**Session Settings**: Works with standard daily sessions; automatically detects trading days (not calendar days)
***
## 🚀 What Makes This Indicator Unique
Unlike standard VWAP indicators that only show current session data, **Triple VWAP** provides:
- **Multi-session analysis** on a single chart without clutter
- **Historical anchoring** capability for event-driven analysis
- **Professional-grade statistics** dashboard
- **Independent customization** for each VWAP type
- **Optimized calculations** for real-time performance
***
## ⚠️ Important Notes
- **Anchored VWAP** requires manual date input (use significant market events like breakouts, earnings, trend reversals)
- **Session detection** based on daily timeframe changes—works on all chart timeframes
- **Previous Session VWAP** displays as static horizontal lines (reference only, not recalculated)
- **Standard Deviations** calculated using volume-weighted variance formula
- Works best on instruments with **consistent volume data**
***
## 📝 Credits & License
This indicator is published under **TradingView House Rules**. Code is original and follows Pine Script v6 best practices for performance and maintainability.
***
## 🤝 Support & Feedback
If you find this indicator valuable, please:
- ⭐ **Like** this publication
- 💬 **Comment** with your feedback or questions
- 🔔 **Follow** for updates and new releases
***
**Disclaimer**: This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always use proper risk management and combine with your own analysis before making trading decisions.
***
Market Regime# MARKET REGIME IDENTIFICATION & TRADING SYSTEM
## Complete User Guide
---
## 📋 TABLE OF CONTENTS
1. (#overview)
2. (#regimes)
3. (#indicator-usage)
4. (#entry-signals)
5. (#exit-signals)
6. (#regime-strategies)
7. (#confluence)
8. (#backtesting)
9. (#optimization)
10. (#examples)
---
## OVERVIEW
### What This System Does
This is a **complete market regime identification and trading system** that:
1. **Identifies 6 distinct market regimes** automatically
2. **Adapts trading tactics** to each regime
3. **Provides high-probability entry signals** with confluence scoring
4. **Shows optimal exit points** for each trade
5. **Can be backtested** to validate performance
### Two Components Provided
1. **Indicator** (`market_regime_indicator.pine`)
- Visual regime identification
- Entry/exit signals on chart
- Dynamic support/resistance
- Info tables with live data
- Use for manual trading
2. **Strategy** (`market_regime_strategy.pine`)
- Fully automated backtestable version
- Same logic as indicator
- Position sizing and risk management
- Performance metrics
- Use for backtesting and automation
---
## THE 6 MARKET REGIMES
### 1. 🟢 BULL TRENDING
**Characteristics:**
- Strong uptrend
- Price above SMA50 and SMA200
- ADX > 25 (strong trend)
- Higher highs and higher lows
- DI+ > DI- (bullish momentum)
**What It Means:**
- Market has clear upward direction
- Buyers in control
- Pullbacks are buying opportunities
- Strongest regime for long positions
**How to Trade:**
- ✅ **BUY dips to EMA20 or SMA20**
- ✅ Enter when RSI < 60 on pullback
- ✅ Hold through minor corrections
- ❌ Don't short against the trend
- ❌ Don't sell too early
**Expected Behavior:**
- Pullbacks are shallow (5-10%)
- Bounces are strong
- Support at moving averages holds
- Volume increases on rallies
---
### 2. 🔴 BEAR TRENDING
**Characteristics:**
- Strong downtrend
- Price below SMA50 and SMA200
- ADX > 25 (strong trend)
- Lower highs and lower lows
- DI- > DI+ (bearish momentum)
**What It Means:**
- Market has clear downward direction
- Sellers in control
- Rallies are selling opportunities
- Strongest regime for short positions
**How to Trade:**
- ✅ **SELL rallies to EMA20 or SMA20**
- ✅ Enter when RSI > 40 on bounce
- ✅ Hold through minor bounces
- ❌ Don't buy against the trend
- ❌ Don't cover shorts too early
**Expected Behavior:**
- Rallies are weak (5-10%)
- Selloffs are strong
- Resistance at moving averages holds
- Volume increases on declines
---
### 3. 🔵 BULL RANGING
**Characteristics:**
- Bullish bias but consolidating
- Price near or above SMA50
- ADX < 20 (weak trend)
- Trading in range
- Choppy price action
**What It Means:**
- Uptrend is pausing
- Accumulation phase
- Support and resistance zones clear
- Lower volatility
**How to Trade:**
- ✅ **BUY at support zone**
- ✅ Enter when RSI < 40
- ✅ Take profits at resistance
- ⚠️ Smaller position sizes
- ⚠️ Tighter stops
**Expected Behavior:**
- Range-bound oscillations
- Support bounces repeatedly
- Resistance rejections common
- Eventually breaks higher (usually)
---
### 4. 🟠 BEAR RANGING
**Characteristics:**
- Bearish bias but consolidating
- Price near or below SMA50
- ADX < 20 (weak trend)
- Trading in range
- Choppy price action
**What It Means:**
- Downtrend is pausing
- Distribution phase
- Support and resistance zones clear
- Lower volatility
**How to Trade:**
- ✅ **SELL at resistance zone**
- ✅ Enter when RSI > 60
- ✅ Take profits at support
- ⚠️ Smaller position sizes
- ⚠️ Tighter stops
**Expected Behavior:**
- Range-bound oscillations
- Resistance holds repeatedly
- Support bounces are weak
- Eventually breaks lower (usually)
---
### 5. ⚪ CONSOLIDATION
**Characteristics:**
- No clear direction
- Range compression
- Very low ADX (< 15 often)
- Price inside tight range
- Neutral sentiment
**What It Means:**
- Market is coiling
- Building energy for next move
- Indecision between buyers/sellers
- Calm before the storm
**How to Trade:**
- ✅ **WAIT for breakout direction**
- ✅ Enter on high-volume breakout
- ✅ Direction becomes clear
- ❌ Don't trade inside the range
- ❌ Avoid choppy scalping
**Expected Behavior:**
- Narrow range
- Low volume
- False breakouts possible
- Explosive move when it breaks
---
### 6. 🟣 CHAOS (High Volatility)
**Characteristics:**
- Extreme volatility
- No clear direction
- Erratic price swings
- ATR > 2x average
- Unpredictable
**What It Means:**
- Market panic or euphoria
- News-driven moves
- Emotion dominates logic
- Highest risk environment
**How to Trade:**
- ❌ **STAY OUT!**
- ❌ No positions
- ❌ Wait for stability
- ✅ Protect existing positions
- ✅ Reduce risk
**Expected Behavior:**
- Large intraday swings
- Gaps up/down
- Stop hunts
- Whipsaws
- Eventually calms down
---
## INDICATOR USAGE
### Visual Elements
#### 1. Background Colors
- **Light Green** = Bull Trending (go long)
- **Light Red** = Bear Trending (go short)
- **Light Teal** = Bull Ranging (buy dips)
- **Light Orange** = Bear Ranging (sell rallies)
- **Light Gray** = Consolidation (wait)
- **Purple** = Chaos (stay out!)
#### 2. Regime Labels
- Appear when regime changes
- Show new regime name
- Positioned at highs (bullish) or lows (bearish)
#### 3. Entry Signals
- **Green "LONG"** labels = Buy here
- **Red "SHORT"** labels = Sell here
- Number shows confluence score (X/5 signals)
- Hover for details (stop, target, RSI, etc.)
#### 4. Exit Signals
- **Orange "EXIT LONG"** = Close long position
- **Orange "EXIT SHORT"** = Close short position
- Shows exit reason in tooltip
#### 5. Support/Resistance Lines
- **Green line** = Dynamic support (buy zone)
- **Red line** = Dynamic resistance (sell zone)
- Adapts to regime automatically
#### 6. Moving Averages
- **Blue** = SMA 20 (short-term trend)
- **Orange** = SMA 50 (medium-term trend)
- **Purple** = SMA 200 (long-term trend)
### Information Tables
#### Top Right Table (Main Info)
Shows real-time market conditions:
- **Current Regime** - What regime we're in
- **Bias** - Long, Short, Breakout, or Stay Out
- **ADX** - Trend strength (>25 = strong)
- **Trend** - Strong, Moderate, or Weak
- **Volatility** - High or Normal
- **Vol Ratio** - Current vs average volatility
- **RSI** - Momentum (>70 overbought, <30 oversold)
- **vs SMA50/200** - Price position relative to MAs
- **Support/Resistance** - Exact price levels
- **Long/Short Signals** - Confluence scores (X/5)
#### Bottom Right Table (Regime Guide)
Quick reference for each regime:
- What action to take
- What strategy to use
- Color-coded for quick identification
---
## ENTRY SIGNALS EXPLAINED
### Confluence Scoring System (5 Factors)
Each entry signal is scored 0-5 based on how many factors align:
#### For LONG Entries:
1. ✅ **Regime Alignment** - In Bull Trending or Bull Ranging
2. ✅ **RSI Pullback** - RSI between 35-50 (not overbought)
3. ✅ **Near Support** - Price within 2% of dynamic support
4. ✅ **MACD Turning Up** - Momentum shifting bullish
5. ✅ **Volume Confirmation** - Above average volume
#### For SHORT Entries:
1. ✅ **Regime Alignment** - In Bear Trending or Bear Ranging
2. ✅ **RSI Rejection** - RSI between 50-65 (not oversold)
3. ✅ **Near Resistance** - Price within 2% of dynamic resistance
4. ✅ **MACD Turning Down** - Momentum shifting bearish
5. ✅ **Volume Confirmation** - Above average volume
### Confluence Requirements
**Minimum Confluence** (default = 2):
- 2/5 = Entry signal triggered
- 3/5 = Good signal
- 4/5 = Strong signal
- 5/5 = Excellent signal (rare)
**Higher confluence = Higher probability = Better trades**
### Specific Entry Patterns
#### 1. Bull Trending Entry
```
Requirements:
- Regime = Bull Trending
- Price pulls back to EMA20
- Close above EMA20 (bounce)
- Up candle (close > open)
- RSI < 60
- Confluence ≥ 2
```
#### 2. Bear Trending Entry
```
Requirements:
- Regime = Bear Trending
- Price rallies to EMA20
- Close below EMA20 (rejection)
- Down candle (close < open)
- RSI > 40
- Confluence ≥ 2
```
#### 3. Bull Ranging Entry
```
Requirements:
- Regime = Bull Ranging
- RSI < 40 (oversold)
- Price at or below support
- Up candle (reversal)
- Confluence ≥ 1 (more lenient)
```
#### 4. Bear Ranging Entry
```
Requirements:
- Regime = Bear Ranging
- RSI > 60 (overbought)
- Price at or above resistance
- Down candle (rejection)
- Confluence ≥ 1 (more lenient)
```
#### 5. Consolidation Breakout
```
Requirements:
- Regime = Consolidation
- Price breaks above/below range
- Volume > 1.5x average (explosive)
- Strong directional candle
```
---
## EXIT SIGNALS EXPLAINED
### Three Types of Exits
#### 1. Regime Change Exits (Automatic)
- **Long Exit**: Regime changes to Bear Trending or Chaos
- **Short Exit**: Regime changes to Bull Trending or Chaos
- **Reason**: Market character changed, strategy no longer valid
#### 2. Support/Resistance Break Exits
- **Long Exit**: Price breaks below support by 2%
- **Short Exit**: Price breaks above resistance by 2%
- **Reason**: Key level violated, trend may be reversing
#### 3. Momentum Exits
- **Long Exit**: RSI > 70 (overbought) AND down candle
- **Short Exit**: RSI < 30 (oversold) AND up candle
- **Reason**: Overextension, take profits
### Stop Loss & Take Profit
**Stop Loss** (Automatic in strategy):
- Placed at Entry - (ATR × 2)
- Adapts to volatility
- Protected from whipsaws
- Typically 2-4% for stocks, 5-10% for crypto
**Take Profit** (Automatic in strategy):
- Placed at Entry + (Stop Distance × R:R Ratio)
- Default 2.5:1 reward:risk
- Example: $2 risk = $5 reward target
- Allows winners to run
---
## TRADING EACH REGIME
### BULL TRENDING - Most Profitable Long Environment
**Strategy: Buy Every Dip**
**Entry Rules:**
1. Wait for pullback to EMA20 or SMA20
2. Look for RSI < 60
3. Enter when candle closes above MA
4. Confluence should be 2+
**Stop Loss:**
- Below the recent swing low
- Or 2 × ATR below entry
**Take Profit:**
- At previous high
- Or 2.5:1 R:R minimum
**Position Size:**
- Can use full size (2% risk)
- High win rate regime
**Example Trade:**
```
Price: $100, pulls back to $98 (EMA20)
Entry: $98.50 (close above EMA)
Stop: $96.50 (2 ATR)
Target: $103.50 (2.5:1)
Risk: $2, Reward: $5
```
---
### BEAR TRENDING - Most Profitable Short Environment
**Strategy: Sell Every Rally**
**Entry Rules:**
1. Wait for bounce to EMA20 or SMA20
2. Look for RSI > 40
3. Enter when candle closes below MA
4. Confluence should be 2+
**Stop Loss:**
- Above the recent swing high
- Or 2 × ATR above entry
**Take Profit:**
- At previous low
- Or 2.5:1 R:R minimum
**Position Size:**
- Can use full size (2% risk)
- High win rate regime
**Example Trade:**
```
Price: $100, rallies to $102 (EMA20)
Entry: $101.50 (close below EMA)
Stop: $103.50 (2 ATR)
Target: $96.50 (2.5:1)
Risk: $2, Reward: $5
```
---
### BULL RANGING - Buy Low, Sell High
**Strategy: Range Trading (Long Bias)**
**Entry Rules:**
1. Wait for price at support zone
2. Look for RSI < 40
3. Enter on reversal candle
4. Confluence should be 1-2+
**Stop Loss:**
- Below support zone
- Tighter than trending (1.5 ATR)
**Take Profit:**
- At resistance zone
- Don't hold through resistance
**Position Size:**
- Reduce to 1-1.5% risk
- Lower win rate than trending
**Example Trade:**
```
Range: $95-$105
Entry: $96 (at support, RSI 35)
Stop: $94 (below support)
Target: $104 (at resistance)
Risk: $2, Reward: $8 (4:1)
```
---
### BEAR RANGING - Sell High, Buy Low
**Strategy: Range Trading (Short Bias)**
**Entry Rules:**
1. Wait for price at resistance zone
2. Look for RSI > 60
3. Enter on rejection candle
4. Confluence should be 1-2+
**Stop Loss:**
- Above resistance zone
- Tighter than trending (1.5 ATR)
**Take Profit:**
- At support zone
- Don't hold through support
**Position Size:**
- Reduce to 1-1.5% risk
- Lower win rate than trending
**Example Trade:**
```
Range: $95-$105
Entry: $104 (at resistance, RSI 65)
Stop: $106 (above resistance)
Target: $96 (at support)
Risk: $2, Reward: $8 (4:1)
```
---
### CONSOLIDATION - Wait for Breakout
**Strategy: Breakout Trading**
**Entry Rules:**
1. Identify consolidation range
2. Wait for VOLUME SURGE (1.5x+ avg)
3. Enter on close outside range
4. Direction must be clear
**Stop Loss:**
- Opposite side of range
- Or 2 ATR
**Take Profit:**
- Measure range height, project it
- Example: $10 range = $10 move expected
**Position Size:**
- Reduce to 1% risk
- 50% false breakout rate
**Example Trade:**
```
Consolidation: $98-$102 (4-point range)
Breakout: $102.50 (high volume)
Entry: $103
Stop: $100 (back in range)
Target: $107 (4-point range projected)
Risk: $3, Reward: $4
```
---
### CHAOS - STAY OUT!
**Strategy: Preservation**
**What to Do:**
- ❌ NO new positions
- ✅ Close existing positions if near entry
- ✅ Tighten stops on profitable trades
- ✅ Reduce position sizes dramatically
- ✅ Wait for regime to stabilize
**Why It's Dangerous:**
- Stop hunts are common
- Whipsaws everywhere
- News-driven volatility
- No technical reliability
- Even "perfect" setups fail
**When Does It End:**
- Volatility ratio drops < 1.5
- ADX starts rising (direction appears)
- Price respects support/resistance again
- Usually 1-5 days
---
## CONFLUENCE SYSTEM
### How It Works
The system scores each potential entry on 5 factors. More factors aligning = higher probability.
### Confluence Requirements by Regime
**Trending Regimes** (strictest):
- Minimum 2/5 required
- 3/5 = Good
- 4-5/5 = Excellent
**Ranging Regimes** (moderate):
- Minimum 1-2/5 required
- 2/5 = Good
- 3+/5 = Excellent
**Consolidation** (breakout only):
- Volume is most critical
- Direction confirmation
- Less confluence needed
### Adjusting Minimum Confluence
**If too few signals:**
- Lower from 2 to 1
- More trades, lower quality
**If too many false signals:**
- Raise from 2 to 3
- Fewer trades, higher quality
**Recommendation:**
- Start at 2
- Adjust based on win rate
- Aim for 55-65% win rate
---
## STRATEGY BACKTESTING
### Loading the Strategy
1. Copy `market_regime_strategy.pine`
2. Open Pine Editor in TradingView
3. Paste and "Add to Chart"
4. Strategy Tester tab opens at bottom
### Initial Settings
```
Risk Per Trade: 2%
ATR Stop Multiplier: 2.0
Reward:Risk Ratio: 2.5
Trade Longs: ✓
Trade Shorts: ✓
Trade Trending Only: ✗ (test both)
Avoid Chaos: ✓
Minimum Confluence: 2
```
### What to Look For
**Good Results:**
- Win Rate: 50-60%
- Profit Factor: 1.8-2.5
- Net Profit: Positive
- Max Drawdown: <20%
- Consistent equity curve
**Warning Signs:**
- Win Rate: <45% (too many losses)
- Profit Factor: <1.5 (barely profitable)
- Max Drawdown: >30% (too risky)
- Erratic equity curve (unstable)
### Testing Different Regimes
**Test 1: Trending Only**
```
Trade Trending Only: ✓
Result: Higher win rate, fewer trades
```
**Test 2: All Regimes**
```
Trade Trending Only: ✗
Result: More trades, potentially lower win rate
```
**Test 3: Long Only**
```
Trade Longs: ✓
Trade Shorts: ✗
Result: Works in bull markets
```
**Test 4: Short Only**
```
Trade Longs: ✗
Trade Shorts: ✓
Result: Works in bear markets
```
---
## SETTINGS OPTIMIZATION
### Key Parameters to Adjust
#### 1. Risk Per Trade (Most Important)
- **0.5%** = Very conservative
- **1.0%** = Conservative (recommended for beginners)
- **2.0%** = Moderate (recommended)
- **3.0%** = Aggressive
- **5.0%** = Very aggressive (not recommended)
**Impact:** Higher risk = higher returns BUT bigger drawdowns
#### 2. Reward:Risk Ratio
- **2:1** = More wins needed, hit target faster
- **2.5:1** = Balanced (recommended)
- **3:1** = Fewer wins needed, hold longer
- **4:1** = Very patient, best in trending
**Impact:** Higher R:R = can have lower win rate
#### 3. Minimum Confluence
- **1** = More signals, lower quality
- **2** = Balanced (recommended)
- **3** = Fewer signals, higher quality
- **4** = Very selective
- **5** = Almost never triggers
**Impact:** Higher = fewer but better trades
#### 4. ADX Thresholds
- **Trending: 20-30** (default 25)
- Lower = detect trends earlier
- Higher = only strong trends
- **Ranging: 15-25** (default 20)
- Lower = identify ranging earlier
- Higher = only weak trends
#### 5. Trend Period (SMA)
- **20-50** = Short-term trends
- **50** = Medium-term (default, recommended)
- **100-200** = Long-term trends
**Impact:** Longer period = slower regime changes, more stable
### Optimization Workflow
**Step 1: Baseline**
- Use all default settings
- Test on 3+ years
- Record: Win Rate, PF, Drawdown
**Step 2: Risk Optimization**
- Test 1%, 1.5%, 2%, 2.5%
- Find best risk-adjusted return
- Balance profit vs drawdown
**Step 3: R:R Optimization**
- Test 2:1, 2.5:1, 3:1
- Check which maximizes profit factor
- Consider holding time
**Step 4: Confluence Optimization**
- Test 1, 2, 3
- Find sweet spot for win rate
- Aim for 55-65% win rate
**Step 5: Regime Filter**
- Test with/without trend filter
- Test with/without chaos filter
- Find what works for your asset
---
## REAL TRADING EXAMPLES
### Example 1: Bull Trending - SPY
**Setup:**
- Regime: BULL TRENDING
- Price pulls back from $450 to $445
- EMA20 at $444
- RSI drops to 45
- Confluence: 4/5
**Entry:**
- Price closes at $445.50 (above EMA20)
- LONG signal appears
- Enter at $445.50
**Risk Management:**
- Stop: $443 (2 ATR = $2.50)
- Target: $451.75 (2.5:1 = $6.25)
- Risk: $2.50 per share
- Position: 80 shares (2% of $10k = $200 risk)
**Outcome:**
- Price rallies to $452 in 3 days
- Target hit
- Profit: $6.50 × 80 = $520
- Return: 2.6 × risk (excellent)
---
### Example 2: Bear Ranging - AAPL
**Setup:**
- Regime: BEAR RANGING
- Range: $165-$175
- Price rallies to $174
- Resistance at $175
- RSI at 68
- Confluence: 3/5
**Entry:**
- Rejection candle at $174
- SHORT signal appears
- Enter at $173.50
**Risk Management:**
- Stop: $176 (above resistance)
- Target: $166 (support)
- Risk: $2.50
- Position: 80 shares
**Outcome:**
- Price drops to $167 in 2 days
- Target hit
- Profit: $6.50 × 80 = $520
- Return: 2.6 × risk
---
### Example 3: Consolidation Breakout - BTC
**Setup:**
- Regime: CONSOLIDATION
- Range: $28,000 - $30,000
- Compressed for 2 weeks
- Volume declining
**Breakout:**
- Price breaks $30,000
- Volume surges 200%
- Close at $30,500
- LONG signal
**Entry:**
- Enter at $30,500
**Risk Management:**
- Stop: $29,500 (back in range)
- Target: $32,000 (range height = $2k)
- Risk: $1,000
- Position: 0.2 BTC ($200 risk on $10k)
**Outcome:**
- Price runs to $33,000
- Target exceeded
- Profit: $2,500 × 0.2 = $500
- Return: 2.5 × risk
---
### Example 4: Avoiding Chaos - Tesla
**Setup:**
- Regime: BULL TRENDING
- LONG position from $240
- Elon tweets something crazy
- Regime changes to CHAOS
**Action:**
- EXIT signal appears
- Close position immediately
- Current price: $242 (small profit)
**Outcome:**
- Next 3 days: wild swings
- High $255, Low $230
- By staying out, avoided:
- Potential stop out
- Whipsaw losses
- Stress
**Result:**
- Small profit preserved
- Capital protected
- Re-enter when regime stabilizes
---
## ALERTS SETUP
### Available Alerts
1. **Bull Trending Regime** - Market goes bullish
2. **Bear Trending Regime** - Market goes bearish
3. **Chaos Regime** - High volatility, stay out
4. **Long Entry Signal** - Buy opportunity
5. **Short Entry Signal** - Sell opportunity
6. **Long Exit Signal** - Close long
7. **Short Exit Signal** - Close short
### How to Set Up
1. Click **⏰ (Alert)** icon in TradingView
2. Select **Condition**: Choose indicator + alert type
3. **Options**: Popup, Email, Webhook, etc.
4. **Message**: Customize notification
5. Click **Create**
### Recommended Alert Strategy
**For Active Traders:**
- Long Entry Signal
- Short Entry Signal
- Long Exit Signal
- Short Exit Signal
**For Position Traders:**
- Bull Trending Regime (enter longs)
- Bear Trending Regime (enter shorts)
- Chaos Regime (exit all)
**For Conservative:**
- Only regime change alerts
- Manually review entries
- More selective
---
## TIPS FOR SUCCESS
### 1. Start Small
- Paper trade first
- Then 0.5% risk
- Build to 1-2% over time
### 2. Follow the Regime
- Don't fight it
- Adapt your style
- Different tactics for each
### 3. Trust the Confluence
- 4-5/5 = Best trades
- 2-3/5 = Good trades
- 1/5 = Skip unless desperate
### 4. Respect Exits
- Don't hope and hold
- Cut losses quickly
- Take profits at targets
### 5. Avoid Chaos
- Seriously, just stay out
- Protect your capital
- Wait for clarity
### 6. Keep a Journal
- Record every trade
- Note regime and confluence
- Review weekly
- Learn patterns
### 7. Backtest Thoroughly
- 3+ years minimum
- Multiple market conditions
- Different assets
- Walk-forward test
### 8. Be Patient
- Best setups are rare
- 1-3 trades per week is normal
- Quality over quantity
- Compound over time
---
## COMMON QUESTIONS
**Q: How many trades per month should I expect?**
A: Depends on timeframe and settings. Daily chart: 5-15 trades/month. 4H chart: 15-30 trades/month.
**Q: What's a good win rate?**
A: 55-65% is excellent. 50-55% is good. Below 50% needs adjustment.
**Q: Should I trade all regimes?**
A: Beginners: Only trending. Intermediate: Trending + ranging. Advanced: All except chaos.
**Q: Can I use this on any timeframe?**
A: Best on Daily and 4H. Works on 1H with more noise. Not recommended <1H.
**Q: What if I'm in a trade and regime changes?**
A: Exit immediately (if using indicator) or let strategy handle it automatically.
**Q: How do I know if I'm over-optimizing?**
A: If results are perfect on one period but fail on another. Use walk-forward testing.
**Q: Should I always take 5/5 confluence trades?**
A: Yes, but they're rare (1-2/month). Don't wait only for these.
**Q: Can I combine this with other indicators?**
A: Yes, but keep it simple. RSI, MACD already included. Maybe add volume profile.
**Q: What assets work best?**
A: Liquid stocks, major crypto, futures. Avoid forex spot (use futures), penny stocks.
**Q: How long to hold positions?**
A: Trending: Days to weeks. Ranging: Hours to days. Breakout: Days. Let the regime guide you.
---
## FINAL THOUGHTS
This system gives you:
- ✅ Clear market context (regime)
- ✅ High-probability entries (confluence)
- ✅ Defined exits (automatic signals)
- ✅ Adaptable tactics (regime-specific)
- ✅ Backtestable results (strategy version)
**Success requires:**
- 📚 Understanding each regime
- 🎯 Following the signals
- 💪 Discipline to wait
- 🧠 Emotional control
- 📊 Proper risk management
**Start your journey:**
1. Load the indicator
2. Watch for 1 week (no trading)
3. Identify regime patterns
4. Paper trade for 1 month
5. Go live with small size
6. Scale up as you gain confidence
**Remember:** The market will always be here. There's no rush. Master one regime at a time, and you'll be profitable in all conditions!
Good luck! 🚀
Gann Volume Swing (GVS)## **Gann Volume Swing (GVS) Indicator**
*Professional Hybrid Volume-Gann Reversal Detector*
### **Core Concept & Purpose**
The Gann Volume Swing (GVS) indicator is a sophisticated trading tool designed to identify high-probability reversal points by integrating three key market dimensions: **volume dynamics**, **geometric price levels**, and **momentum confirmation**. Developed for serious technical traders, GVS addresses the common challenge of distinguishing meaningful breakouts/reversals from temporary noise.
The indicator operates on the principle that **significant volume expansions** at **precise geometric support/resistance levels** (derived from Gann theory) often precede substantial price movements. By combining these elements with traditional momentum filters (RSI, MACD), GVS provides a multi-factor approach to market timing.
### **Theoretical Foundation**
The methodology synthesizes:
1. **Wyckoff's Volume-Price Relationship**: Volume precedes and confirms price action
2. **Gann's Geometric Trading**: Price moves in predictable angular patterns from swing points
3. **Modern Momentum Filters**: Additional confirmation from established oscillators
This creates a robust framework that respects both classical technical analysis and contemporary trading psychology.
---
## **TECHNICAL ARCHITECTURE**
### **1. Volume Engine Module**
```
Inputs:
• Volume MA Period (20): Smoothing window for volume baseline
• Volume Multiplier (2.0): Threshold for "abnormal" volume detection
Calculation Logic:
Current Volume > AND
Current Volume >
Output: Boolean flag signaling institutional-grade participation
```
### **2. Gann Geometry Module**
```
Pivot Detection:
• Swing Highs: PivotHigh(25,25) - Identifies significant peaks
• Swing Lows: PivotLow(25,25) - Identifies significant troughs
Line Generation:
• 1x1 Lines: Base angular lines from pivots (45-degree equivalents)
• 2x1 Lines: Secondary steeper/flatter lines (dynamic angles)
Key Parameter:
• Gann Sensitivity (0.5): Controls line steepness (0.1=flat, 1.0=steep)
```
### **3. Signal Generation Logic**
```
Long Signal =
+ + + +
Short Signal =
+ + + +
Anti-Whipsaw Protection:
• 5-bar cooldown between same-direction signals
• Proximity threshold: 0.5×ATR from Gann lines
```
### **4. Visualization System**
```
Primary Elements:
• Real-time Gann lines (4 colors, 2 styles)
• Signal markers (▲/▼ triangles)
• Bar coloring (lime/red highlights)
Display Control:
• Toggle Gann lines on/off
• Adjust transparency levels
• Custom alert configurations
```
---
## **QUICK REFERENCE CARD**
**GANN VOLUME SWING (GVS)**
*Volume-Powered Geometric Reversal Indicator*
### **🔧 PARAMETER SETTINGS**
**VOLUME GROUP**
`Volume MA Period`: 20 (14-30 range)
`Volume Multiplier`: 2.0 (1.5-2.5 optimal)
**GANN GROUP**
`Swing Period`: 50 bars (pivot sensitivity)
`Gann Sensitivity`: 0.3-0.5 (adjust for market type)
**FILTERS GROUP**
`RSI Period`: 14 (standard)
`Use Filters`: ON (recommended)
**DISPLAY GROUP**
`Show Gann Levels`: ON
`Cooldown Bars`: 5 (prevents signal flooding)
### **🎯 SIGNAL INTERPRETATION**
**LONG SETUP (Green ▲)**
- Volume spike (2× average) + Price at Gann support + Bullish candle
- Entry: Close of signal bar
- SL: 1.5×ATR below support line
- TP: Next Gann resistance or 2:1 R/R
**SHORT SETUP (Red ▼)**
- Volume spike + Price at Gann resistance + Bearish candle
- Entry: Close of signal bar
- SL: 1.5×ATR above resistance line
- TP: Next Gann support or 2:1 R/R
### **📊 VISUAL ELEMENTS KEY**
**LINES**
- `Solid Green`: 1x1 Support (primary)
- `Solid Red`: 1x1 Resistance (primary)
- `Blue Dots`: 2x1 Support (secondary)
- `Orange Dots`: 2x1 Resistance (secondary)
**MARKERS**
- `▲ Below Bar`: Long signal
- `▼ Above Bar`: Short signal
- `Bar Coloring`: Confirmation highlight
### **⚙️ OPTIMIZATION GUIDE**
**TRENDING MARKETS**
- Sensitivity: 0.2-0.3 (shallower angles)
- Volume Multiplier: 1.8-2.0
- Filters: Strict (RSI 65/35)
**RANGING MARKETS**
- Sensitivity: 0.6-0.8 (steeper angles)
- Volume Multiplier: 2.2-2.5
- Filters: Moderate (RSI 70/30)
**HIGH VOLATILITY**
- Increase ATR multiplier to 0.7-1.0
- Extend cooldown to 7-10 bars
- Require stronger volume confirmation
### **🚫 LIMITATIONS & NOTES**
**KNOWN CONSTRAINTS**
- Less effective in extremely choppy markets
- Requires adequate historical data (200+ bars)
- Volume reliability varies by asset class
- Gann lines repaint as new pivots form
**BEST PRACTICES**
- Combine with higher timeframe trend analysis
- Use on 1H+ charts for reliability
- Wait for close confirmation before acting
- Track win rate by market condition
**ALERT CONFIGURATION**
- Enable both Long/Short alerts
- Set to "Once Per Bar Close"
- Include ATR distance in alert message
- Log all signals for performance review
---
## **TRADING SYSTEM INTEGRATION**
### **Recommended Confluence Factors**
1. **Trend Alignment** (Higher timeframe direction)
2. **Market Structure** (Support/Resistance clusters)
3. **Economic Context** (News event proximity)
4. **Session Timing** (High-volume trading hours)
### **Risk Management Protocol**
- Maximum risk: 1% per trade
- Correlation limit: 2 simultaneous GVS signals
- Daily loss cap: 3% of portfolio
- Weekly review of signal accuracy
### **Performance Metrics to Track**
- Signal-to-Noise ratio (profitable signals/total)
- Average Reward/Risk achieved
- Best/worst market conditions
- Optimal parameter sets per asset
---
## **SUMMARY**
The **Gann Volume Swing** indicator represents a sophisticated approach to technical analysis, blending time-tested principles with modern computational techniques. By focusing on the confluence of **unusual volume**, **geometric price levels**, and **momentum confirmation**, it provides traders with a structured framework for identifying high-quality setups.
**Ideal User Profile**: Intermediate to advanced traders comfortable with multi-factor analysis, geometric concepts, and disciplined risk management.
**Disclaimer**: This tool generates probabilities, not certainties. Always combine with comprehensive market analysis and strict risk control measures.
---
**Version**: 5.0
**Category**: Volume + Geometric Analysis
**Complexity**: Advanced
**Best Timeframe**: 1H - Daily
**Recommended Assets**: Liquid stocks, major Forex pairs, indices
AlphaSignals Pro🟠OVERVIEW
AlphaSignals Pro™ is a comprehensive trading indicator suite developed by A1TradingHub. The
system combines trend analysis, momentum indicators, and proprietary signal algorithms to identify
high-probability trading opportunities across all market conditions and timeframes.
Core Components
■ Long/Short Signals — Clear entry markers based on trend reversals and momentum shifts
■ Golden Call/Put — Premium signals for high-conviction directional trades
■ Support & Resistance — Dynamic price zones with visual highlighting
■ Moving Averages — Trend direction with color-coded crossover signals
■ Keltner Channels — Volatility bands for breakout and mean-reversion setups
■ Signal Dashboard — Multi-symbol overview with trend and momentum status
🟠Long & Short Entry Signals
The core signal system identifies optimal entry points by analyzing price action, momentum, and
trend structure. LONG signals appear at potential reversal points for upward moves, while SHORT
signals indicate bearish opportunities at resistance.
◆ Green 'LONG' labels mark buy zones at support levels
◆ Red 'SHORT' labels indicate sell zones at resistance
◆ Momentum confirmation filters out false signals
◆ Works across all timeframes (1min to daily)
🟠Trend Direction Arrows
Small directional arrows provide real-time trend feedback. ▲ Green arrows confirm bullish
momentum, ▼ red arrows signal bearish pressure. These micro-signals help traders stay aligned with
the dominant trend.
◆ Green up arrows during bullish momentum phases
◆ Red down arrows indicate bearish momentum shifts
◆ Confirms entry signals and aids trade management
◆ Minimalist design preserves chart clarity
🟠 Golden Put Signal
The Golden Put identifies high-probability short opportunities. Triggers when multiple bearish factors
align: price rejection at resistance, momentum divergence, and volume confirmation. These premium
signals represent the highest-conviction bearish trades.
◆ Triggered at major resistance with momentum divergence
◆ Red 'GOLDEN PUT' label marks premium short entries
◆ Designed for options traders seeking directional plays
◆ Lower frequency, higher accuracy than standard signals
🟠 Golden Call Signal
The Golden Call is the bullish counterpart, identifying premium long opportunities. Appears when
price finds strong support with bullish momentum divergence and institutional volume patterns. Marks
optimal entry points for aggressive upside plays.
◆ Yellow 'GOLDEN CALL' highlights premium buy setups
◆ Triggers at key support with momentum confirmation
◆ Ideal for call options or leveraged positions
◆ Signals typically precede significant advances
🟠 Moving Average System
The dual moving average system provides trend context and dynamic support/resistance. The red
line is the fast MA (shorter period), the green line is the slow MA. Color transitions indicate trend
changes and crossover signals.
◆ Red MA: Fast period for short-term direction
◆ Green MA: Slow period for primary trend
◆ Bullish crossover: Fast crosses above slow
◆ Bearish crossover: Fast crosses below slow
◆ MAs act as dynamic support/resistance
🟠 Keltner Channel Bands
Volatility-based price envelopes that adapt to market conditions. Bands expand during high volatility,
contract during consolidation. Price at outer bands signals mean-reversion opportunities; breakouts
beyond bands may indicate trend continuation.
◆ Upper/lower bands adapt to current volatility
◆ Pink outer bands mark extreme price zones
◆ Cyan middle band shows baseline trend
◆ Band touches signal reversal or breakout setups
◆ Shaded fill visualizes the volatility range
🟠 Support & Resistance Zones
Automatic detection of key price levels with visual highlighting. Green zones mark support where
buying pressure emerges, red zones highlight resistance with selling pressure. Dashed lines show
precise price levels.
◆ Green shaded areas: Support zones (buy interest)
◆ Red shaded areas: Resistance zones (sell interest)
◆ Horizontal dashed lines mark exact levels
◆ Zones update dynamically as new levels form
◆ Essential for targets and stop-loss placement
🟠 Golden Signal Dashboard
Multi-symbol dashboard provides comprehensive market overview. Track multiple instruments with
real-time trend status, momentum readings, active signals, and freshness indicators. Perfect for
scanning opportunities across your watchlist.
◆ SYMBOL: Tracked instruments (SPY, QQQ, IWM, TSLA)
◆ PRICE & CHG%: Current price and daily change
◆ MOMENTUM: Bullish/Bearish classification
◆ SIGNAL: Active Golden Call or Put signals
◆ BARS: Bars since last signal
◆ STATUS: Signal temperature (HOT/WARM/COLD)
🟠 Best Practices
✓ Confirm signals with dominant trend (use MAs)
✓ Prioritize Golden signals — higher probability
✓ Use S/R zones for stop-loss placement
✓ Check dashboard for multi-timeframe confluence
✓ Combine with your own analysis
Multi-Timeframe Moving Averages (10 lines)Allows you to put up to 10 moving average lines on a chart and view on any timeframe.
Completely customisable:
SMA or EMA
Daily, Weekly or Current
Line Colour
Line Thickness
Line Visibility
MA Label Visibility
Defaults to line smoothing so daily and weekly appear smooth on lower timeframes. You can switch this to actual, where the MA will be 'stepped'.
Labels appear to the right of the MA end-point describing the MA, so it's easy to understand which line is which when multiple are added to the chart.
Common SMAs and EMAs are pre-populated for convenience.
Dynamic Pivot Point [MarkitTick]Title: Dynamic Pivot Point MarkitTick
Concept
Unlike traditional Pivot Points, which plot static horizontal levels based on the previous period's High, Low, and Close, this script introduces a dynamic element by applying an Exponential Moving Average (EMA) to the calculated pivot levels. This approach allows the Support and Resistance zones to adapt more fluidly to recent price action, reducing the jagged steps often seen in standard multi-timeframe pivot indicators.
How It Works
The script operates in two distinct phases of calculation:
1. Data Extraction and Core Math:
The indicator first requests the High, Low, and Close data from a user-defined timeframe (e.g., Daily, Weekly). Using this data, it calculates the standard Pivot Point (P) alongside three levels of Support (S1, S2, S3) and three levels of Resistance (R1, R2, R3) using standard geometric formulas:
Pivot = (High + Low + Close) / 3
R1 = 2 * Pivot - Low
S1 = 2 * Pivot - High
(Subsequent levels follow standard Floor Pivot logic).
2. Dynamic Smoothing:
Instead of plotting these raw values directly, the script processes each calculated level (P, S1-S3, R1-R3) through an Exponential Moving Average (EMA). The length of this EMA is controlled by the Pivot Length input. This smoothing process filters out minor volatility and creates curved, dynamic trajectories for the pivot levels rather than static straight lines.
How to Use
Traders can use this tool to identify dynamic areas of interest where price may react.
The White Line represents the Central Pivot. Price action relative to this line helps determine the immediate bias (above for bullish, below for bearish).
Green Lines (Support 1, 2, 3) indicate potential demand zones where price may bounce during a downtrend.
Red Lines (Resistance 1, 2, 3) indicate potential supply zones where price may reject during an uptrend.
Because the levels are smoothed, they can also act as dynamic trend followers, similar to moving averages, but derived from pivot geometry.
Settings
Show Pivot Points: Toggles the visibility of the plot lines on the chart.
Pivot Length: Defines the lookback period for the EMA smoothing applied to the pivot levels. A higher number results in smoother, slower-reacting lines.
Timeframe: Determines the timeframe used for the underlying High/Low/Close data (e.g., selecting "D" calculates pivots based on Daily data while viewing a lower timeframe chart).
Disclaimer This tool is for educational and technical analysis purposes only. Breakouts can fail (fake-outs), and past geometric patterns do not guarantee future price action. Always manage risk and use this tool in conjunction with other forms of analysis.
Engulfing Cycle# **Engulfing Cycles - Opening & Mid Phase** 📊⚡
## **Advanced Cyclical Timing Strategy with Engulfing Patterns**
### **🎯 CORE CONCEPT**
Innovative strategy combining **engulfing candlestick patterns** with **market cycle analysis** to identify high-probability entry points during opening and mid-cycle phases. Not just another engulfing detector, but a complete system selecting ONLY patterns occurring at cyclically optimal moments.
### **⚙️ HOW IT WORKS**
**1. TWO CYCLE TYPES:**
- **Index Cycle**: From pivot low to pivot high (bullish phase)
- **Inverse Cycle**: From pivot high to pivot low (bearish phase)
**2. PRIVILEGED TIMING ZONES:**
- **OPENING ZONE**: First 8 bars after a pivot (maximum cycle energy)
- **MID ZONE**: Bars 14-25 (momentum renewal)
**3. MULTI-LEVEL SIGNAL SYSTEM:**
```
Level 1: Basic engulfing (gray signals)
Level 2: Engulfing in valid zone (orange)
Level 3: OPTIMAL engulfing with ≥3/6 filters (green/red)
```
### **🔍 INTEGRATED CONFIRMATION FILTERS**
**PRIMARY TREND:**
- Gann High/Low system for directional bias
- Dual EMA (78/278) for momentum confirmation
**MOMENTUM:**
- RSI for overbought/oversold conditions
- Volume above average (configurable)
**STRUCTURE:**
- Dynamic support/resistance levels
- Minimum distance from EMA for movement space
- Pullback validation
### **📈 COMPLETE VISUALIZATION**
**GRAPHICAL ELEMENTS:**
- ✅ **Color-coded signals** (gray → orange → green/red)
- ✅ **Cycle zone backgrounds** (green/blue for opening/mid)
- ✅ **EMA & Gann lines** with trend coloring
- ✅ **Support/Resistance** with circle style
- ✅ **Real-time info table** (top-right corner)
**INCLUDED DATA TABLE:**
- Total/optimal signal statistics
- Current cycle type (Index/Inverse)
- Bars since pivot counters
- Active filter status
- Current cycle zone
- Anti-spam lock status
### **⚡ MULTI-LEVEL ALERT SYSTEM**
**5 CONFIGURABLE ALERT TYPES:**
1. 🔔 **Any Engulfing** - General monitoring
2. ⬆️ **Bull Engulfing** - Basic bullish pattern
3. ⬇️ **Bear Engulfing** - Basic bearish pattern
4. 🟠 **In Valid Zone** - Added cyclical timing
5. 🟢🔴 **OPTIMAL SIGNALS** - Premium signals with maximum confirmation
### **🎚️ FULLY ADJUSTABLE PARAMETERS**
**CYCLES:**
- Minimum/Average/Maximum (21/32/44 default)
- Opening Zone (8 bars) and Mid Zone (14-25 bars)
**FILTERS:**
- Volume multiplier (1.2x default)
- Minimum engulfing body size (1.5x default)
- RSI thresholds (70/30)
- Minimum EMA distance (1.5%)
**TECHNICALS:**
- EMA periods (78/278)
- Gann periods (13/21)
- Pivot length (5)
### **🛡️ PROTECTION SYSTEMS**
**ANTI-SPAM:**
- 5-bar lock after signal
- Price stagnation detection
- Only 1 signal per movement
**QUALITY CONTROL:**
- Minimum 3/6 active filters required
- Cycle zone validation
- Volume and momentum confirmation
### **📊 PRACTICAL APPLICATION**
**RECOMMENDED TIMEFRAMES:** 1H, 4H, Daily
**ASSETS:** Major Forex pairs, Indices, Liquid stocks
**CONTEXT:** Best in markets with defined cycles
**OPTIMAL SIGNAL =**
```
+
+
+
+
```
### **🎨 PROFESSIONAL DESIGN**
- Clean, non-invasive interface
- Intuitive color coding
- All elements toggleable
- Light performance (max_bars_back=500)
### **📋 UNIQUE FEATURES**
1. **CYCLICAL TIMING** - Not just WHAT, but WHEN
2. **SIGNAL GRADATION** - From basic to optimal
3. **SELF-CONTROL** - Built-in anti-false system
4. **TRANSPARENCY** - All filters visible in table
5. **FLEXIBILITY** - Adaptable to different trading styles
---
**⚠️ DISCLAIMER:** This is an advanced analytical tool. "Optimal" signals (green/red) offer higher reliability but still require appropriate risk management. Always backtest on historical data before live use.
**Author:** Alblanz
**Category:** Patterns + Cycles + Timing
**Complexity:** Medium-High
**Version:** 5.0
**Updated:** [4/12/2025
*For support or suggestions, leave a comment on the script page.*
Buy / Sell Signals With Take Profits (Non-Repaint)This indicator generates automatic BUY/SELL flip signals based on trend direction, volatility status, and ATR dynamics.
Labels are placed based on actual High/Low and do not shift.
Features
✔ Dynamic ATR Multipliers
✔ Volatility Stretch (calm market → narrow, aggressive → wide)
✔ Trend Memory (25-bar direction memory)
✔ Automatic TP1–TP5 (%1 – %5) calculation
✔ Desktop & Mobile compatible TP Panel
✔ Bull/Bear Flip labels
✔ TradingView alert support
Suitable Markets
Forex, Crypto, Stocks, Indices, Gold, Oil
Works on all timeframes (5min – 1min – 4min – Daily).
⚠ Important Note
This tool is not investment advice.
It does not provide any buy–sell recommendations.
All trading decisions are yours; risk management is entirely the user's responsibility.
ALFA BUY IndikatorThis indicator is an improved version of the Mucip + Yağız indicator. I have been using it smoothly for the past 3 months.
I use it on futures markets for the three major coins such as BNB/USDT, BTC/USDT, and ETH/USDT.
My usage logic is as follows: on average, it generates around 2 signals per coin per day.
For each trade, I enter positions using 4–5% of my total capital.
I use 25x leverage on ETH and BNB, and 50x leverage on BTC.
My take-profit levels are 0.25% for BTC and 0.5% for the others, which results in approximately 10–12% profit per trade.
Overall, the average daily capital growth is around 2–3%.
Note: I use a trading bot for executions, because the indicator is designed for 2-minute charts, and it is almost impossible to catch the signals manually.
So far, everything has been working flawlessly, and it performs best on 2-minute timeframes.
Khango's Key//@version=5
//@sbtnc thank you for doing the base code
//Added additional levels for convienience sake.
indicator('Key Levels SpacemanBTC IDWM', shorttitle='Khangos Key', overlay=true, max_lines_count=100)
//35 works
displayStyle = input.string(defval='Standard', title='Display Style', options= , inline='Display')
mergebool = input.bool(defval=true, title='Merge Levels?', inline='Display')
distanceright = input.int(defval=30, title='Distance', minval=5, maxval=500, inline='Dist')
radistance = input.int(defval=250, title='Anchor Distance', minval=5, maxval=500, inline='Dist')
labelsize = input.string(defval='Medium', title='Text Size', options= )
linesize = input.string(defval='Small', title='Line Width', options= , inline='Line')
linestyle = input.string(defval='Solid', title='Line Style', options= , inline='Line')
GlobalTextType = input.bool(defval=false, title='Global Text ShortHand', tooltip='Enable for shorthand text on all text')
var globalcoloring = input.bool(defval=false, title='Global Coloring', tooltip='Enable for all color controls via one color', inline='GC')
GlobalColor = input.color(title='', defval=color.white, inline='GC')
//var show_tails = input(defval = false, title = "Always Show", type = input.bool)
= request.security(syminfo.tickerid, 'D', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'D', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'D', [time , low ], lookahead=barmerge.lookahead_on)
cdailyh_open = request.security(syminfo.tickerid, 'D', high, lookahead=barmerge.lookahead_on)
cdailyl_open = request.security(syminfo.tickerid, 'D', low, lookahead=barmerge.lookahead_on)
var monday_time = time
var monday_high = high
var monday_low = low
= request.security(syminfo.tickerid, 'W', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'W', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'W', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', [time , low ], lookahead=barmerge.lookahead_on)
//------------------------------ Inputs -------------------------------
var is_intra_enabled = input.bool(defval=false, title='Open', group='4H', inline='4H')
var is_intrarange_enabled = input.bool(defval=false, title='Prev H/L', group='4H', inline='4H')
var is_intram_enabled = input.bool(defval=false, title='Prev Mid', group='4H', inline='4H')
IntraTextType = input.bool(defval=false, title='ShortHand', group='4H', inline='4Hsh')
var is_daily_enabled = input.bool(defval=true, title='Open', group='Daily', inline='Daily')
var is_dailyrange_enabled = input.bool(defval=false, title='Prev H/L', group='Daily', inline='Daily')
var is_dailym_enabled = input.bool(defval=false, title='Prev Mid', group='Daily', inline='Daily')
DailyTextType = input.bool(defval=false, title='ShortHand', group='Daily', inline='Dailysh')
var is_monday_enabled = input.bool(defval=true, title='Range', group='Monday Range', inline='Monday')
var is_monday_mid = input.bool(defval=true, title='Mid', group='Monday Range', inline='Monday')
var untested_monday = false
MondayTextType = input.bool(defval=false, title='ShortHand', group='Monday Range', inline='Mondaysh')
var is_weekly_enabled = input.bool(defval=true, title='Open', group='Weekly', inline='Weekly')
var is_weeklyrange_enabled = input.bool(defval=true, title='Prev H/L', group='Weekly', inline='Weekly')
var is_weekly_mid = input.bool(defval=true, title='Prev Mid', group='Weekly', inline='Weekly')
WeeklyTextType = input.bool(defval=false, title='ShortHand', group='Weekly', inline='Weeklysh')
var is_monthly_enabled = input.bool(defval=true, title='Open', group='Monthly', inline='Monthly')
var is_monthlyrange_enabled = input.bool(defval=true, title='Prev H/L', group='Monthly', inline='Monthly')
var is_monthly_mid = input.bool(defval=true, title='Prev Mid', group='Monthly', inline='Monthly')
MonthlyTextType = input.bool(defval=false, title='ShortHand', group='Monthly', inline='Monthlysh')
var is_quarterly_enabled = input.bool(defval=true, title='Open', group='Quarterly', inline='Quarterly')
var is_quarterlyrange_enabled = input.bool(defval=false, title='Prev H/L', group='Quarterly', inline='Quarterly')
var is_quarterly_mid = input.bool(defval=true, title='Prev Mid', group='Quarterly', inline='Quarterly')
QuarterlyTextType = input.bool(defval=false, title='ShortHand', group='Quarterly', inline='Quarterlysh')
var is_yearly_enabled = input.bool(defval=true, title='Open', group='Yearly', inline='Yearly')
var is_yearlyrange_enabled = input.bool(defval=false, title='Current H/L', group='Yearly', inline='Yearly')
var is_yearly_mid = input.bool(defval=true, title='Mid', group='Yearly', inline='Yearly')
YearlyTextType = input.bool(defval=false, title='ShortHand', group='Yearly', inline='Yearlysh')
var is_londonrange_enabled = input.bool(defval=false, title='London Range', group='FX Sessions', inline='FX')
var is_usrange_enabled = input.bool(defval=false, title='New York Range', group='FX Sessions', inline='FX')
var is_asiarange_enabled = input.bool(defval=false, title='Asia Range', group='FX Sessions', inline='FX')
SessionTextType = input.bool(defval=false, title='ShortHand', group='FX Sessions', inline='FXColor')
Londont = input.session("0800-1600", "London Session")
USt = input.session("1400-2100", "New York Session")
Asiat = input.session("0000-0900", "Tokyo Session")
DailyColor = input.color(title='', defval=#08bcd4, group='Daily', inline='Dailysh')
MondayColor = input.color(title='', defval=color.white, group='Monday Range', inline='Mondaysh')
WeeklyColor = input.color(title='', defval=#fffcbc, group='Weekly', inline='Weeklysh')
MonthlyColor = input.color(title='', defval=#08d48c, group='Monthly', inline='Monthlysh')
YearlyColor = input.color(title='', defval=color.red, group='Yearly', inline='Yearlysh')
quarterlyColor = input.color(title='', defval=color.red, group='Quarterly', inline='Quarterlysh')
IntraColor = input.color(title='', defval=color.orange, group='4H', inline='4Hsh')
LondonColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
USColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
AsiaColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
var pdhtext = GlobalTextType or DailyTextType ? 'PDH' : 'Prev Day High'
var pdltext = GlobalTextType or DailyTextType ? 'PDL' : 'Prev Day Low'
var dotext = GlobalTextType or DailyTextType ? 'DO' : 'Daily Open'
var pdmtext = GlobalTextType or DailyTextType ? 'PDM' : 'Prev Day Mid'
var pwhtext = GlobalTextType or WeeklyTextType ? 'PWH' : 'Prev Week High'
var pwltext = GlobalTextType or WeeklyTextType ? 'PWL' : 'Prev Week Low'
var wotext = GlobalTextType or WeeklyTextType ? 'WO' : 'Weekly Open'
var pwmtext = GlobalTextType or WeeklyTextType ? 'PWM' : 'Prev Week Mid'
var pmhtext = GlobalTextType or MonthlyTextType ? 'PMH' : 'Prev Month High'
var pmltext = GlobalTextType or MonthlyTextType ? 'PML' : 'Prev Month Low'
var motext = GlobalTextType or MonthlyTextType ? 'MO' : 'Monthly Open'
var pmmtext = GlobalTextType or MonthlyTextType ? 'PMM' : 'Prev Month Mid'
var pqhtext = GlobalTextType or QuarterlyTextType ? 'PQH' : 'Prev Quarter High'
var pqltext = GlobalTextType or QuarterlyTextType ? 'PQL' : 'Prev Quarter Low'
var qotext = GlobalTextType or QuarterlyTextType ? 'QO' : 'Quarterly Open'
var pqmtext = GlobalTextType or QuarterlyTextType ? 'PQM' : 'Prev Quarter Mid'
var cyhtext = GlobalTextType or YearlyTextType ? 'CYH' : 'Current Year High'
var cyltext = GlobalTextType or YearlyTextType ? 'CYL' : 'Current Year Low'
var yotext = GlobalTextType or YearlyTextType ? 'YO' : 'Yearly Open'
var cymtext = GlobalTextType or YearlyTextType ? 'CYM' : 'Current Year Mid'
var pihtext = GlobalTextType or IntraTextType ? 'P-4H-H' : 'Prev 4H High'
var piltext = GlobalTextType or IntraTextType ? 'P-4H-L' : 'Prev 4H Low'
var iotext = GlobalTextType or IntraTextType ? '4H-O' : '4H Open'
var pimtext = GlobalTextType or IntraTextType ? 'P-4H-M' : 'Prev 4H Mid'
var pmonhtext = GlobalTextType or MondayTextType ? 'MDAY-H' : 'Monday High'
var pmonltext = GlobalTextType or MondayTextType ? 'MDAY-L' : 'Monday Low'
var pmonmtext = GlobalTextType or MondayTextType ? 'MDAY-M' : 'Monday Mid'
var lhtext = GlobalTextType or SessionTextType ? 'Lon-H' : 'London High'
var lltext = GlobalTextType or SessionTextType ? 'Lon-L' : 'London Low'
var lotext = GlobalTextType or SessionTextType ? 'Lon-O' : 'London Open'
var ushtext = GlobalTextType or SessionTextType ? 'NY-H' : 'New York High'
var usltext = GlobalTextType or SessionTextType ? 'NY-L' : 'New York Low'
var usotext = GlobalTextType or SessionTextType ? 'NY-O' : 'New York Open'
var asiahtext = GlobalTextType or SessionTextType ? 'AS-H' : 'Asia High'
var asialtext = GlobalTextType or SessionTextType ? 'AS-L' : 'Asia Low'
var asiaotext = GlobalTextType or SessionTextType ? 'AS-O' : 'Asia Open'
if globalcoloring == true
DailyColor := GlobalColor
MondayColor := GlobalColor
WeeklyColor := GlobalColor
MonthlyColor := GlobalColor
YearlyColor := GlobalColor
quarterlyColor := GlobalColor
IntraColor := GlobalColor
IntraColor
if weekly_time != weekly_time
untested_monday := false
untested_monday
if is_monday_enabled == true and untested_monday == false
untested_monday := true
monday_time := daily_time
monday_high := cdailyh_open
monday_low := cdailyl_open
monday_low
linewidthint = 1
if linesize == 'Small'
linewidthint := 1
linewidthint
if linesize == 'Medium'
linewidthint := 2
linewidthint
if linesize == 'Large'
linewidthint := 3
linewidthint
var DEFAULT_LINE_WIDTH = linewidthint
var DEFAULT_TAIL_WIDTH = linewidthint
fontsize = size.small
if labelsize == 'Small'
fontsize := size.small
fontsize
if labelsize == 'Medium'
fontsize := size.normal
fontsize
if labelsize == 'Large'
fontsize := size.large
fontsize
linestyles = line.style_solid
if linestyle == 'Dashed'
linestyles := line.style_dashed
linestyles
if linestyle == 'Dotted'
linestyles := line.style_dotted
linestyles
var DEFAULT_LABEL_SIZE = fontsize
var DEFAULT_LABEL_STYLE = label.style_none
var DEFAULT_EXTEND_RIGHT = distanceright
London = time(timeframe.period, Londont)
US = time(timeframe.period, USt)
Asia = time(timeframe.period, Asiat)
var clondonhigh = 0.0
var clondonlow = close
var londontime = time
var flondonhigh = 0.0
var flondonlow = 0.0
var flondonopen = 0.0
var onelondonfalse = false
if London
if high > clondonhigh
clondonhigh := high
clondonhigh
if low < clondonlow
clondonlow := low
clondonlow
if onelondonfalse
londontime := time
flondonopen := open
flondonopen
flondonhigh := clondonhigh
flondonlow := clondonlow
onelondonfalse := false
onelondonfalse
else
if onelondonfalse == false
flondonhigh := clondonhigh
flondonlow := clondonlow
flondonlow
onelondonfalse := true
clondonhigh := 0.0
clondonlow := close
clondonlow
//////////////////////////////////
var cushigh = 0.0
var cuslow = close
var ustime = time
var fushigh = 0.0
var fuslow = 0.0
var fusopen = 0.0
var oneusfalse = false
if US
if high > cushigh
cushigh := high
cushigh
if low < cuslow
cuslow := low
cuslow
if oneusfalse
ustime := time
fusopen := open
fusopen
fushigh := cushigh
fuslow := cuslow
oneusfalse := false
oneusfalse
else
if oneusfalse == false
fushigh := cushigh
fuslow := cuslow
fuslow
oneusfalse := true
cushigh := 0.0
cuslow := close
cuslow
//////////////////////////////////
var casiahigh = 0.0
var casialow = close
var asiatime = time
var fasiahigh = 0.0
var fasialow = 0.0
var fasiaopen = 0.0
var oneasiafalse = false
if Asia
if high > casiahigh
casiahigh := high
casiahigh
if low < casialow
casialow := low
casialow
if oneasiafalse
asiatime := time
fasiaopen := open
fasiaopen
fasiahigh := casiahigh
fasialow := casialow
oneasiafalse := false
oneasiafalse
else
if oneasiafalse == false
fasiahigh := casiahigh
fasialow := casialow
fasialow
oneasiafalse := true
casiahigh := 0.0
casialow := close
casialow
//------------------------------ Plotting ------------------------------
var pricearray = array.new_float(0)
var labelarray = array.new_label(0)
f_LevelMerge(pricearray, labelarray, currentprice, currentlabel, currentcolor) =>
if array.includes(pricearray, currentprice)
whichindex = array.indexof(pricearray, currentprice)
labelhold = array.get(labelarray, whichindex)
whichtext = label.get_text(labelhold)
label.set_text(labelhold, label.get_text(currentlabel) + ' / ' + whichtext)
label.set_text(currentlabel, '')
label.set_textcolor(labelhold, currentcolor)
else
array.push(pricearray, currentprice)
array.push(labelarray, currentlabel)
var can_show_daily = is_daily_enabled and timeframe.isintraday
var can_show_weekly = is_weekly_enabled and not timeframe.isweekly and not timeframe.ismonthly
var can_show_monthly = is_monthly_enabled and not timeframe.ismonthly
get_limit_right(bars) =>
timenow + (time - time ) * bars
// the following code doesn't need to be processed on every candle
if barstate.islast
is_weekly_open = dayofweek == dayofweek.monday
is_monthly_open = dayofmonth == 1
can_draw_daily = (is_weekly_enabled ? not is_weekly_open : true) and (is_monthly_enabled ? not is_monthly_open : true)
can_draw_weekly = is_monthly_enabled ? not(is_monthly_open and is_weekly_open) : true
can_draw_intra = is_intra_enabled
can_draw_intrah = is_intrarange_enabled
can_draw_intral = is_intrarange_enabled
can_draw_intram = is_intram_enabled
pricearray := array.new_float(0)
labelarray := array.new_label(0)
/////////////////////////////////
if is_londonrange_enabled
//label.new(bar_index,high)
london_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
londontime := get_limit_right(radistance)
londontime
var londonh_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonhigh, y2=flondonhigh, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londonl_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonlow, y2=flondonlow, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londono_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonopen, y2=flondonopen, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londonh_label = label.new(x=london_limit_right, y=flondonhigh, text=lhtext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var londonl_label = label.new(x=london_limit_right, y=flondonlow, text=lltext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var londono_label = label.new(x=london_limit_right, y=flondonopen, text=lotext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(londonh_line, londontime)
line.set_x2(londonh_line, london_limit_right)
line.set_y1(londonh_line, flondonhigh)
line.set_y2(londonh_line, flondonhigh)
line.set_x1(londonl_line, londontime)
line.set_x2(londonl_line, london_limit_right)
line.set_y1(londonl_line, flondonlow)
line.set_y2(londonl_line, flondonlow)
line.set_x1(londono_line, londontime)
line.set_x2(londono_line, london_limit_right)
line.set_y1(londono_line, flondonopen)
line.set_y2(londono_line, flondonopen)
label.set_x(londonh_label, london_limit_right)
label.set_y(londonh_label, flondonhigh)
label.set_text(londonh_label, lhtext)
label.set_x(londonl_label, london_limit_right)
label.set_y(londonl_label, flondonlow)
label.set_text(londonl_label, lltext)
label.set_x(londono_label, london_limit_right)
label.set_y(londono_label, flondonopen)
label.set_text(londono_label, lotext)
if mergebool
f_LevelMerge(pricearray, labelarray, flondonhigh, londonh_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonlow, londonl_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonopen, londono_label, LondonColor)
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////
if is_usrange_enabled
//label.new(bar_index,high)
us_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
ustime := get_limit_right(radistance)
ustime
var ush_line = line.new(x1=ustime, x2=us_limit_right, y1=fushigh, y2=fushigh, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var usl_line = line.new(x1=ustime, x2=us_limit_right, y1=fuslow, y2=fuslow, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var uso_line = line.new(x1=ustime, x2=us_limit_right, y1=fusopen, y2=fusopen, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var ush_label = label.new(x=us_limit_right, y=fushigh, text=lhtext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var usl_label = label.new(x=us_limit_right, y=fuslow, text=lltext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var uso_label = label.new(x=us_limit_right, y=fusopen, text=lotext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(ush_line, ustime)
line.set_x2(ush_line, us_limit_right)
line.set_y1(ush_line, fushigh)
line.set_y2(ush_line, fushigh)
line.set_x1(usl_line, ustime)
line.set_x2(usl_line, us_limit_right)
line.set_y1(usl_line, fuslow)
line.set_y2(usl_line, fuslow)
line.set_x1(uso_line, ustime)
line.set_x2(uso_line, us_limit_right)
line.set_y1(uso_line, fusopen)
line.set_y2(uso_line, fusopen)
label.set_x(ush_label, us_limit_right)
label.set_y(ush_label, fushigh)
label.set_text(ush_label, ushtext)
label.set_x(usl_label, us_limit_right)
label.set_y(usl_label, fuslow)
label.set_text(usl_label, usltext)
label.set_x(uso_label, us_limit_right)
label.set_y(uso_label, fusopen)
label.set_text(uso_label, usotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fushigh, ush_label, USColor)
f_LevelMerge(pricearray, labelarray, fuslow, usl_label, USColor)
f_LevelMerge(pricearray, labelarray, fusopen, uso_label, USColor)
/////////////////////////////////
if is_asiarange_enabled
//label.new(bar_index,high)
asia_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
asiatime := get_limit_right(radistance)
asiatime
var asiah_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasiahigh, y2=fasiahigh, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asial_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasialow, y2=fasialow, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asiao_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasiaopen, y2=fasiaopen, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asiah_label = label.new(x=asia_limit_right, y=fasiahigh, text=asiahtext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var asial_label = label.new(x=asia_limit_right, y=fasialow, text=asialtext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var asiao_label = label.new(x=asia_limit_right, y=fasiaopen, text=asiaotext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(asiah_line, asiatime)
line.set_x2(asiah_line, asia_limit_right)
line.set_y1(asiah_line, fasiahigh)
line.set_y2(asiah_line, fasiahigh)
line.set_x1(asial_line, asiatime)
line.set_x2(asial_line, asia_limit_right)
line.set_y1(asial_line, fasialow)
line.set_y2(asial_line, fasialow)
line.set_x1(asiao_line, asiatime)
line.set_x2(asiao_line, asia_limit_right)
line.set_y1(asiao_line, fasiaopen)
line.set_y2(asiao_line, fasiaopen)
label.set_x(asiah_label, asia_limit_right)
label.set_y(asiah_label, fasiahigh)
label.set_text(asiah_label, asiahtext)
label.set_x(asial_label, asia_limit_right)
label.set_y(asial_label, fasialow)
label.set_text(asial_label, asialtext)
label.set_x(asiao_label, asia_limit_right)
label.set_y(asiao_label, fasiaopen)
label.set_text(asiao_label, asiaotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fasiahigh, asiah_label, AsiaColor)
f_LevelMerge(pricearray, labelarray, fasialow, asial_label, AsiaColor)
f_LevelMerge(pricearray, labelarray, fasiaopen, asiao_label, AsiaColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
if can_draw_intra
intra_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intra_time := get_limit_right(radistance)
intra_time
var intra_line = line.new(x1=intra_time, x2=intra_limit_right, y1=intra_open, y2=intra_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intra_label = label.new(x=intra_limit_right, y=intra_open, text=iotext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intra_line, intra_time)
line.set_x2(intra_line, intra_limit_right)
line.set_y1(intra_line, intra_open)
line.set_y2(intra_line, intra_open)
label.set_x(intra_label, intra_limit_right)
label.set_y(intra_label, intra_open)
label.set_text(intra_label, iotext)
if mergebool
f_LevelMerge(pricearray, labelarray, intra_open, intra_label, IntraColor)
//////////////////////////////////////////////////////////////////////////////////
//HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH
if can_draw_intrah
intrah_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intrah_time := get_limit_right(radistance)
intrah_time
var intrah_line = line.new(x1=intrah_time, x2=intrah_limit_right, y1=intrah_open, y2=intrah_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intrah_label = label.new(x=intrah_limit_right, y=intrah_open, text=pihtext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intrah_line, intrah_time)
line.set_x2(intrah_line, intrah_limit_right)
line.set_y1(intrah_line, intrah_open)
line.set_y2(intrah_line, intrah_open)
label.set_x(intrah_label, intrah_limit_right)
label.set_y(intrah_label, intrah_open)
label.set_text(intrah_label, pihtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intrah_open, intrah_label, IntraColor)
//////////////////////////////////////////////////////////////////////////////////
//LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW
if can_draw_intral
intral_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intral_time := get_limit_right(radistance)
intral_time
var intral_line = line.new(x1=intral_time, x2=intral_limit_right, y1=intral_open, y2=intral_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intral_label = label.new(x=intral_limit_right, y=intral_open, text=piltext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intral_line, intral_time)
line.set_x2(intral_line, intral_limit_right)
line.set_y1(intral_line, intral_open)
line.set_y2(intral_line, intral_open)
label.set_x(intral_label, intral_limit_right)
label.set_y(intral_label, intral_open)
label.set_text(intral_label, piltext)
if mergebool
f_LevelMerge(pricearray, labelarray, intral_open, intral_label, IntraColor)
///////////////////////////////////////////////////////////////////////////////
if can_draw_intram
intram_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
intram_time = intrah_time
intram_open = (intral_open + intrah_open) / 2
if displayStyle == 'Right Anchored'
intram_time := get_limit_right(radistance)
intram_time
var intram_line = line.new(x1=intram_time, x2=intram_limit_right, y1=intram_open, y2=intram_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intram_label = label.new(x=intram_limit_right, y=intram_open, text=pimtext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intram_line, intram_time)
line.set_x2(intram_line, intram_limit_right)
line.set_y1(intram_line, intram_open)
line.set_y2(intram_line, intram_open)
label.set_x(intram_label, intram_limit_right)
label.set_y(intram_label, intram_open)
label.set_text(intram_label, pimtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intram_open, intram_label, IntraColor)
////////////////////////////////////////// MONDAY
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var monday_line = line.new(x1=monday_time, x2=monday_limit_right, y1=monday_high, y2=monday_high, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monday_label = label.new(x=monday_limit_right, y=monday_high, text=pmonhtext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monday_line, monday_time)
line.set_x2(monday_line, monday_limit_right)
line.set_y1(monday_line, monday_high)
line.set_y2(monday_line, monday_high)
label.set_x(monday_label, monday_limit_right)
label.set_y(monday_label, monday_high)
label.set_text(monday_label, pmonhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_high, monday_label, MondayColor)
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var monday_low_line = line.new(x1=monday_time, x2=monday_limit_right, y1=monday_low, y2=monday_low, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monday_low_label = label.new(x=monday_limit_right, y=monday_low, text=pmonltext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monday_low_line, monday_time)
line.set_x2(monday_low_line, monday_limit_right)
line.set_y1(monday_low_line, monday_low)
line.set_y2(monday_low_line, monday_low)
label.set_x(monday_low_label, monday_limit_right)
label.set_y(monday_low_label, monday_low)
label.set_text(monday_low_label, pmonltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_low, monday_low_label, MondayColor)
if is_monday_mid
mondaym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
mondaym_open = (monday_high + monday_low) / 2
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var mondaym_line = line.new(x1=monday_time, x2=mondaym_limit_right, y1=mondaym_open, y2=mondaym_open, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var mondaym_label = label.new(x=mondaym_limit_right, y=mondaym_open, text=pmonmtext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(mondaym_line, monday_time)
line.set_x2(mondaym_line, mondaym_limit_right)
line.set_y1(mondaym_line, mondaym_open)
line.set_y2(mondaym_line, mondaym_open)
label.set_x(mondaym_label, mondaym_limit_right)
label.set_y(mondaym_label, mondaym_open)
label.set_text(mondaym_label, pmonmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, mondaym_open, mondaym_label, MondayColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN
if is_daily_enabled
daily_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
daily_time := get_limit_right(radistance)
daily_time
var daily_line = line.new(x1=daily_time, x2=daily_limit_right, y1=daily_open, y2=daily_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var daily_label = label.new(x=daily_limit_right, y=daily_open, text=dotext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(daily_line, daily_time)
line.set_x2(daily_line, daily_limit_right)
line.set_y1(daily_line, daily_open)
line.set_y2(daily_line, daily_open)
label.set_x(daily_label, daily_limit_right)
label.set_y(daily_label, daily_open)
label.set_text(daily_label, dotext)
if mergebool
f_LevelMerge(pricearray, labelarray, daily_open, daily_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH
if is_dailyrange_enabled
dailyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyh_time := get_limit_right(radistance)
dailyh_time
// draw tails before lines for better visual
var dailyh_line = line.new(x1=dailyh_time, x2=dailyh_limit_right, y1=dailyh_open, y2=dailyh_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailyh_label = label.new(x=dailyh_limit_right, y=dailyh_open, text=pdhtext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailyh_line, dailyh_time)
line.set_x2(dailyh_line, dailyh_limit_right)
line.set_y1(dailyh_line, dailyh_open)
line.set_y2(dailyh_line, dailyh_open)
label.set_x(dailyh_label, dailyh_limit_right)
label.set_y(dailyh_label, dailyh_open)
label.set_text(dailyh_label, pdhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyh_open, dailyh_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW
if is_dailyrange_enabled
dailyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyl_time := get_limit_right(radistance)
dailyl_time
var dailyl_line = line.new(x1=dailyl_time, x2=dailyl_limit_right, y1=dailyl_open, y2=dailyl_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailyl_label = label.new(x=dailyl_limit_right, y=dailyl_open, text=pdltext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailyl_line, dailyl_time)
line.set_x2(dailyl_line, dailyl_limit_right)
line.set_y1(dailyl_line, dailyl_open)
line.set_y2(dailyl_line, dailyl_open)
label.set_x(dailyl_label, dailyl_limit_right)
label.set_y(dailyl_label, dailyl_open)
label.set_text(dailyl_label, pdltext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyl_open, dailyl_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////// Daily MID
if is_dailym_enabled
dailym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
dailym_time = dailyh_time
dailym_open = (dailyl_open + dailyh_open) / 2
if displayStyle == 'Right Anchored'
dailym_time := get_limit_right(radistance)
dailym_time
var dailym_line = line.new(x1=dailym_time, x2=dailym_limit_right, y1=dailym_open, y2=dailym_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailym_label = label.new(x=dailym_limit_right, y=dailym_open, text=pdmtext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailym_line, dailym_time)
line.set_x2(dailym_line, dailym_limit_right)
line.set_y1(dailym_line, dailym_open)
line.set_y2(dailym_line, dailym_open)
label.set_x(dailym_label, dailym_limit_right)
label.set_y(dailym_label, dailym_open)
label.set_text(dailym_label, pdmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailym_open, dailym_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
if is_weekly_enabled
weekly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
cweekly_time = weekly_time
if displayStyle == 'Right Anchored'
cweekly_time := get_limit_right(radistance)
cweekly_time
var weekly_line = line.new(x1=cweekly_time, x2=weekly_limit_right, y1=weekly_open, y2=weekly_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weekly_label = label.new(x=weekly_limit_right, y=weekly_open, text=wotext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weekly_line, cweekly_time)
line.set_x2(weekly_line, weekly_limit_right)
line.set_y1(weekly_line, weekly_open)
line.set_y2(weekly_line, weekly_open)
label.set_x(weekly_label, weekly_limit_right)
label.set_y(weekly_label, weekly_open)
label.set_text(weekly_label, wotext)
if mergebool
f_LevelMerge(pricearray, labelarray, weekly_open, weekly_label, WeeklyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
// if is_weekly_open and can_show_daily
// label.set_text(weekly_label, "DO / WO ")
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// WEEKLY HIGH WEEKLY HIGH WEEKLY HIGH
if is_weeklyrange_enabled
weeklyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyh_time := get_limit_right(radistance)
weeklyh_time
var weeklyh_line = line.new(x1=weeklyh_time, x2=weeklyh_limit_right, y1=weeklyh_open, y2=weeklyh_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklyh_label = label.new(x=weeklyh_limit_right, y=weeklyh_open, text=pwhtext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklyh_line, weeklyh_time)
line.set_x2(weeklyh_line, weeklyh_limit_right)
line.set_y1(weeklyh_line, weeklyh_open)
line.set_y2(weeklyh_line, weeklyh_open)
label.set_x(weeklyh_label, weeklyh_limit_right)
label.set_y(weeklyh_label, weeklyh_open)
label.set_text(weeklyh_label, pwhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyh_open, weeklyh_label, WeeklyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// WEEKLY LOW WEEKLY LOW WEEKLY LOW
if is_weeklyrange_enabled
weeklyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyl_time := get_limit_right(radistance)
weeklyl_time
var weeklyl_line = line.new(x1=weeklyl_time, x2=weeklyl_limit_right, y1=weekly_open, y2=weekly_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklyl_label = label.new(x=weeklyl_limit_right, y=weeklyl_open, text=pwltext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklyl_line, weeklyl_time)
line.set_x2(weeklyl_line, weeklyl_limit_right)
line.set_y1(weeklyl_line, weeklyl_open)
line.set_y2(weeklyl_line, weeklyl_open)
label.set_x(weeklyl_label, weeklyl_limit_right)
label.set_y(weeklyl_label, weeklyl_open)
label.set_text(weeklyl_label, pwltext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyl_open, weeklyl_label, WeeklyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// Weekly MID
if is_weekly_mid
weeklym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
weeklym_time = weeklyh_time
weeklym_open = (weeklyl_open + weeklyh_open) / 2
if displayStyle == 'Right Anchored'
weeklym_time := get_limit_right(radistance)
weeklym_time
var weeklym_line = line.new(x1=weeklym_time, x2=weeklym_limit_right, y1=weeklym_open, y2=weeklym_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklym_label = label.new(x=weeklym_limit_right, y=weeklym_open, text=pwmtext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklym_line, weeklym_time)
line.set_x2(weeklym_line, weeklym_limit_right)
line.set_y1(weeklym_line, weeklym_open)
line.set_y2(weeklym_line, weeklym_open)
label.set_x(weeklym_label, weeklym_limit_right)
label.set_y(weeklym_label, weeklym_open)
label.set_text(weeklym_label, pwmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklym_open, weeklym_label, WeeklyColor)
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY LOW LOW LOW
if is_yearlyrange_enabled
yearlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyl_time := get_limit_right(radistance)
yearlyl_time
var yearlyl_line = line.new(x1=yearlyl_time, x2=yearlyl_limit_right, y1=yearlyl_open, y2=yearlyl_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlyl_label = label.new(x=yearlyl_limit_right, y=yearlyl_open, text=cyltext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlyl_line, yearlyl_time)
line.set_x2(yearlyl_line, yearlyl_limit_right)
line.set_y1(yearlyl_line, yearlyl_open)
line.set_y2(yearlyl_line, yearlyl_open)
label.set_x(yearlyl_label, yearlyl_limit_right)
label.set_y(yearlyl_label, yearlyl_open)
label.set_text(yearlyl_label, cyltext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyl_open, yearlyl_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY HIGH HIGH HIGH
if is_yearlyrange_enabled
yearlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyh_time := get_limit_right(radistance)
yearlyh_time
var yearlyh_line = line.new(x1=yearlyh_time, x2=yearlyh_limit_right, y1=yearlyh_open, y2=yearlyh_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlyh_label = label.new(x=yearlyh_limit_right, y=yearlyh_open, text=cyhtext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlyh_line, yearlyh_time)
line.set_x2(yearlyh_line, yearlyh_limit_right)
line.set_y1(yearlyh_line, yearlyh_open)
line.set_y2(yearlyh_line, yearlyh_open)
label.set_x(yearlyh_label, yearlyh_limit_right)
label.set_y(yearlyh_label, yearlyh_open)
label.set_text(yearlyh_label, cyhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyh_open, yearlyh_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY OPEN
if is_yearly_enabled
yearly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearly_time := get_limit_right(radistance)
yearly_time
var yearly_line = line.new(x1=yearly_time, x2=yearly_limit_right, y1=yearly_open, y2=yearly_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearly_label = label.new(x=yearly_limit_right, y=yearly_open, text=yotext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearly_line, yearly_time)
line.set_x2(yearly_line, yearly_limit_right)
line.set_y1(yearly_line, yearly_open)
line.set_y2(yearly_line, yearly_open)
label.set_x(yearly_label, yearly_limit_right)
label.set_y(yearly_label, yearly_open)
label.set_text(yearly_label, yotext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearly_open, yearly_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// yearly MID
if is_yearly_mid
yearlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
yearlym_time = yearlyh_time
yearlym_open = (yearlyl_open + yearlyh_open) / 2
if displayStyle == 'Right Anchored'
yearlym_time := get_limit_right(radistance)
yearlym_time
var yearlym_line = line.new(x1=yearlym_time, x2=yearlym_limit_right, y1=yearlym_open, y2=yearlym_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlym_label = label.new(x=yearlym_limit_right, y=yearlym_open, text=cymtext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlym_line, yearlym_time)
line.set_x2(yearlym_line, yearlym_limit_right)
line.set_y1(yearlym_line, yearlym_open)
line.set_y2(yearlym_line, yearlym_open)
label.set_x(yearlym_label, yearlym_limit_right)
label.set_y(yearlym_label, yearlym_open)
label.set_text(yearlym_label, cymtext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlym_open, yearlym_label, YearlyColor)
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY OPEN
if is_quarterly_enabled
quarterly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterly_time := get_limit_right(radistance)
quarterly_time
var quarterly_line = line.new(x1=quarterly_time, x2=quarterly_limit_right, y1=quarterly_open, y2=quarterly_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterly_label = label.new(x=quarterly_limit_right, y=quarterly_open, text=qotext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterly_line, quarterly_time)
line.set_x2(quarterly_line, quarterly_limit_right)
line.set_y1(quarterly_line, quarterly_open)
line.set_y2(quarterly_line, quarterly_open)
label.set_x(quarterly_label, quarterly_limit_right)
label.set_y(quarterly_label, quarterly_open)
label.set_text(quarterly_label, qotext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterly_open, quarterly_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY High
if is_quarterlyrange_enabled
quarterlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyh_time := get_limit_right(radistance)
quarterlyh_time
var quarterlyh_line = line.new(x1=quarterlyh_time, x2=quarterlyh_limit_right, y1=quarterlyh_open, y2=quarterlyh_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlyh_label = label.new(x=quarterlyh_limit_right, y=quarterlyh_open, text=pqhtext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlyh_line, quarterlyh_time)
line.set_x2(quarterlyh_line, quarterlyh_limit_right)
line.set_y1(quarterlyh_line, quarterlyh_open)
line.set_y2(quarterlyh_line, quarterlyh_open)
label.set_x(quarterlyh_label, quarterlyh_limit_right)
label.set_y(quarterlyh_label, quarterlyh_open)
label.set_text(quarterlyh_label, pqhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyh_open, quarterlyh_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY Low
if is_quarterlyrange_enabled
quarterlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyl_time := get_limit_right(radistance)
quarterlyl_time
var quarterlyl_line = line.new(x1=quarterlyl_time, x2=quarterlyl_limit_right, y1=quarterlyl_open, y2=quarterlyl_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlyl_label = label.new(x=quarterlyl_limit_right, y=quarterlyl_open, text=pqltext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlyl_line, quarterlyl_time)
line.set_x2(quarterlyl_line, quarterlyl_limit_right)
line.set_y1(quarterlyl_line, quarterlyl_open)
line.set_y2(quarterlyl_line, quarterlyl_open)
label.set_x(quarterlyl_label, quarterlyl_limit_right)
label.set_y(quarterlyl_label, quarterlyl_open)
label.set_text(quarterlyl_label, pqltext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyl_open, quarterlyl_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY MID
if is_quarterly_mid
quarterlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
quarterlym_time = quarterlyh_time
quarterlym_open = (quarterlyl_open + quarterlyh_open) / 2
if displayStyle == 'Right Anchored'
quarterlym_time := get_limit_right(radistance)
quarterlym_time
var quarterlym_line = line.new(x1=quarterlym_time, x2=quarterlym_limit_right, y1=quarterlym_open, y2=quarterlym_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlym_label = label.new(x=quarterlym_limit_right, y=quarterlym_open, text=pqmtext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlym_line, quarterlym_time)
line.set_x2(quarterlym_line, quarterlym_limit_right)
line.set_y1(quarterlym_line, quarterlym_open)
line.set_y2(quarterlym_line, quarterlym_open)
label.set_x(quarterlym_label, quarterlym_limit_right)
label.set_y(quarterlym_label, quarterlym_open)
label.set_text(quarterlym_label, pqmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlym_open, quarterlym_label, quarterlyColor)
////////////////////////////////////////////////////////////////////////////////// Monthly LOW LOW LOW
if is_monthlyrange_enabled
monthlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyl_time := get_limit_right(radistance)
monthlyl_time
var monthlyl_line = line.new(x1=monthlyl_time, x2=monthlyl_limit_right, y1=monthlyl_open, y2=monthlyl_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyl_label = label.new(x=monthlyl_limit_right, y=monthlyl_open, text=pmltext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyl_line, monthlyl_time)
line.set_x2(monthlyl_line, monthlyl_limit_right)
line.set_y1(monthlyl_line, monthlyl_open)
line.set_y2(monthlyl_line, monthlyl_open)
label.set_x(monthlyl_label, monthlyl_limit_right)
label.set_y(monthlyl_label, monthlyl_open)
label.set_text(monthlyl_label, pmltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyl_open, monthlyl_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// MONTHLY HIGH HIGH HIGH
if is_monthlyrange_enabled
monthlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyh_time := get_limit_right(radistance)
monthlyh_time
var monthlyh_line = line.new(x1=monthlyh_time, x2=monthlyh_limit_right, y1=monthlyh_open, y2=monthlyh_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyh_label = label.new(x=monthlyh_limit_right, y=monthlyh_open, text=pmhtext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyh_line, monthlyl_time)
line.set_x2(monthlyh_line, monthlyh_limit_right)
line.set_y1(monthlyh_line, monthlyh_open)
line.set_y2(monthlyh_line, monthlyh_open)
label.set_x(monthlyh_label, monthlyh_limit_right)
label.set_y(monthlyh_label, monthlyh_open)
label.set_text(monthlyh_label, pmhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyh_open, monthlyh_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
//////////////////////////////////////////////////////////////////////////////// MONTHLY MID
if is_monthly_mid
monthlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
monthlym_time = monthlyh_time
monthlym_open = (monthlyl_open + monthlyh_open) / 2
if displayStyle == 'Right Anchored'
monthlym_time := get_limit_right(radistance)
monthlym_time
var monthlym_line = line.new(x1=monthlym_time, x2=monthlym_limit_right, y1=monthlym_open, y2=monthlym_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlym_label = label.new(x=monthlym_limit_right, y=monthlym_open, text=pmmtext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlym_line, monthlym_time)
line.set_x2(monthlym_line, monthlym_limit_right)
line.set_y1(monthlym_line, monthlym_open)
line.set_y2(monthlym_line, monthlym_open)
label.set_x(monthlym_label, monthlym_limit_right)
label.set_y(monthlym_label, monthlym_open)
label.set_text(monthlym_label, pmmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlym_open, monthlym_label, MonthlyColor)
//////////////////////////////////////////////////////////////////////////////////
if is_monthly_enabled
monthly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthly_time := get_limit_right(radistance)
monthly_time
var monthlyLine = line.new(x1=monthly_time, x2=monthly_limit_right, y1=monthly_open, y2=monthly_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyLabel = label.new(x=monthly_limit_right, y=monthly_open, text=motext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyLine, monthly_time)
line.set_x2(monthlyLine, monthly_limit_right)
line.set_y1(monthlyLine, monthly_open)
line.set_y2(monthlyLine, monthly_open)
label.set_x(monthlyLabel, monthly_limit_right)
label.set_y(monthlyLabel, monthly_open)
label.set_text(monthlyLabel, motext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthly_open, monthlyLabel, MonthlyColor)
/////////////////////////////////////////////////////////////////////////////
// the monthly open can be the weekly open (monday 1st) and/or daily open too
// only the monthly will be draw, in these case we update its label
// if is_monthly_open
// if can_show_daily
// label.set_text(monthlyLabel, "DO / MO ")
// if is_weekly_open
// if can_show_weekly
// label.set_text(monthlyLabel, "WO / MO ")
// if can_show_daily and can_show_weekly
// label.set_text(monthlyLabel, "DO / WO / MO ")
// the start of the line is drew from the first week of the month
// if the first day of the weekly candle (monday) is the 2nd of the month
// we fix the start of the line position on the Prev weekly candle
if timeframe.isweekly and dayofweek(monthly_time) != dayofweek.monday
line.set_x1(monthlyLine, monthly_time - (weekly_time - weekly_time ))
Key Levels//@version=5
//@sbtnc thank you for doing the base code
//Added additional levels for convienience sake.
indicator('Key Levels SpacemanBTC IDWM', shorttitle='SpacemanBTC Key Level V13.1', overlay=true, max_lines_count=100)
//35 works
displayStyle = input.string(defval='Standard', title='Display Style', options= , inline='Display')
mergebool = input.bool(defval=true, title='Merge Levels?', inline='Display')
distanceright = input.int(defval=30, title='Distance', minval=5, maxval=500, inline='Dist')
radistance = input.int(defval=250, title='Anchor Distance', minval=5, maxval=500, inline='Dist')
labelsize = input.string(defval='Medium', title='Text Size', options= )
linesize = input.string(defval='Small', title='Line Width', options= , inline='Line')
linestyle = input.string(defval='Solid', title='Line Style', options= , inline='Line')
GlobalTextType = input.bool(defval=false, title='Global Text ShortHand', tooltip='Enable for shorthand text on all text')
var globalcoloring = input.bool(defval=false, title='Global Coloring', tooltip='Enable for all color controls via one color', inline='GC')
GlobalColor = input.color(title='', defval=color.white, inline='GC')
//var show_tails = input(defval = false, title = "Always Show", type = input.bool)
= request.security(syminfo.tickerid, 'D', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'D', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'D', [time , low ], lookahead=barmerge.lookahead_on)
cdailyh_open = request.security(syminfo.tickerid, 'D', high, lookahead=barmerge.lookahead_on)
cdailyl_open = request.security(syminfo.tickerid, 'D', low, lookahead=barmerge.lookahead_on)
var monday_time = time
var monday_high = high
var monday_low = low
= request.security(syminfo.tickerid, 'W', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'W', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'W', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, 'M', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '3M', [time , low ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '12M', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', , lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', [time , high ], lookahead=barmerge.lookahead_on)
= request.security(syminfo.tickerid, '240', [time , low ], lookahead=barmerge.lookahead_on)
//------------------------------ Inputs -------------------------------
var is_intra_enabled = input.bool(defval=false, title='Open', group='4H', inline='4H')
var is_intrarange_enabled = input.bool(defval=false, title='Prev H/L', group='4H', inline='4H')
var is_intram_enabled = input.bool(defval=false, title='Prev Mid', group='4H', inline='4H')
IntraTextType = input.bool(defval=false, title='ShortHand', group='4H', inline='4Hsh')
var is_daily_enabled = input.bool(defval=true, title='Open', group='Daily', inline='Daily')
var is_dailyrange_enabled = input.bool(defval=false, title='Prev H/L', group='Daily', inline='Daily')
var is_dailym_enabled = input.bool(defval=false, title='Prev Mid', group='Daily', inline='Daily')
DailyTextType = input.bool(defval=false, title='ShortHand', group='Daily', inline='Dailysh')
var is_monday_enabled = input.bool(defval=true, title='Range', group='Monday Range', inline='Monday')
var is_monday_mid = input.bool(defval=true, title='Mid', group='Monday Range', inline='Monday')
var untested_monday = false
MondayTextType = input.bool(defval=false, title='ShortHand', group='Monday Range', inline='Mondaysh')
var is_weekly_enabled = input.bool(defval=true, title='Open', group='Weekly', inline='Weekly')
var is_weeklyrange_enabled = input.bool(defval=true, title='Prev H/L', group='Weekly', inline='Weekly')
var is_weekly_mid = input.bool(defval=true, title='Prev Mid', group='Weekly', inline='Weekly')
WeeklyTextType = input.bool(defval=false, title='ShortHand', group='Weekly', inline='Weeklysh')
var is_monthly_enabled = input.bool(defval=true, title='Open', group='Monthly', inline='Monthly')
var is_monthlyrange_enabled = input.bool(defval=true, title='Prev H/L', group='Monthly', inline='Monthly')
var is_monthly_mid = input.bool(defval=true, title='Prev Mid', group='Monthly', inline='Monthly')
MonthlyTextType = input.bool(defval=false, title='ShortHand', group='Monthly', inline='Monthlysh')
var is_quarterly_enabled = input.bool(defval=true, title='Open', group='Quarterly', inline='Quarterly')
var is_quarterlyrange_enabled = input.bool(defval=false, title='Prev H/L', group='Quarterly', inline='Quarterly')
var is_quarterly_mid = input.bool(defval=true, title='Prev Mid', group='Quarterly', inline='Quarterly')
QuarterlyTextType = input.bool(defval=false, title='ShortHand', group='Quarterly', inline='Quarterlysh')
var is_yearly_enabled = input.bool(defval=true, title='Open', group='Yearly', inline='Yearly')
var is_yearlyrange_enabled = input.bool(defval=false, title='Current H/L', group='Yearly', inline='Yearly')
var is_yearly_mid = input.bool(defval=true, title='Mid', group='Yearly', inline='Yearly')
YearlyTextType = input.bool(defval=false, title='ShortHand', group='Yearly', inline='Yearlysh')
var is_londonrange_enabled = input.bool(defval=false, title='London Range', group='FX Sessions', inline='FX')
var is_usrange_enabled = input.bool(defval=false, title='New York Range', group='FX Sessions', inline='FX')
var is_asiarange_enabled = input.bool(defval=false, title='Asia Range', group='FX Sessions', inline='FX')
SessionTextType = input.bool(defval=false, title='ShortHand', group='FX Sessions', inline='FXColor')
Londont = input.session("0800-1600", "London Session")
USt = input.session("1400-2100", "New York Session")
Asiat = input.session("0000-0900", "Tokyo Session")
DailyColor = input.color(title='', defval=#08bcd4, group='Daily', inline='Dailysh')
MondayColor = input.color(title='', defval=color.white, group='Monday Range', inline='Mondaysh')
WeeklyColor = input.color(title='', defval=#fffcbc, group='Weekly', inline='Weeklysh')
MonthlyColor = input.color(title='', defval=#08d48c, group='Monthly', inline='Monthlysh')
YearlyColor = input.color(title='', defval=color.red, group='Yearly', inline='Yearlysh')
quarterlyColor = input.color(title='', defval=color.red, group='Quarterly', inline='Quarterlysh')
IntraColor = input.color(title='', defval=color.orange, group='4H', inline='4Hsh')
LondonColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
USColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
AsiaColor = input.color(title='', defval=color.white, group='FX Sessions', inline='FXColor')
var pdhtext = GlobalTextType or DailyTextType ? 'PDH' : 'Prev Day High'
var pdltext = GlobalTextType or DailyTextType ? 'PDL' : 'Prev Day Low'
var dotext = GlobalTextType or DailyTextType ? 'DO' : 'Daily Open'
var pdmtext = GlobalTextType or DailyTextType ? 'PDM' : 'Prev Day Mid'
var pwhtext = GlobalTextType or WeeklyTextType ? 'PWH' : 'Prev Week High'
var pwltext = GlobalTextType or WeeklyTextType ? 'PWL' : 'Prev Week Low'
var wotext = GlobalTextType or WeeklyTextType ? 'WO' : 'Weekly Open'
var pwmtext = GlobalTextType or WeeklyTextType ? 'PWM' : 'Prev Week Mid'
var pmhtext = GlobalTextType or MonthlyTextType ? 'PMH' : 'Prev Month High'
var pmltext = GlobalTextType or MonthlyTextType ? 'PML' : 'Prev Month Low'
var motext = GlobalTextType or MonthlyTextType ? 'MO' : 'Monthly Open'
var pmmtext = GlobalTextType or MonthlyTextType ? 'PMM' : 'Prev Month Mid'
var pqhtext = GlobalTextType or QuarterlyTextType ? 'PQH' : 'Prev Quarter High'
var pqltext = GlobalTextType or QuarterlyTextType ? 'PQL' : 'Prev Quarter Low'
var qotext = GlobalTextType or QuarterlyTextType ? 'QO' : 'Quarterly Open'
var pqmtext = GlobalTextType or QuarterlyTextType ? 'PQM' : 'Prev Quarter Mid'
var cyhtext = GlobalTextType or YearlyTextType ? 'CYH' : 'Current Year High'
var cyltext = GlobalTextType or YearlyTextType ? 'CYL' : 'Current Year Low'
var yotext = GlobalTextType or YearlyTextType ? 'YO' : 'Yearly Open'
var cymtext = GlobalTextType or YearlyTextType ? 'CYM' : 'Current Year Mid'
var pihtext = GlobalTextType or IntraTextType ? 'P-4H-H' : 'Prev 4H High'
var piltext = GlobalTextType or IntraTextType ? 'P-4H-L' : 'Prev 4H Low'
var iotext = GlobalTextType or IntraTextType ? '4H-O' : '4H Open'
var pimtext = GlobalTextType or IntraTextType ? 'P-4H-M' : 'Prev 4H Mid'
var pmonhtext = GlobalTextType or MondayTextType ? 'MDAY-H' : 'Monday High'
var pmonltext = GlobalTextType or MondayTextType ? 'MDAY-L' : 'Monday Low'
var pmonmtext = GlobalTextType or MondayTextType ? 'MDAY-M' : 'Monday Mid'
var lhtext = GlobalTextType or SessionTextType ? 'Lon-H' : 'London High'
var lltext = GlobalTextType or SessionTextType ? 'Lon-L' : 'London Low'
var lotext = GlobalTextType or SessionTextType ? 'Lon-O' : 'London Open'
var ushtext = GlobalTextType or SessionTextType ? 'NY-H' : 'New York High'
var usltext = GlobalTextType or SessionTextType ? 'NY-L' : 'New York Low'
var usotext = GlobalTextType or SessionTextType ? 'NY-O' : 'New York Open'
var asiahtext = GlobalTextType or SessionTextType ? 'AS-H' : 'Asia High'
var asialtext = GlobalTextType or SessionTextType ? 'AS-L' : 'Asia Low'
var asiaotext = GlobalTextType or SessionTextType ? 'AS-O' : 'Asia Open'
if globalcoloring == true
DailyColor := GlobalColor
MondayColor := GlobalColor
WeeklyColor := GlobalColor
MonthlyColor := GlobalColor
YearlyColor := GlobalColor
quarterlyColor := GlobalColor
IntraColor := GlobalColor
IntraColor
if weekly_time != weekly_time
untested_monday := false
untested_monday
if is_monday_enabled == true and untested_monday == false
untested_monday := true
monday_time := daily_time
monday_high := cdailyh_open
monday_low := cdailyl_open
monday_low
linewidthint = 1
if linesize == 'Small'
linewidthint := 1
linewidthint
if linesize == 'Medium'
linewidthint := 2
linewidthint
if linesize == 'Large'
linewidthint := 3
linewidthint
var DEFAULT_LINE_WIDTH = linewidthint
var DEFAULT_TAIL_WIDTH = linewidthint
fontsize = size.small
if labelsize == 'Small'
fontsize := size.small
fontsize
if labelsize == 'Medium'
fontsize := size.normal
fontsize
if labelsize == 'Large'
fontsize := size.large
fontsize
linestyles = line.style_solid
if linestyle == 'Dashed'
linestyles := line.style_dashed
linestyles
if linestyle == 'Dotted'
linestyles := line.style_dotted
linestyles
var DEFAULT_LABEL_SIZE = fontsize
var DEFAULT_LABEL_STYLE = label.style_none
var DEFAULT_EXTEND_RIGHT = distanceright
London = time(timeframe.period, Londont)
US = time(timeframe.period, USt)
Asia = time(timeframe.period, Asiat)
var clondonhigh = 0.0
var clondonlow = close
var londontime = time
var flondonhigh = 0.0
var flondonlow = 0.0
var flondonopen = 0.0
var onelondonfalse = false
if London
if high > clondonhigh
clondonhigh := high
clondonhigh
if low < clondonlow
clondonlow := low
clondonlow
if onelondonfalse
londontime := time
flondonopen := open
flondonopen
flondonhigh := clondonhigh
flondonlow := clondonlow
onelondonfalse := false
onelondonfalse
else
if onelondonfalse == false
flondonhigh := clondonhigh
flondonlow := clondonlow
flondonlow
onelondonfalse := true
clondonhigh := 0.0
clondonlow := close
clondonlow
//////////////////////////////////
var cushigh = 0.0
var cuslow = close
var ustime = time
var fushigh = 0.0
var fuslow = 0.0
var fusopen = 0.0
var oneusfalse = false
if US
if high > cushigh
cushigh := high
cushigh
if low < cuslow
cuslow := low
cuslow
if oneusfalse
ustime := time
fusopen := open
fusopen
fushigh := cushigh
fuslow := cuslow
oneusfalse := false
oneusfalse
else
if oneusfalse == false
fushigh := cushigh
fuslow := cuslow
fuslow
oneusfalse := true
cushigh := 0.0
cuslow := close
cuslow
//////////////////////////////////
var casiahigh = 0.0
var casialow = close
var asiatime = time
var fasiahigh = 0.0
var fasialow = 0.0
var fasiaopen = 0.0
var oneasiafalse = false
if Asia
if high > casiahigh
casiahigh := high
casiahigh
if low < casialow
casialow := low
casialow
if oneasiafalse
asiatime := time
fasiaopen := open
fasiaopen
fasiahigh := casiahigh
fasialow := casialow
oneasiafalse := false
oneasiafalse
else
if oneasiafalse == false
fasiahigh := casiahigh
fasialow := casialow
fasialow
oneasiafalse := true
casiahigh := 0.0
casialow := close
casialow
//------------------------------ Plotting ------------------------------
var pricearray = array.new_float(0)
var labelarray = array.new_label(0)
f_LevelMerge(pricearray, labelarray, currentprice, currentlabel, currentcolor) =>
if array.includes(pricearray, currentprice)
whichindex = array.indexof(pricearray, currentprice)
labelhold = array.get(labelarray, whichindex)
whichtext = label.get_text(labelhold)
label.set_text(labelhold, label.get_text(currentlabel) + ' / ' + whichtext)
label.set_text(currentlabel, '')
label.set_textcolor(labelhold, currentcolor)
else
array.push(pricearray, currentprice)
array.push(labelarray, currentlabel)
var can_show_daily = is_daily_enabled and timeframe.isintraday
var can_show_weekly = is_weekly_enabled and not timeframe.isweekly and not timeframe.ismonthly
var can_show_monthly = is_monthly_enabled and not timeframe.ismonthly
get_limit_right(bars) =>
timenow + (time - time ) * bars
// the following code doesn't need to be processed on every candle
if barstate.islast
is_weekly_open = dayofweek == dayofweek.monday
is_monthly_open = dayofmonth == 1
can_draw_daily = (is_weekly_enabled ? not is_weekly_open : true) and (is_monthly_enabled ? not is_monthly_open : true)
can_draw_weekly = is_monthly_enabled ? not(is_monthly_open and is_weekly_open) : true
can_draw_intra = is_intra_enabled
can_draw_intrah = is_intrarange_enabled
can_draw_intral = is_intrarange_enabled
can_draw_intram = is_intram_enabled
pricearray := array.new_float(0)
labelarray := array.new_label(0)
/////////////////////////////////
if is_londonrange_enabled
//label.new(bar_index,high)
london_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
londontime := get_limit_right(radistance)
londontime
var londonh_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonhigh, y2=flondonhigh, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londonl_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonlow, y2=flondonlow, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londono_line = line.new(x1=londontime, x2=london_limit_right, y1=flondonopen, y2=flondonopen, color=LondonColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var londonh_label = label.new(x=london_limit_right, y=flondonhigh, text=lhtext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var londonl_label = label.new(x=london_limit_right, y=flondonlow, text=lltext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var londono_label = label.new(x=london_limit_right, y=flondonopen, text=lotext, style=DEFAULT_LABEL_STYLE, textcolor=LondonColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(londonh_line, londontime)
line.set_x2(londonh_line, london_limit_right)
line.set_y1(londonh_line, flondonhigh)
line.set_y2(londonh_line, flondonhigh)
line.set_x1(londonl_line, londontime)
line.set_x2(londonl_line, london_limit_right)
line.set_y1(londonl_line, flondonlow)
line.set_y2(londonl_line, flondonlow)
line.set_x1(londono_line, londontime)
line.set_x2(londono_line, london_limit_right)
line.set_y1(londono_line, flondonopen)
line.set_y2(londono_line, flondonopen)
label.set_x(londonh_label, london_limit_right)
label.set_y(londonh_label, flondonhigh)
label.set_text(londonh_label, lhtext)
label.set_x(londonl_label, london_limit_right)
label.set_y(londonl_label, flondonlow)
label.set_text(londonl_label, lltext)
label.set_x(londono_label, london_limit_right)
label.set_y(londono_label, flondonopen)
label.set_text(londono_label, lotext)
if mergebool
f_LevelMerge(pricearray, labelarray, flondonhigh, londonh_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonlow, londonl_label, LondonColor)
f_LevelMerge(pricearray, labelarray, flondonopen, londono_label, LondonColor)
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////
if is_usrange_enabled
//label.new(bar_index,high)
us_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
ustime := get_limit_right(radistance)
ustime
var ush_line = line.new(x1=ustime, x2=us_limit_right, y1=fushigh, y2=fushigh, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var usl_line = line.new(x1=ustime, x2=us_limit_right, y1=fuslow, y2=fuslow, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var uso_line = line.new(x1=ustime, x2=us_limit_right, y1=fusopen, y2=fusopen, color=USColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var ush_label = label.new(x=us_limit_right, y=fushigh, text=lhtext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var usl_label = label.new(x=us_limit_right, y=fuslow, text=lltext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var uso_label = label.new(x=us_limit_right, y=fusopen, text=lotext, style=DEFAULT_LABEL_STYLE, textcolor=USColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(ush_line, ustime)
line.set_x2(ush_line, us_limit_right)
line.set_y1(ush_line, fushigh)
line.set_y2(ush_line, fushigh)
line.set_x1(usl_line, ustime)
line.set_x2(usl_line, us_limit_right)
line.set_y1(usl_line, fuslow)
line.set_y2(usl_line, fuslow)
line.set_x1(uso_line, ustime)
line.set_x2(uso_line, us_limit_right)
line.set_y1(uso_line, fusopen)
line.set_y2(uso_line, fusopen)
label.set_x(ush_label, us_limit_right)
label.set_y(ush_label, fushigh)
label.set_text(ush_label, ushtext)
label.set_x(usl_label, us_limit_right)
label.set_y(usl_label, fuslow)
label.set_text(usl_label, usltext)
label.set_x(uso_label, us_limit_right)
label.set_y(uso_label, fusopen)
label.set_text(uso_label, usotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fushigh, ush_label, USColor)
f_LevelMerge(pricearray, labelarray, fuslow, usl_label, USColor)
f_LevelMerge(pricearray, labelarray, fusopen, uso_label, USColor)
/////////////////////////////////
if is_asiarange_enabled
//label.new(bar_index,high)
asia_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
asiatime := get_limit_right(radistance)
asiatime
var asiah_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasiahigh, y2=fasiahigh, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asial_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasialow, y2=fasialow, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asiao_line = line.new(x1=asiatime, x2=asia_limit_right, y1=fasiaopen, y2=fasiaopen, color=AsiaColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var asiah_label = label.new(x=asia_limit_right, y=fasiahigh, text=asiahtext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var asial_label = label.new(x=asia_limit_right, y=fasialow, text=asialtext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
var asiao_label = label.new(x=asia_limit_right, y=fasiaopen, text=asiaotext, style=DEFAULT_LABEL_STYLE, textcolor=AsiaColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(asiah_line, asiatime)
line.set_x2(asiah_line, asia_limit_right)
line.set_y1(asiah_line, fasiahigh)
line.set_y2(asiah_line, fasiahigh)
line.set_x1(asial_line, asiatime)
line.set_x2(asial_line, asia_limit_right)
line.set_y1(asial_line, fasialow)
line.set_y2(asial_line, fasialow)
line.set_x1(asiao_line, asiatime)
line.set_x2(asiao_line, asia_limit_right)
line.set_y1(asiao_line, fasiaopen)
line.set_y2(asiao_line, fasiaopen)
label.set_x(asiah_label, asia_limit_right)
label.set_y(asiah_label, fasiahigh)
label.set_text(asiah_label, asiahtext)
label.set_x(asial_label, asia_limit_right)
label.set_y(asial_label, fasialow)
label.set_text(asial_label, asialtext)
label.set_x(asiao_label, asia_limit_right)
label.set_y(asiao_label, fasiaopen)
label.set_text(asiao_label, asiaotext)
if mergebool
f_LevelMerge(pricearray, labelarray, fasiahigh, asiah_label, AsiaColor)
f_LevelMerge(pricearray, labelarray, fasialow, asial_label, AsiaColor)
f_LevelMerge(pricearray, labelarray, fasiaopen, asiao_label, AsiaColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
if can_draw_intra
intra_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intra_time := get_limit_right(radistance)
intra_time
var intra_line = line.new(x1=intra_time, x2=intra_limit_right, y1=intra_open, y2=intra_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intra_label = label.new(x=intra_limit_right, y=intra_open, text=iotext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intra_line, intra_time)
line.set_x2(intra_line, intra_limit_right)
line.set_y1(intra_line, intra_open)
line.set_y2(intra_line, intra_open)
label.set_x(intra_label, intra_limit_right)
label.set_y(intra_label, intra_open)
label.set_text(intra_label, iotext)
if mergebool
f_LevelMerge(pricearray, labelarray, intra_open, intra_label, IntraColor)
//////////////////////////////////////////////////////////////////////////////////
//HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH HIGH
if can_draw_intrah
intrah_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intrah_time := get_limit_right(radistance)
intrah_time
var intrah_line = line.new(x1=intrah_time, x2=intrah_limit_right, y1=intrah_open, y2=intrah_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intrah_label = label.new(x=intrah_limit_right, y=intrah_open, text=pihtext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intrah_line, intrah_time)
line.set_x2(intrah_line, intrah_limit_right)
line.set_y1(intrah_line, intrah_open)
line.set_y2(intrah_line, intrah_open)
label.set_x(intrah_label, intrah_limit_right)
label.set_y(intrah_label, intrah_open)
label.set_text(intrah_label, pihtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intrah_open, intrah_label, IntraColor)
//////////////////////////////////////////////////////////////////////////////////
//LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW LOW
if can_draw_intral
intral_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
intral_time := get_limit_right(radistance)
intral_time
var intral_line = line.new(x1=intral_time, x2=intral_limit_right, y1=intral_open, y2=intral_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intral_label = label.new(x=intral_limit_right, y=intral_open, text=piltext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intral_line, intral_time)
line.set_x2(intral_line, intral_limit_right)
line.set_y1(intral_line, intral_open)
line.set_y2(intral_line, intral_open)
label.set_x(intral_label, intral_limit_right)
label.set_y(intral_label, intral_open)
label.set_text(intral_label, piltext)
if mergebool
f_LevelMerge(pricearray, labelarray, intral_open, intral_label, IntraColor)
///////////////////////////////////////////////////////////////////////////////
if can_draw_intram
intram_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
intram_time = intrah_time
intram_open = (intral_open + intrah_open) / 2
if displayStyle == 'Right Anchored'
intram_time := get_limit_right(radistance)
intram_time
var intram_line = line.new(x1=intram_time, x2=intram_limit_right, y1=intram_open, y2=intram_open, color=IntraColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var intram_label = label.new(x=intram_limit_right, y=intram_open, text=pimtext, style=DEFAULT_LABEL_STYLE, textcolor=IntraColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(intram_line, intram_time)
line.set_x2(intram_line, intram_limit_right)
line.set_y1(intram_line, intram_open)
line.set_y2(intram_line, intram_open)
label.set_x(intram_label, intram_limit_right)
label.set_y(intram_label, intram_open)
label.set_text(intram_label, pimtext)
if mergebool
f_LevelMerge(pricearray, labelarray, intram_open, intram_label, IntraColor)
////////////////////////////////////////// MONDAY
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var monday_line = line.new(x1=monday_time, x2=monday_limit_right, y1=monday_high, y2=monday_high, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monday_label = label.new(x=monday_limit_right, y=monday_high, text=pmonhtext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monday_line, monday_time)
line.set_x2(monday_line, monday_limit_right)
line.set_y1(monday_line, monday_high)
line.set_y2(monday_line, monday_high)
label.set_x(monday_label, monday_limit_right)
label.set_y(monday_label, monday_high)
label.set_text(monday_label, pmonhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_high, monday_label, MondayColor)
if is_monday_enabled
monday_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var monday_low_line = line.new(x1=monday_time, x2=monday_limit_right, y1=monday_low, y2=monday_low, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monday_low_label = label.new(x=monday_limit_right, y=monday_low, text=pmonltext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monday_low_line, monday_time)
line.set_x2(monday_low_line, monday_limit_right)
line.set_y1(monday_low_line, monday_low)
line.set_y2(monday_low_line, monday_low)
label.set_x(monday_low_label, monday_limit_right)
label.set_y(monday_low_label, monday_low)
label.set_text(monday_low_label, pmonltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monday_low, monday_low_label, MondayColor)
if is_monday_mid
mondaym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
mondaym_open = (monday_high + monday_low) / 2
if displayStyle == 'Right Anchored'
monday_time := get_limit_right(radistance)
monday_time
var mondaym_line = line.new(x1=monday_time, x2=mondaym_limit_right, y1=mondaym_open, y2=mondaym_open, color=MondayColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var mondaym_label = label.new(x=mondaym_limit_right, y=mondaym_open, text=pmonmtext, style=DEFAULT_LABEL_STYLE, textcolor=MondayColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(mondaym_line, monday_time)
line.set_x2(mondaym_line, mondaym_limit_right)
line.set_y1(mondaym_line, mondaym_open)
line.set_y2(mondaym_line, mondaym_open)
label.set_x(mondaym_label, mondaym_limit_right)
label.set_y(mondaym_label, mondaym_open)
label.set_text(mondaym_label, pmonmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, mondaym_open, mondaym_label, MondayColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN DAILY OPEN
if is_daily_enabled
daily_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
daily_time := get_limit_right(radistance)
daily_time
var daily_line = line.new(x1=daily_time, x2=daily_limit_right, y1=daily_open, y2=daily_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var daily_label = label.new(x=daily_limit_right, y=daily_open, text=dotext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(daily_line, daily_time)
line.set_x2(daily_line, daily_limit_right)
line.set_y1(daily_line, daily_open)
line.set_y2(daily_line, daily_open)
label.set_x(daily_label, daily_limit_right)
label.set_y(daily_label, daily_open)
label.set_text(daily_label, dotext)
if mergebool
f_LevelMerge(pricearray, labelarray, daily_open, daily_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH DAILY HIGH
if is_dailyrange_enabled
dailyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyh_time := get_limit_right(radistance)
dailyh_time
// draw tails before lines for better visual
var dailyh_line = line.new(x1=dailyh_time, x2=dailyh_limit_right, y1=dailyh_open, y2=dailyh_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailyh_label = label.new(x=dailyh_limit_right, y=dailyh_open, text=pdhtext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailyh_line, dailyh_time)
line.set_x2(dailyh_line, dailyh_limit_right)
line.set_y1(dailyh_line, dailyh_open)
line.set_y2(dailyh_line, dailyh_open)
label.set_x(dailyh_label, dailyh_limit_right)
label.set_y(dailyh_label, dailyh_open)
label.set_text(dailyh_label, pdhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyh_open, dailyh_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW DAILY LOW
if is_dailyrange_enabled
dailyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
dailyl_time := get_limit_right(radistance)
dailyl_time
var dailyl_line = line.new(x1=dailyl_time, x2=dailyl_limit_right, y1=dailyl_open, y2=dailyl_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailyl_label = label.new(x=dailyl_limit_right, y=dailyl_open, text=pdltext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailyl_line, dailyl_time)
line.set_x2(dailyl_line, dailyl_limit_right)
line.set_y1(dailyl_line, dailyl_open)
line.set_y2(dailyl_line, dailyl_open)
label.set_x(dailyl_label, dailyl_limit_right)
label.set_y(dailyl_label, dailyl_open)
label.set_text(dailyl_label, pdltext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailyl_open, dailyl_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////// Daily MID
if is_dailym_enabled
dailym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
dailym_time = dailyh_time
dailym_open = (dailyl_open + dailyh_open) / 2
if displayStyle == 'Right Anchored'
dailym_time := get_limit_right(radistance)
dailym_time
var dailym_line = line.new(x1=dailym_time, x2=dailym_limit_right, y1=dailym_open, y2=dailym_open, color=DailyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var dailym_label = label.new(x=dailym_limit_right, y=dailym_open, text=pdmtext, style=DEFAULT_LABEL_STYLE, textcolor=DailyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(dailym_line, dailym_time)
line.set_x2(dailym_line, dailym_limit_right)
line.set_y1(dailym_line, dailym_open)
line.set_y2(dailym_line, dailym_open)
label.set_x(dailym_label, dailym_limit_right)
label.set_y(dailym_label, dailym_open)
label.set_text(dailym_label, pdmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, dailym_open, dailym_label, DailyColor)
//////////////////////////////////////////////////////////////////////////////////
if is_weekly_enabled
weekly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
cweekly_time = weekly_time
if displayStyle == 'Right Anchored'
cweekly_time := get_limit_right(radistance)
cweekly_time
var weekly_line = line.new(x1=cweekly_time, x2=weekly_limit_right, y1=weekly_open, y2=weekly_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weekly_label = label.new(x=weekly_limit_right, y=weekly_open, text=wotext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weekly_line, cweekly_time)
line.set_x2(weekly_line, weekly_limit_right)
line.set_y1(weekly_line, weekly_open)
line.set_y2(weekly_line, weekly_open)
label.set_x(weekly_label, weekly_limit_right)
label.set_y(weekly_label, weekly_open)
label.set_text(weekly_label, wotext)
if mergebool
f_LevelMerge(pricearray, labelarray, weekly_open, weekly_label, WeeklyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
// if is_weekly_open and can_show_daily
// label.set_text(weekly_label, "DO / WO ")
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// WEEKLY HIGH WEEKLY HIGH WEEKLY HIGH
if is_weeklyrange_enabled
weeklyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyh_time := get_limit_right(radistance)
weeklyh_time
var weeklyh_line = line.new(x1=weeklyh_time, x2=weeklyh_limit_right, y1=weeklyh_open, y2=weeklyh_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklyh_label = label.new(x=weeklyh_limit_right, y=weeklyh_open, text=pwhtext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklyh_line, weeklyh_time)
line.set_x2(weeklyh_line, weeklyh_limit_right)
line.set_y1(weeklyh_line, weeklyh_open)
line.set_y2(weeklyh_line, weeklyh_open)
label.set_x(weeklyh_label, weeklyh_limit_right)
label.set_y(weeklyh_label, weeklyh_open)
label.set_text(weeklyh_label, pwhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyh_open, weeklyh_label, WeeklyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// WEEKLY LOW WEEKLY LOW WEEKLY LOW
if is_weeklyrange_enabled
weeklyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
weeklyl_time := get_limit_right(radistance)
weeklyl_time
var weeklyl_line = line.new(x1=weeklyl_time, x2=weeklyl_limit_right, y1=weekly_open, y2=weekly_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklyl_label = label.new(x=weeklyl_limit_right, y=weeklyl_open, text=pwltext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklyl_line, weeklyl_time)
line.set_x2(weeklyl_line, weeklyl_limit_right)
line.set_y1(weeklyl_line, weeklyl_open)
line.set_y2(weeklyl_line, weeklyl_open)
label.set_x(weeklyl_label, weeklyl_limit_right)
label.set_y(weeklyl_label, weeklyl_open)
label.set_text(weeklyl_label, pwltext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklyl_open, weeklyl_label, WeeklyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// Weekly MID
if is_weekly_mid
weeklym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
weeklym_time = weeklyh_time
weeklym_open = (weeklyl_open + weeklyh_open) / 2
if displayStyle == 'Right Anchored'
weeklym_time := get_limit_right(radistance)
weeklym_time
var weeklym_line = line.new(x1=weeklym_time, x2=weeklym_limit_right, y1=weeklym_open, y2=weeklym_open, color=WeeklyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var weeklym_label = label.new(x=weeklym_limit_right, y=weeklym_open, text=pwmtext, style=DEFAULT_LABEL_STYLE, textcolor=WeeklyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(weeklym_line, weeklym_time)
line.set_x2(weeklym_line, weeklym_limit_right)
line.set_y1(weeklym_line, weeklym_open)
line.set_y2(weeklym_line, weeklym_open)
label.set_x(weeklym_label, weeklym_limit_right)
label.set_y(weeklym_label, weeklym_open)
label.set_text(weeklym_label, pwmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, weeklym_open, weeklym_label, WeeklyColor)
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY LOW LOW LOW
if is_yearlyrange_enabled
yearlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyl_time := get_limit_right(radistance)
yearlyl_time
var yearlyl_line = line.new(x1=yearlyl_time, x2=yearlyl_limit_right, y1=yearlyl_open, y2=yearlyl_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlyl_label = label.new(x=yearlyl_limit_right, y=yearlyl_open, text=cyltext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlyl_line, yearlyl_time)
line.set_x2(yearlyl_line, yearlyl_limit_right)
line.set_y1(yearlyl_line, yearlyl_open)
line.set_y2(yearlyl_line, yearlyl_open)
label.set_x(yearlyl_label, yearlyl_limit_right)
label.set_y(yearlyl_label, yearlyl_open)
label.set_text(yearlyl_label, cyltext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyl_open, yearlyl_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY HIGH HIGH HIGH
if is_yearlyrange_enabled
yearlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearlyh_time := get_limit_right(radistance)
yearlyh_time
var yearlyh_line = line.new(x1=yearlyh_time, x2=yearlyh_limit_right, y1=yearlyh_open, y2=yearlyh_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlyh_label = label.new(x=yearlyh_limit_right, y=yearlyh_open, text=cyhtext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlyh_line, yearlyh_time)
line.set_x2(yearlyh_line, yearlyh_limit_right)
line.set_y1(yearlyh_line, yearlyh_open)
line.set_y2(yearlyh_line, yearlyh_open)
label.set_x(yearlyh_label, yearlyh_limit_right)
label.set_y(yearlyh_label, yearlyh_open)
label.set_text(yearlyh_label, cyhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlyh_open, yearlyh_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// YEEEAARRLLYY OPEN
if is_yearly_enabled
yearly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
yearly_time := get_limit_right(radistance)
yearly_time
var yearly_line = line.new(x1=yearly_time, x2=yearly_limit_right, y1=yearly_open, y2=yearly_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearly_label = label.new(x=yearly_limit_right, y=yearly_open, text=yotext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearly_line, yearly_time)
line.set_x2(yearly_line, yearly_limit_right)
line.set_y1(yearly_line, yearly_open)
line.set_y2(yearly_line, yearly_open)
label.set_x(yearly_label, yearly_limit_right)
label.set_y(yearly_label, yearly_open)
label.set_text(yearly_label, yotext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearly_open, yearly_label, YearlyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// yearly MID
if is_yearly_mid
yearlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
yearlym_time = yearlyh_time
yearlym_open = (yearlyl_open + yearlyh_open) / 2
if displayStyle == 'Right Anchored'
yearlym_time := get_limit_right(radistance)
yearlym_time
var yearlym_line = line.new(x1=yearlym_time, x2=yearlym_limit_right, y1=yearlym_open, y2=yearlym_open, color=YearlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var yearlym_label = label.new(x=yearlym_limit_right, y=yearlym_open, text=cymtext, style=DEFAULT_LABEL_STYLE, textcolor=YearlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(yearlym_line, yearlym_time)
line.set_x2(yearlym_line, yearlym_limit_right)
line.set_y1(yearlym_line, yearlym_open)
line.set_y2(yearlym_line, yearlym_open)
label.set_x(yearlym_label, yearlym_limit_right)
label.set_y(yearlym_label, yearlym_open)
label.set_text(yearlym_label, cymtext)
if mergebool
f_LevelMerge(pricearray, labelarray, yearlym_open, yearlym_label, YearlyColor)
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY OPEN
if is_quarterly_enabled
quarterly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterly_time := get_limit_right(radistance)
quarterly_time
var quarterly_line = line.new(x1=quarterly_time, x2=quarterly_limit_right, y1=quarterly_open, y2=quarterly_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterly_label = label.new(x=quarterly_limit_right, y=quarterly_open, text=qotext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterly_line, quarterly_time)
line.set_x2(quarterly_line, quarterly_limit_right)
line.set_y1(quarterly_line, quarterly_open)
line.set_y2(quarterly_line, quarterly_open)
label.set_x(quarterly_label, quarterly_limit_right)
label.set_y(quarterly_label, quarterly_open)
label.set_text(quarterly_label, qotext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterly_open, quarterly_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY High
if is_quarterlyrange_enabled
quarterlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyh_time := get_limit_right(radistance)
quarterlyh_time
var quarterlyh_line = line.new(x1=quarterlyh_time, x2=quarterlyh_limit_right, y1=quarterlyh_open, y2=quarterlyh_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlyh_label = label.new(x=quarterlyh_limit_right, y=quarterlyh_open, text=pqhtext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlyh_line, quarterlyh_time)
line.set_x2(quarterlyh_line, quarterlyh_limit_right)
line.set_y1(quarterlyh_line, quarterlyh_open)
line.set_y2(quarterlyh_line, quarterlyh_open)
label.set_x(quarterlyh_label, quarterlyh_limit_right)
label.set_y(quarterlyh_label, quarterlyh_open)
label.set_text(quarterlyh_label, pqhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyh_open, quarterlyh_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY Low
if is_quarterlyrange_enabled
quarterlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
quarterlyl_time := get_limit_right(radistance)
quarterlyl_time
var quarterlyl_line = line.new(x1=quarterlyl_time, x2=quarterlyl_limit_right, y1=quarterlyl_open, y2=quarterlyl_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlyl_label = label.new(x=quarterlyl_limit_right, y=quarterlyl_open, text=pqltext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlyl_line, quarterlyl_time)
line.set_x2(quarterlyl_line, quarterlyl_limit_right)
line.set_y1(quarterlyl_line, quarterlyl_open)
line.set_y2(quarterlyl_line, quarterlyl_open)
label.set_x(quarterlyl_label, quarterlyl_limit_right)
label.set_y(quarterlyl_label, quarterlyl_open)
label.set_text(quarterlyl_label, pqltext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlyl_open, quarterlyl_label, quarterlyColor)
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////// QUATERLLYYYYY MID
if is_quarterly_mid
quarterlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
quarterlym_time = quarterlyh_time
quarterlym_open = (quarterlyl_open + quarterlyh_open) / 2
if displayStyle == 'Right Anchored'
quarterlym_time := get_limit_right(radistance)
quarterlym_time
var quarterlym_line = line.new(x1=quarterlym_time, x2=quarterlym_limit_right, y1=quarterlym_open, y2=quarterlym_open, color=quarterlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var quarterlym_label = label.new(x=quarterlym_limit_right, y=quarterlym_open, text=pqmtext, style=DEFAULT_LABEL_STYLE, textcolor=quarterlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(quarterlym_line, quarterlym_time)
line.set_x2(quarterlym_line, quarterlym_limit_right)
line.set_y1(quarterlym_line, quarterlym_open)
line.set_y2(quarterlym_line, quarterlym_open)
label.set_x(quarterlym_label, quarterlym_limit_right)
label.set_y(quarterlym_label, quarterlym_open)
label.set_text(quarterlym_label, pqmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, quarterlym_open, quarterlym_label, quarterlyColor)
////////////////////////////////////////////////////////////////////////////////// Monthly LOW LOW LOW
if is_monthlyrange_enabled
monthlyl_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyl_time := get_limit_right(radistance)
monthlyl_time
var monthlyl_line = line.new(x1=monthlyl_time, x2=monthlyl_limit_right, y1=monthlyl_open, y2=monthlyl_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyl_label = label.new(x=monthlyl_limit_right, y=monthlyl_open, text=pmltext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyl_line, monthlyl_time)
line.set_x2(monthlyl_line, monthlyl_limit_right)
line.set_y1(monthlyl_line, monthlyl_open)
line.set_y2(monthlyl_line, monthlyl_open)
label.set_x(monthlyl_label, monthlyl_limit_right)
label.set_y(monthlyl_label, monthlyl_open)
label.set_text(monthlyl_label, pmltext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyl_open, monthlyl_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
//////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////// MONTHLY HIGH HIGH HIGH
if is_monthlyrange_enabled
monthlyh_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthlyh_time := get_limit_right(radistance)
monthlyh_time
var monthlyh_line = line.new(x1=monthlyh_time, x2=monthlyh_limit_right, y1=monthlyh_open, y2=monthlyh_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyh_label = label.new(x=monthlyh_limit_right, y=monthlyh_open, text=pmhtext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyh_line, monthlyl_time)
line.set_x2(monthlyh_line, monthlyh_limit_right)
line.set_y1(monthlyh_line, monthlyh_open)
line.set_y2(monthlyh_line, monthlyh_open)
label.set_x(monthlyh_label, monthlyh_limit_right)
label.set_y(monthlyh_label, monthlyh_open)
label.set_text(monthlyh_label, pmhtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlyh_open, monthlyh_label, MonthlyColor)
// the weekly open can be the daily open too (monday)
// only the weekly will be draw, in these case we update its label
//////////////////////////////////////////////////////////////////////////////// MONTHLY MID
if is_monthly_mid
monthlym_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
monthlym_time = monthlyh_time
monthlym_open = (monthlyl_open + monthlyh_open) / 2
if displayStyle == 'Right Anchored'
monthlym_time := get_limit_right(radistance)
monthlym_time
var monthlym_line = line.new(x1=monthlym_time, x2=monthlym_limit_right, y1=monthlym_open, y2=monthlym_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlym_label = label.new(x=monthlym_limit_right, y=monthlym_open, text=pmmtext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlym_line, monthlym_time)
line.set_x2(monthlym_line, monthlym_limit_right)
line.set_y1(monthlym_line, monthlym_open)
line.set_y2(monthlym_line, monthlym_open)
label.set_x(monthlym_label, monthlym_limit_right)
label.set_y(monthlym_label, monthlym_open)
label.set_text(monthlym_label, pmmtext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthlym_open, monthlym_label, MonthlyColor)
//////////////////////////////////////////////////////////////////////////////////
if is_monthly_enabled
monthly_limit_right = get_limit_right(DEFAULT_EXTEND_RIGHT)
if displayStyle == 'Right Anchored'
monthly_time := get_limit_right(radistance)
monthly_time
var monthlyLine = line.new(x1=monthly_time, x2=monthly_limit_right, y1=monthly_open, y2=monthly_open, color=MonthlyColor, width=DEFAULT_LINE_WIDTH, xloc=xloc.bar_time, style=linestyles)
var monthlyLabel = label.new(x=monthly_limit_right, y=monthly_open, text=motext, style=DEFAULT_LABEL_STYLE, textcolor=MonthlyColor, size=DEFAULT_LABEL_SIZE, xloc=xloc.bar_time)
line.set_x1(monthlyLine, monthly_time)
line.set_x2(monthlyLine, monthly_limit_right)
line.set_y1(monthlyLine, monthly_open)
line.set_y2(monthlyLine, monthly_open)
label.set_x(monthlyLabel, monthly_limit_right)
label.set_y(monthlyLabel, monthly_open)
label.set_text(monthlyLabel, motext)
if mergebool
f_LevelMerge(pricearray, labelarray, monthly_open, monthlyLabel, MonthlyColor)
/////////////////////////////////////////////////////////////////////////////
// the monthly open can be the weekly open (monday 1st) and/or daily open too
// only the monthly will be draw, in these case we update its label
// if is_monthly_open
// if can_show_daily
// label.set_text(monthlyLabel, "DO / MO ")
// if is_weekly_open
// if can_show_weekly
// label.set_text(monthlyLabel, "WO / MO ")
// if can_show_daily and can_show_weekly
// label.set_text(monthlyLabel, "DO / WO / MO ")
// the start of the line is drew from the first week of the month
// if the first day of the weekly candle (monday) is the 2nd of the month
// we fix the start of the line position on the Prev weekly candle
if timeframe.isweekly and dayofweek(monthly_time) != dayofweek.monday
line.set_x1(monthlyLine, monthly_time - (weekly_time - weekly_time ))
ADR % RangesThis indicator is designed to visually represent percentage lines from the open of the day. The % amount is determined by X amount of the last days to create an average...or Average Daily Range (ADR).
1. ADR Percentage Lines: The core function of the script is to apply lines to the chart that represent specific percentage changes from the daily open. It first calculates the average over X amount of days and then displays two lines that are 1/3rd of that average. One line goes above the other line goes below. The other two lines are the full "range" of the average. These lines can act as boundaries or targets to know how an asset has moved recently. *Past performance is not indicative of current or future results.
The calculation for ADR is:
Step 1. Calculate Today's Range = DailyHigh - DailyLow
Step 2. Store this average after the day has completed
Step 3. Sum all day's ranges
Step 4. Divide by total number of days
Step 5. Draw on chart
2. Customizable Inputs: Users have the flexibility to customize the script through various inputs. This includes the option to display lines only for the current trading day (`todayonly`), and to select which lines are displayed. The user can also opt to show a table the displays the total range of previous days and the average range of those previous days.
3. No Secondary Timeframe: The ADR is computed based on whatever timeframe the chart is and does not reference secondary periods. Therefore the script cannot be used on charts greater than daily.
This script is can be used by all traders for any market. The trader might have to adjust the "X" number of days back to compute a historical average. Maybe they only want to know the average over the past week (5 days) or maybe the past month (20 days).
D_H_L_OIndicator Name: D_H_L_O
Primary Function:
This indicator is designed to display buying pressure, selling pressure, and other key metrics derived from the daily candle on a TradingView chart. It helps you analyze market momentum, buying and selling forces, and price spreads.
Features Overview:
Basic Calculations from Daily Candle:
dailyHigh, dailyLow, dailyOpen, dailyClose: Represent the high, low, open, and close prices of the daily candle.
dailySpread: The difference between the high and low prices of the daily candle.
Buying and Selling Pressure:
Buying Pressure (high_open): The difference between the daily high and the open price.
Selling Pressure (low_open): The absolute difference between the daily low and the open price (displayed as a negative value).
deltaVolume: The net difference between buying and selling pressure.
Color and Visuals:
Blue (buyingColor): Indicates buying pressure for green (bullish) days.
Orange (sellingColor): Indicates selling pressure for red (bearish) days.
Displays bars with transparency to distinguish buying and selling forces.
Neutral Reference Line:
A horizontal line at 0 for quick visual comparison of buying and selling forces.
Labels for Key Information:
Displays values of buying pressure, selling pressure, and daily candle spread directly on the chart at corresponding bar positions.
Includes the weekday name (currentWeekday) for additional time context.
Historical Statistics:
Highest and lowest values of buying and selling pressure across the dataset.
Average buying and selling pressure.
Displays statistical summaries (like maximum pressure values) as labels on the last bar of the chart.
Benefits:
Detailed Market Pressure Visualization: Provides a clear view of the forces driving market movement each day.
Historical Context: Helps analyze historical trends in buying and selling pressures over time.
Decision-Making Support: Use pressure metrics to gauge market momentum and assess potential trends.
How to Use:
Copy and paste the script into TradingView (create a new indicator using Pine Script v5).
Add the indicator to your chart on any timeframe to observe daily candle metrics.
Customize colors, transparency, or other parameters to suit your trading style.
This indicator is ideal for traders who want to analyze price momentum and make decisions based on daily market behavior.





















