OPEN-SOURCE SCRIPT
Trend Strength Detector TSD

Trend Strength Detector (TSD)
*Objective Trend Quality Measurement for Educational Market Analysis*
Note: This mathematical framework is a proprietary quantitative model developed by Ario Pinelab, inspired by classical EMA, ADX, RSI and MACD principles, yet not documented in any public technical or academic publication.
## 🎯 Purpose & Design Philosophy
The ** Trend Strength Detector- TSD ** is an educational research tool that provides **quantitative measurement of trend quality** through two independent scoring systems (0-100 scale). It answers the analytical question: *"How strong and aligned is the current market trend environment?"*
This indicator is designed with a **modular, complementary approach** to work alongside various analysis methodologies, particularly pattern-based recognition systems.
## 🔗 Complementary Research Framework
### Designed to Work With Pattern Detection Systems
This indicator provides **environmental context measurement** that complements qualitative pattern recognition tools. It works particularly well alongside systems like:
- **RMBS Smart Detector - Multi-Factor Momentum System**
- Traditional chart pattern analyzers
- Any momentum-based pattern identification tools
🔍 **To find RMBS Smart Detector:**
- Search in TradingView Indicators Library: `" RMBS Smart Detector - Multi-Factor Momentum System"`
- Look for: *Multi-Factor Momentum System*
- By author: `[Ario_pinelab]`
### Why This Complementary Approach?
**Trend Quality Measurement** (TSD - this tool) provides:
- ✅ Structural trend alignment (0-100 score)
- ✅ Momentum intensity levels (0-100 score)
- ✅ Environment classification (Strong/Moderate/Weak)
- 📌 **Answers:** *"HOW STRONG is the underlying trend environment?"*
### Educational Research Value
When used together in a research context, these tools enable systematic study of questions like:
- How do reversal patterns behave when Strength Score is above 70 vs below 30?
- Do continuation patterns in weakening environments (declining scores) show different characteristics?
- What is the correlation between high Alignment Scores and pattern "success rates"?
- Can environment classification help identify genuine trend initiation vs false starts?
⚠️ **Important Note:** Both tools are **independent and work standalone**. TSD provides value whether used alone or with other analysis methods. The relationship with RMBS (or any pattern tool) is **complementary for research purposes**, not dependent.
---
###Mathematical Foundation
##TSA Formula: scoring method developed by Ario
-Trend Model (0 – 100)
TAS = EMA Alignment (0–40) + Price Position (0–30) + Trend Consistency (0–30)
EMA Alignment checks EMA_fast vs EMA_slow vs EMA_trend structure.
Price Position evaluates if Close is above/below all EMAs.
Consistency = 3 × max(bullish,bearish bars within 10 candles).
-Strength Model (0 – 100)
Strength = ADX (0–50) + EMA Slope (0–25) + RSI (0–15) + MACD (0–10)
ADX measures trend energy; Slope shows EMA momentum %;
RSI assesses zone positioning; MACD confirms directional agreement.
Note: This formula represents a proprietary quantitative model by Ario_Pinelab, inspired by classical technical concepts but not published in any external reference.________________________________________
📊 Environment Classification
Based on Total Strength Score:
🟢 Strong Environment: Score ≥ 60
→ Well-defined momentum, clear directional bias
🟡 Moderate Environment: 40 ≤ Score < 60
→ Mixed signals, transitional conditions
🔴 Weak Environment: Score < 40
→ Ranging, choppy, low conviction movement
Color Coding:
• Green background: Strong (≥60)
• Yellow background: Moderate (40-59)
• Red background: Weak (<40)
________________________________________
📈 Visual Components
Main Chart Display
Score Labels (Top-Right Corner):
┌─────────────────────────────────┐
│ 📊 Alignment: 75 | Strength: 82 │
│ Environment: Strong 🟢 │
└─────────────────────────────────┘
Color-Coded Background:
• Environment strength visually indicated via background color
• Helps quick identification of market regime
• Customizable transparency (default: 90%)
Reference Lines:
• Dotted line at 60: Strong/Moderate threshold
• Dotted line at 40: Moderate/Weak threshold
• Mid-line at 50: Neutral reference
________________________________________
🔧 Customization Settings
Input Parameters
The best setting is the default mode.
🚫 Important Disclaimers & Limitations
What This Indicator IS:
✅ Educational measurement tool for trend quality research
✅ Quantitative assessment of current market environment
✅ Complementary analysis tool for pattern-based systems
✅ Historical data analyzer for systematic study
✅ Multi-factor scoring system based on technical calculations
What This Indicator IS NOT:
❌ NOT a trading system or signal generator
❌ NOT financial advice or trade recommendations
❌ NOT predictive of future price movements
❌ NOT a guarantee of pattern success/failure
❌ NOT a substitute for comprehensive risk management
________________________________________
Known Limitations
1. Lagging Nature:
⚠️ All components (EMA, ADX, RSI, MACD) are calculated
from historical price data
→ Scores reflect CURRENT and RECENT conditions
→ Cannot predict sudden reversals or black swan events
→ Trend measurements lag actual price turning points
2. Whipsaw Risk:
⚠️ In choppy/ranging markets, scores may fluctuate rapidly
→ Moderate zone (40-60) can see frequent transitions
→ Low timeframes more susceptible to noise
→ Consider higher timeframes for stable measurements
3. Component Conflicts:
⚠️ Individual components may disagree
→ Example: Strong ADX but weak RSI alignment
→ Scores average these conflicts (may hide nuance)
→ Check individual components for deeper insight
4. Not Predictive:
⚠️ High scores do NOT guarantee continuation
⚠️ Low scores do NOT guarantee reversal
→ Measurement ≠ Prediction
→ Use for CONTEXT, not SIGNALS
→ Combine with comprehensive analysis
________________________________________
Risk Acknowledgments
Market Risk:
• All trading involves substantial risk of loss
• Past performance (even systematic studies) does not guarantee future results
• No indicator, system, or methodology can eliminate market risk
Measurement Limitations:
• Scores are mathematical calculations, not market predictions
• Environmental classification is descriptive, not prescriptive
• Strong measurements can deteriorate rapidly without warning
Educational Purpose:
• This tool is designed for LEARNING about market structure
• Not designed, tested, or validated as a standalone trading system
• Any trading decisions are user’s sole responsibility
No Warranty:
• Indicator provided “as-is” for educational purposes
• No guarantee of accuracy, reliability, or profitability
• Users must verify calculations and apply critical thinking
Open Source
Full Pine Script code available for educational study and modification. Feedback and improvement suggestions welcome.
“All logic is presented for research and educational visualization.”
---
**Attribution & Fair Use Notice**
The Trend Strength Detector (TSD) scoring framework (Multi-Factor Momentum System) was originally designed and formulated by *Ahmadrezarahmati( Ario or Ario_ Pine Lab)*.
If you build upon, modify, or republish this logic—please include proper attribution to the original author. This request is made under a spirit of open collaboration and educational fairness.
*Objective Trend Quality Measurement for Educational Market Analysis*
Note: This mathematical framework is a proprietary quantitative model developed by Ario Pinelab, inspired by classical EMA, ADX, RSI and MACD principles, yet not documented in any public technical or academic publication.
## 🎯 Purpose & Design Philosophy
The ** Trend Strength Detector- TSD ** is an educational research tool that provides **quantitative measurement of trend quality** through two independent scoring systems (0-100 scale). It answers the analytical question: *"How strong and aligned is the current market trend environment?"*
This indicator is designed with a **modular, complementary approach** to work alongside various analysis methodologies, particularly pattern-based recognition systems.
## 🔗 Complementary Research Framework
### Designed to Work With Pattern Detection Systems
This indicator provides **environmental context measurement** that complements qualitative pattern recognition tools. It works particularly well alongside systems like:
- **RMBS Smart Detector - Multi-Factor Momentum System**
- Traditional chart pattern analyzers
- Any momentum-based pattern identification tools
🔍 **To find RMBS Smart Detector:**
- Search in TradingView Indicators Library: `" RMBS Smart Detector - Multi-Factor Momentum System"`
- Look for: *Multi-Factor Momentum System*
- By author: `[Ario_pinelab]`
### Why This Complementary Approach?
**Trend Quality Measurement** (TSD - this tool) provides:
- ✅ Structural trend alignment (0-100 score)
- ✅ Momentum intensity levels (0-100 score)
- ✅ Environment classification (Strong/Moderate/Weak)
- 📌 **Answers:** *"HOW STRONG is the underlying trend environment?"*
### Educational Research Value
When used together in a research context, these tools enable systematic study of questions like:
- How do reversal patterns behave when Strength Score is above 70 vs below 30?
- Do continuation patterns in weakening environments (declining scores) show different characteristics?
- What is the correlation between high Alignment Scores and pattern "success rates"?
- Can environment classification help identify genuine trend initiation vs false starts?
⚠️ **Important Note:** Both tools are **independent and work standalone**. TSD provides value whether used alone or with other analysis methods. The relationship with RMBS (or any pattern tool) is **complementary for research purposes**, not dependent.
---
###Mathematical Foundation
##TSA Formula: scoring method developed by Ario
-Trend Model (0 – 100)
TAS = EMA Alignment (0–40) + Price Position (0–30) + Trend Consistency (0–30)
EMA Alignment checks EMA_fast vs EMA_slow vs EMA_trend structure.
Price Position evaluates if Close is above/below all EMAs.
Consistency = 3 × max(bullish,bearish bars within 10 candles).
-Strength Model (0 – 100)
Strength = ADX (0–50) + EMA Slope (0–25) + RSI (0–15) + MACD (0–10)
ADX measures trend energy; Slope shows EMA momentum %;
RSI assesses zone positioning; MACD confirms directional agreement.
Note: This formula represents a proprietary quantitative model by Ario_Pinelab, inspired by classical technical concepts but not published in any external reference.________________________________________
📊 Environment Classification
Based on Total Strength Score:
🟢 Strong Environment: Score ≥ 60
→ Well-defined momentum, clear directional bias
🟡 Moderate Environment: 40 ≤ Score < 60
→ Mixed signals, transitional conditions
🔴 Weak Environment: Score < 40
→ Ranging, choppy, low conviction movement
Color Coding:
• Green background: Strong (≥60)
• Yellow background: Moderate (40-59)
• Red background: Weak (<40)
________________________________________
📈 Visual Components
Main Chart Display
Score Labels (Top-Right Corner):
┌─────────────────────────────────┐
│ 📊 Alignment: 75 | Strength: 82 │
│ Environment: Strong 🟢 │
└─────────────────────────────────┘
Color-Coded Background:
• Environment strength visually indicated via background color
• Helps quick identification of market regime
• Customizable transparency (default: 90%)
Reference Lines:
• Dotted line at 60: Strong/Moderate threshold
• Dotted line at 40: Moderate/Weak threshold
• Mid-line at 50: Neutral reference
________________________________________
🔧 Customization Settings
Input Parameters
The best setting is the default mode.
🚫 Important Disclaimers & Limitations
What This Indicator IS:
✅ Educational measurement tool for trend quality research
✅ Quantitative assessment of current market environment
✅ Complementary analysis tool for pattern-based systems
✅ Historical data analyzer for systematic study
✅ Multi-factor scoring system based on technical calculations
What This Indicator IS NOT:
❌ NOT a trading system or signal generator
❌ NOT financial advice or trade recommendations
❌ NOT predictive of future price movements
❌ NOT a guarantee of pattern success/failure
❌ NOT a substitute for comprehensive risk management
________________________________________
Known Limitations
1. Lagging Nature:
⚠️ All components (EMA, ADX, RSI, MACD) are calculated
from historical price data
→ Scores reflect CURRENT and RECENT conditions
→ Cannot predict sudden reversals or black swan events
→ Trend measurements lag actual price turning points
2. Whipsaw Risk:
⚠️ In choppy/ranging markets, scores may fluctuate rapidly
→ Moderate zone (40-60) can see frequent transitions
→ Low timeframes more susceptible to noise
→ Consider higher timeframes for stable measurements
3. Component Conflicts:
⚠️ Individual components may disagree
→ Example: Strong ADX but weak RSI alignment
→ Scores average these conflicts (may hide nuance)
→ Check individual components for deeper insight
4. Not Predictive:
⚠️ High scores do NOT guarantee continuation
⚠️ Low scores do NOT guarantee reversal
→ Measurement ≠ Prediction
→ Use for CONTEXT, not SIGNALS
→ Combine with comprehensive analysis
________________________________________
Risk Acknowledgments
Market Risk:
• All trading involves substantial risk of loss
• Past performance (even systematic studies) does not guarantee future results
• No indicator, system, or methodology can eliminate market risk
Measurement Limitations:
• Scores are mathematical calculations, not market predictions
• Environmental classification is descriptive, not prescriptive
• Strong measurements can deteriorate rapidly without warning
Educational Purpose:
• This tool is designed for LEARNING about market structure
• Not designed, tested, or validated as a standalone trading system
• Any trading decisions are user’s sole responsibility
No Warranty:
• Indicator provided “as-is” for educational purposes
• No guarantee of accuracy, reliability, or profitability
• Users must verify calculations and apply critical thinking
Open Source
Full Pine Script code available for educational study and modification. Feedback and improvement suggestions welcome.
“All logic is presented for research and educational visualization.”
---
**Attribution & Fair Use Notice**
The Trend Strength Detector (TSD) scoring framework (Multi-Factor Momentum System) was originally designed and formulated by *Ahmadrezarahmati( Ario or Ario_ Pine Lab)*.
If you build upon, modify, or republish this logic—please include proper attribution to the original author. This request is made under a spirit of open collaboration and educational fairness.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.