PROTECTED SOURCE SCRIPT
swing indicator

Installation & Configuration - swing Indicator
⚙️ Parameter Configuration
"Settings" Group (General Parameters)
Show Moving Average: Show/hide the OI moving average
✅ Recommended: Enabled to visualize the trend
Helps identify if OI is above or below its average
MA Period: Moving average period (default: 20)
📊 Common values:
20: Short/medium term trend (responsive)
50: Medium term trend (balanced)
100: Long term trend (stable)
Compare with Volume: Display normalized volume in background
💡 Useful to compare OI evolution with volume
Helps identify divergences between Open interest (oi) and Volume
OI Significant Change Threshold: Detection threshold for significant changes
Available options: 10%, 15%, 20%, 25%, 30%, 40%
🎯 10-15%: High sensitivity (many signals, possible noise)
🎯 20-25%: Normal sensitivity (moderate signals, recommended)
🎯 30-40%: Low sensitivity (rare but very significant signals)
⚡ This threshold determines when green/red triangles appear
Manual OI Symbol (optional): Manually enter the OI symbol
📝 Leave empty for automatic detection
⚙️ Use only if your symbol is not automatically recognized
Manual example: COMEX:GC1!_OI for gold
"Visual Signals" Group
Show Triangles (Significant Changes): Show/hide triangles
▲ GREEN Triangle = Significant OI increase (> configured threshold)
▼ RED Triangle = Significant OI decrease (< -configured threshold)
✅ Recommended: Enabled to see important changes
💡 Disable if you find the chart too cluttered
Show Circles (MA Crossovers): Show/hide circles
● GREEN Circle = OI crosses MA upward
● RED Circle = OI crosses MA downward
✅ Recommended: Enabled if you use MA crossover strategy
💡 Disable if you focus only on OI variations
"Style" Group (Color Customization)
OI Color: Main Open Interest histogram color
Default: Blue
🎨 Customize according to your visual preferences
OI Rising: Histogram color when OI increases
Default: Transparent green
Subtle display of direction
OI Falling: Histogram color when OI decreases
Default: Transparent red
Subtle display of direction
MA Color: Moving average color
Default: Orange
Should contrast with OI color
Volume Color: Normalized volume background color
Default: Transparent gray
Discreet enough not to hinder reading
📊 Reading the Information Panel
The panel at the top right of the chart displays:
By: Alphaomega18
Indicator creator's signature
⚠️ WARNING: OI symbol not detected
Only appears if OI symbol is not automatically detected
Action: Check symbol or enter manually
Open Interest
Current Open Interest value
Format: number of contracts (e.g., 485.2K = 485,200 contracts)
Change
OI % change from previous bar
🟢 Green = OI increase
🔴 Red = OI decrease
Ex: +2.45% = OI increased by 2.45%
Threshold
Displays configured threshold for alerts
Ex: "25%" = alerts triggered at +25% or -25%
Yellow color for visibility
MA(20)
Current moving average value
Number in parentheses indicates period
Ex: MA(50) if you configured a 50 period
Signal
🟢 Strong Trend: OI > MA → Strong participation, solid trend
🔴 Weak Trend: OI < MA → Weak participation, fragile trend
🎯 Visual Signals on Chart
Triangles (Significant Changes)
▲ GREEN Triangle (bottom of chart)
Meaning: Significant OI increase
Trigger: OI increases more than configured threshold
Example: If threshold = 25%, triangle appears when OI +25% or more
📈 Interpretation: New contracts opened = growing interest
▼ RED Triangle (bottom of chart)
Meaning: Significant OI decrease
Trigger: OI decreases more than configured threshold
Example: If threshold = 25%, triangle appears when OI -25% or less
📉 Interpretation: Massive position closing = disengagement
Circles (Moving Average Crossovers)
🟢 GREEN Circle (bottom of chart)
Meaning: OI just crossed MA upward
Signal: Open interest back above its average
📊 Interpretation: Interest returning, potential trend start
🔴 RED Circle (top of chart)
Meaning: OI just crossed MA downward
Signal: Open interest back below its average
📊 Interpretation: Decreasing interest, potential weakening
🔔 Alert Configuration
Create an alert:
Right-click on chart → "Add Alert" (or ALT + A)
In "Condition", select "Open Interest"
Choose alert type from 4 available
Configure notification options
Click "Create"
Available alert types:
OI Significant Increase
Triggers when OI increases beyond configured threshold
Example: Threshold 25% → Alert if OI +25% or more
Use: Detect massive influx of new contracts
OI Significant Decrease
Triggers when OI decreases beyond configured threshold
Example: Threshold 25% → Alert if OI -25% or less
Use: Detect massive position closing
OI crosses MA up
Triggers when OI crosses its moving average upward
Condition: OI was below MA and crosses above
Use: Identify interest returning
OI crosses MA down
Triggers when OI crosses its moving average downward
Condition: OI was above MA and crosses below
Use: Identify decreasing interest
Notification configuration:
✉️ Email: Receive alert via email
📱 SMS: Receive alert via SMS (subscription required)
🔔 Popup: Notification on TradingView
📲 App: Notification on TradingView mobile app
🔗 Webhook: Send alert to external system
💡 Advanced Interpretation
Combined OI + Price Analysis:
Open InterestPriceInterpretationSuggested Action↑ Rising↑ Rising🟢 STRONG UptrendNew buyers entering, robust trend, consider long positions↑ Rising↓ Falling🔴 STRONG DowntrendNew sellers entering, bearish pressure, consider short positions↓ Falling↑ Rising📊 Short coveringClosing short positions, potentially temporary move↓ Falling↓ Falling📊 Long liquidationClosing long positions, potentially temporary move
OI vs Moving Average:
OI > MA (Signal: Strong Trend)
Open interest above its average
Market participation above normal
Trend supported by growing interest
✅ Increased confidence in market direction
OI < MA (Signal: Weak Trend)
Open interest below its average
Market participation below normal
Potentially fragile trend
⚠️ Caution: trend lacks conviction
OI vs Volume:
Rising OI + Rising Volume
New contracts + high trading activity
💪 Very strong trend signal
Falling OI + Rising Volume
Position closing + high activity
⚡ Potential reversal or massive profit-taking
Stable OI + Rising Volume
Transfer of positions between traders
🔄 Changing hands, no new commitments
🛠️ Troubleshooting
❌ Issue: "⚠️ WARNING - OI symbol not detected"
✅ Solutions:
Check contract symbol
Make sure you're on a continuous futures contract (e.g., GC1!, CL1!)
Not on a specific contract (e.g., GCZ2024)
Enter symbol manually
Go to Settings → Manual OI Symbol
Format: EXCHANGE:SYMBOL_OI
Examples:
Gold: COMEX:GC1!_OI
WTI Crude: NYMEX:CL1!_OI
Natural Gas: NYMEX:NG1!_OI
Check data availability
Not all markets have public OI data
Verify on TradingView if OI data exists
❌ Issue: No data displayed (empty chart)
✅ Solutions:
Change timeframe
OI is generally published daily
Switch to Daily (1D) or Weekly (1W)
Intraday timeframes may not have data
Check data connection
Refresh TradingView page
Check your TradingView subscription (some data requires subscription)
Test on another market
Try with gold (COMEX:GC1!) which always has OI data
If it works, problem comes from initial market
❌ Issue: Too many visual signals (cluttered chart)
✅ Solutions:
Increase detection threshold
Settings → OI Significant Change Threshold
Change from 20% to 30% or 40%
Fewer signals, but more significant
Disable some signals
Visual Signals → Uncheck "Show Triangles" or "Show Circles"
Keep only the most important signals for you
Adjust colors
Style → Reduce color opacity
Make signals more discreet visually
❌ Issue: Not enough signals
✅ Solutions:
Reduce detection threshold
Settings → OI Significant Change Threshold
Change to 10% or 15%
More signals, but beware of noise
Enable all signals
Visual Signals → Check "Show Triangles" AND "Show Circles"
Full display of all events
Reduce MA period
Settings → MA Period → Change from 20 to 10
More responsive MA = more crossovers
📈 Compatible Markets (Auto-detection)
✅ Energy (NYMEX)
CL, CL1!: WTI Crude Oil
BZ, BZ1!: Brent Crude
NG, NG1!: Natural Gas
RB, RB1!: RBOB Gasoline
HO, HO1!: Heating Oil
✅ Precious Metals (COMEX/NYMEX)
GC, GC1!: Gold
SI, SI1!: Silver
PL, PL1!: Platinum
PA, PA1!: Palladium
HG, HG1!: Copper
✅ Industrial Metals (LME)
ALI, ALI1!: Aluminum
ZNC, ZNC1!: Zinc
NI, NI1!: Nickel
✅ Agriculture - Grains (CBOT)
ZC, ZC1!: Corn
ZW, ZW1!: Wheat
ZS, ZS1!: Soybeans
ZM, ZM1!: Soybean Meal
ZL, ZL1!: Soybean Oil
ZO, ZO1!: Oats
ZR, ZR1!: Rice
✅ Agriculture - Softs (ICE)
SB, SB1!: Sugar
KC, KC1!: Coffee
CC, CC1!: Cocoa
CT, CT1!: Cotton
OJ, OJ1!: Orange Juice
✅ Livestock (CME)
LE, LE1!: Live Cattle
GF, GF1!: Feeder Cattle
HE, HE1!: Lean Hogs
✅ Other
LBS, LBS1!: Lumber (CME)
🎓 Usage Tips
For beginners:
Start with default parameters (threshold 25%, MA 20)
Enable all visual signals
Focus on liquid markets (gold, crude oil)
Observe how OI reacts to price movements
For intermediate traders:
Adjust threshold according to market volatility (15-30%)
Combine with other technical indicators
Create alerts for significant changes
Analyze OI/Price divergences
For advanced traders:
Use multiple MA periods (20, 50, 100)
Analyze OI/Volume/Price correlation
Configure alerts on multiple timeframes
Integrate into complete trading strategy
📊 Practical Example
Scenario: Gold Trading (COMEX:GC1!)
Initial setup:
Threshold: 20% (gold volatile)
MA: 20 days
All signals enabled
Timeframe: Daily (1D)
Observation:
Gold price: Uptrend
OI: ▲ Green triangle (increase of +22%)
Signal: 🟢 Strong Trend (OI > MA)
Interpretation:
New buyers massively entering
Uptrend supported by OI
Strong market conviction
Action:
✅ Long position validated by OI
Stop loss below technical support
Monitor if OI continues to increase
✨ Made by Alphaomega18
⚙️ Parameter Configuration
"Settings" Group (General Parameters)
Show Moving Average: Show/hide the OI moving average
✅ Recommended: Enabled to visualize the trend
Helps identify if OI is above or below its average
MA Period: Moving average period (default: 20)
📊 Common values:
20: Short/medium term trend (responsive)
50: Medium term trend (balanced)
100: Long term trend (stable)
Compare with Volume: Display normalized volume in background
💡 Useful to compare OI evolution with volume
Helps identify divergences between Open interest (oi) and Volume
OI Significant Change Threshold: Detection threshold for significant changes
Available options: 10%, 15%, 20%, 25%, 30%, 40%
🎯 10-15%: High sensitivity (many signals, possible noise)
🎯 20-25%: Normal sensitivity (moderate signals, recommended)
🎯 30-40%: Low sensitivity (rare but very significant signals)
⚡ This threshold determines when green/red triangles appear
Manual OI Symbol (optional): Manually enter the OI symbol
📝 Leave empty for automatic detection
⚙️ Use only if your symbol is not automatically recognized
Manual example: COMEX:GC1!_OI for gold
"Visual Signals" Group
Show Triangles (Significant Changes): Show/hide triangles
▲ GREEN Triangle = Significant OI increase (> configured threshold)
▼ RED Triangle = Significant OI decrease (< -configured threshold)
✅ Recommended: Enabled to see important changes
💡 Disable if you find the chart too cluttered
Show Circles (MA Crossovers): Show/hide circles
● GREEN Circle = OI crosses MA upward
● RED Circle = OI crosses MA downward
✅ Recommended: Enabled if you use MA crossover strategy
💡 Disable if you focus only on OI variations
"Style" Group (Color Customization)
OI Color: Main Open Interest histogram color
Default: Blue
🎨 Customize according to your visual preferences
OI Rising: Histogram color when OI increases
Default: Transparent green
Subtle display of direction
OI Falling: Histogram color when OI decreases
Default: Transparent red
Subtle display of direction
MA Color: Moving average color
Default: Orange
Should contrast with OI color
Volume Color: Normalized volume background color
Default: Transparent gray
Discreet enough not to hinder reading
📊 Reading the Information Panel
The panel at the top right of the chart displays:
By: Alphaomega18
Indicator creator's signature
⚠️ WARNING: OI symbol not detected
Only appears if OI symbol is not automatically detected
Action: Check symbol or enter manually
Open Interest
Current Open Interest value
Format: number of contracts (e.g., 485.2K = 485,200 contracts)
Change
OI % change from previous bar
🟢 Green = OI increase
🔴 Red = OI decrease
Ex: +2.45% = OI increased by 2.45%
Threshold
Displays configured threshold for alerts
Ex: "25%" = alerts triggered at +25% or -25%
Yellow color for visibility
MA(20)
Current moving average value
Number in parentheses indicates period
Ex: MA(50) if you configured a 50 period
Signal
🟢 Strong Trend: OI > MA → Strong participation, solid trend
🔴 Weak Trend: OI < MA → Weak participation, fragile trend
🎯 Visual Signals on Chart
Triangles (Significant Changes)
▲ GREEN Triangle (bottom of chart)
Meaning: Significant OI increase
Trigger: OI increases more than configured threshold
Example: If threshold = 25%, triangle appears when OI +25% or more
📈 Interpretation: New contracts opened = growing interest
▼ RED Triangle (bottom of chart)
Meaning: Significant OI decrease
Trigger: OI decreases more than configured threshold
Example: If threshold = 25%, triangle appears when OI -25% or less
📉 Interpretation: Massive position closing = disengagement
Circles (Moving Average Crossovers)
🟢 GREEN Circle (bottom of chart)
Meaning: OI just crossed MA upward
Signal: Open interest back above its average
📊 Interpretation: Interest returning, potential trend start
🔴 RED Circle (top of chart)
Meaning: OI just crossed MA downward
Signal: Open interest back below its average
📊 Interpretation: Decreasing interest, potential weakening
🔔 Alert Configuration
Create an alert:
Right-click on chart → "Add Alert" (or ALT + A)
In "Condition", select "Open Interest"
Choose alert type from 4 available
Configure notification options
Click "Create"
Available alert types:
OI Significant Increase
Triggers when OI increases beyond configured threshold
Example: Threshold 25% → Alert if OI +25% or more
Use: Detect massive influx of new contracts
OI Significant Decrease
Triggers when OI decreases beyond configured threshold
Example: Threshold 25% → Alert if OI -25% or less
Use: Detect massive position closing
OI crosses MA up
Triggers when OI crosses its moving average upward
Condition: OI was below MA and crosses above
Use: Identify interest returning
OI crosses MA down
Triggers when OI crosses its moving average downward
Condition: OI was above MA and crosses below
Use: Identify decreasing interest
Notification configuration:
✉️ Email: Receive alert via email
📱 SMS: Receive alert via SMS (subscription required)
🔔 Popup: Notification on TradingView
📲 App: Notification on TradingView mobile app
🔗 Webhook: Send alert to external system
💡 Advanced Interpretation
Combined OI + Price Analysis:
Open InterestPriceInterpretationSuggested Action↑ Rising↑ Rising🟢 STRONG UptrendNew buyers entering, robust trend, consider long positions↑ Rising↓ Falling🔴 STRONG DowntrendNew sellers entering, bearish pressure, consider short positions↓ Falling↑ Rising📊 Short coveringClosing short positions, potentially temporary move↓ Falling↓ Falling📊 Long liquidationClosing long positions, potentially temporary move
OI vs Moving Average:
OI > MA (Signal: Strong Trend)
Open interest above its average
Market participation above normal
Trend supported by growing interest
✅ Increased confidence in market direction
OI < MA (Signal: Weak Trend)
Open interest below its average
Market participation below normal
Potentially fragile trend
⚠️ Caution: trend lacks conviction
OI vs Volume:
Rising OI + Rising Volume
New contracts + high trading activity
💪 Very strong trend signal
Falling OI + Rising Volume
Position closing + high activity
⚡ Potential reversal or massive profit-taking
Stable OI + Rising Volume
Transfer of positions between traders
🔄 Changing hands, no new commitments
🛠️ Troubleshooting
❌ Issue: "⚠️ WARNING - OI symbol not detected"
✅ Solutions:
Check contract symbol
Make sure you're on a continuous futures contract (e.g., GC1!, CL1!)
Not on a specific contract (e.g., GCZ2024)
Enter symbol manually
Go to Settings → Manual OI Symbol
Format: EXCHANGE:SYMBOL_OI
Examples:
Gold: COMEX:GC1!_OI
WTI Crude: NYMEX:CL1!_OI
Natural Gas: NYMEX:NG1!_OI
Check data availability
Not all markets have public OI data
Verify on TradingView if OI data exists
❌ Issue: No data displayed (empty chart)
✅ Solutions:
Change timeframe
OI is generally published daily
Switch to Daily (1D) or Weekly (1W)
Intraday timeframes may not have data
Check data connection
Refresh TradingView page
Check your TradingView subscription (some data requires subscription)
Test on another market
Try with gold (COMEX:GC1!) which always has OI data
If it works, problem comes from initial market
❌ Issue: Too many visual signals (cluttered chart)
✅ Solutions:
Increase detection threshold
Settings → OI Significant Change Threshold
Change from 20% to 30% or 40%
Fewer signals, but more significant
Disable some signals
Visual Signals → Uncheck "Show Triangles" or "Show Circles"
Keep only the most important signals for you
Adjust colors
Style → Reduce color opacity
Make signals more discreet visually
❌ Issue: Not enough signals
✅ Solutions:
Reduce detection threshold
Settings → OI Significant Change Threshold
Change to 10% or 15%
More signals, but beware of noise
Enable all signals
Visual Signals → Check "Show Triangles" AND "Show Circles"
Full display of all events
Reduce MA period
Settings → MA Period → Change from 20 to 10
More responsive MA = more crossovers
📈 Compatible Markets (Auto-detection)
✅ Energy (NYMEX)
CL, CL1!: WTI Crude Oil
BZ, BZ1!: Brent Crude
NG, NG1!: Natural Gas
RB, RB1!: RBOB Gasoline
HO, HO1!: Heating Oil
✅ Precious Metals (COMEX/NYMEX)
GC, GC1!: Gold
SI, SI1!: Silver
PL, PL1!: Platinum
PA, PA1!: Palladium
HG, HG1!: Copper
✅ Industrial Metals (LME)
ALI, ALI1!: Aluminum
ZNC, ZNC1!: Zinc
NI, NI1!: Nickel
✅ Agriculture - Grains (CBOT)
ZC, ZC1!: Corn
ZW, ZW1!: Wheat
ZS, ZS1!: Soybeans
ZM, ZM1!: Soybean Meal
ZL, ZL1!: Soybean Oil
ZO, ZO1!: Oats
ZR, ZR1!: Rice
✅ Agriculture - Softs (ICE)
SB, SB1!: Sugar
KC, KC1!: Coffee
CC, CC1!: Cocoa
CT, CT1!: Cotton
OJ, OJ1!: Orange Juice
✅ Livestock (CME)
LE, LE1!: Live Cattle
GF, GF1!: Feeder Cattle
HE, HE1!: Lean Hogs
✅ Other
LBS, LBS1!: Lumber (CME)
🎓 Usage Tips
For beginners:
Start with default parameters (threshold 25%, MA 20)
Enable all visual signals
Focus on liquid markets (gold, crude oil)
Observe how OI reacts to price movements
For intermediate traders:
Adjust threshold according to market volatility (15-30%)
Combine with other technical indicators
Create alerts for significant changes
Analyze OI/Price divergences
For advanced traders:
Use multiple MA periods (20, 50, 100)
Analyze OI/Volume/Price correlation
Configure alerts on multiple timeframes
Integrate into complete trading strategy
📊 Practical Example
Scenario: Gold Trading (COMEX:GC1!)
Initial setup:
Threshold: 20% (gold volatile)
MA: 20 days
All signals enabled
Timeframe: Daily (1D)
Observation:
Gold price: Uptrend
OI: ▲ Green triangle (increase of +22%)
Signal: 🟢 Strong Trend (OI > MA)
Interpretation:
New buyers massively entering
Uptrend supported by OI
Strong market conviction
Action:
✅ Long position validated by OI
Stop loss below technical support
Monitor if OI continues to increase
✨ Made by Alphaomega18
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.