OPEN-SOURCE SCRIPT
Mis à jour

Investment Analysis Bar v2

151
What It Does
A comprehensive analysis bar combining fundamental metrics with technical signals, designed for long-term investors who prioritize quality over momentum.
Core Philosophy: Quality companies trading below their 200 EMA in accumulation zones = opportunities, not warnings.

Tier 1 Bar Metrics

Margins: GM, OM, NIM, FCF Margin
Returns: ROCE, ROE
Growth: Revenue YoY, EPS YoY
Valuation: PE TTM, Forward PE, PEG
Zone: Accumulate / Hold / Trim / Exit
Signal: PRIME / BUY / TRIM / SELL / NEUTRAL
Performance: 1W to 1Y returns


Two Strategy Modes
Value Accumulator (Default) - For long-term position building. Treats below-200-EMA as an opportunity when fundamentals are intact. PRIME signals require: RSI bounce + Volume + Accumulate Zone + All Quality Gates Pass + Below 200 EMA.
Trend Follower - Traditional momentum approach. Prefers entries above 200 EMA.

Quality Gates System
Four fundamental checkpoints:

Gross Margin ≥ 40%
ROCE ≥ 15%
Debt/Equity ≤ 50%
SBC/Revenue ≤ 15%

Strong signals require quality confirmation. PRIME signals require ALL gates to pass.

Zone System
Three calculation methods:

52W Range: Accumulate in bottom 25%, Trim in top 25%
Manual Levels: Set your own price targets
ATR-Based: Dynamic zones from EMA ± ATR


Signal Hierarchy (Value Mode)
SignalMeaning
PRIME 💎Optimal entry - all conditions aligned
BUY 🔼Strong accumulation signal
BUY? ↗Decent entry, not ideal zone
ACCUM 🎯In accumulation zone, quality OK
WAIT ⏳Setup forming, no bounce yet
TRIM 📤Consider taking profits

Alerts Included

Zone transitions (Accumulate, Trim, Exit)
PRIME Entry Signal
Strong Buy / Sell signals
Quality Gate failures
Quality Accumulation Setup


Best Used On
US stocks with fundamental data available. Technical features work on all symbols.

Settings
Fully customizable:

Toggle each metric category
Adjust quality gate thresholds
Choose zone calculation method
Configure RSI/volume parameters
Position bar and panel anywhere
Notes de version
### What It Does

A comprehensive analysis bar combining fundamental metrics with technical signals, designed for long-term investors who prioritize quality over momentum.

**Core Principle**: Quality Gates determine buy/avoid. EMA 200 is a sizing enhancer — not a buy signal.

```
Quality Gates Pass → BUY
├── Below 200 EMA → Scale UP (enhanced opportunity)
└── Above 200 EMA → Normal size (still a buy)

Quality Gates Fail → AVOID (EMA irrelevant)
```

---

### Tier 1 Bar Metrics
• **Margins**: GM, OM, NIM, FCF Margin
• **Returns**: ROCE, ROE
• **Growth**: Revenue YoY, EPS YoY
• **Valuation**: PE TTM, Forward PE, PEG
• **Zone**: Accumulate / Hold / Trim / Exit
• **Signal**: PRIME / BUY+ / BUY / AVOID / TRIM / NEUTRAL
• **Performance**: 1W to 1Y returns

---

### Two Strategy Modes

**Opportunity Enhancement** (Default)
Gates = Direction, EMA = Sizing. Quality companies are buyable above or below 200 EMA — you just size differently.

| Setup | Signal | Action |
|-------|--------|--------|
| Gates Pass + Below EMA | BUY+ / PRIME | Scale UP |
| Gates Pass + Above EMA | BUY | Normal size |
| Gates Fail | AVOID ⛔ | Don't buy |

**Trend Follower**
Traditional momentum approach. Prefers entries above 200 EMA.

---

### Quality Gates System

Four fundamental checkpoints — gates determine if you buy, not EMA:
• Gross Margin ≥ 40%
• ROCE ≥ 15%
• Debt/Equity ≤ 50%
• SBC/Revenue ≤ 15%

Gates Pass = Proceed. Gates Fail = AVOID regardless of technicals.

---

### Zone System

Three calculation methods:
• **52W Range**: Accumulate in bottom 25%, Trim in top 25%
• **Manual Levels**: Set your own price targets
• **ATR-Based**: Dynamic zones from EMA ± ATR

---

### Signal Hierarchy (Opportunity Enhancement Mode)

| Signal | Meaning | Sizing |
|--------|---------|--------|
| PRIME 💎 | All gates + Below EMA + Accum Zone + RSI bounce | Maximum conviction |
| BUY+ 🔼 | All gates + Below EMA + RSI bounce | Enhanced (scale up) |
| BUY 🔼 | Quality OK + Above EMA + RSI bounce | Normal |
| BUY? ↗ | Quality OK + RSI bounce | Smaller position |
| ACCUM+ 🎯 | In zone + Quality + Below EMA | Watch for trigger |
| WAIT+ ⏳ | Oversold + Quality + Below EMA | Setup forming |
| AVOID ⛔ | Gates failing | Do not buy |
| TRIM 📤 | Overbought in Trim/Exit zone | Take profits |

---

### Key Insight

A quality company above its 200 EMA is still buyable — you just don't get the discount. Don't wait forever for a pullback that may never come.

---

### Alerts Included

• PRIME Entry Signal
• Enhanced Buy (BUY+) - Scale UP
• Normal Buy - Standard size
• AVOID - Gates Failing
• Trim Signal
• Zone transitions

---

### Best Used On

US stocks with fundamental data available. Technical features work on all symbols.

---

### Settings

Fully customizable:
• Toggle each metric category
• Adjust quality gate thresholds
• Choose zone calculation method
• Configure RSI/volume parameters
• Adjustable text size (Tiny/Small/Normal/Large)

---

**Note**: For educational purposes only. Not financial advice.
Notes de version
# Investment Analysis Bar v2.1

**A quantitative indicator for long-term investors that answers: Should I buy? And how much?**

## What It Does

Displays in a **separate pane** (like RSI/MACD) with three components:

1. **Entry Quality Score Line** (0-10) - Real-time entry timing quality
2. **Metrics Bar** - Fundamentals, valuation, zone, signal at a glance
3. **Detail Panel** - Entry score breakdown, zone prices, decision output

## The Framework

**Quality Gates** → Determines IF you should buy
- Gross Margin ≥40%, ROCE ≥15%, D/E ≤50%, SBC ≤15%
- Gates fail = AVOID regardless of price

**Entry Quality Score** → Determines WHEN and HOW MUCH
- 5 weighted components: EMA50 position (30%), RSI (25%), MACD (20%), % from high (15%), Volume (10%)
- Score 8+ = BUY 100% | Score 6.5-8 = BUY 75% | Score 5-6.5 = BUY 50% | Score <5 = WAIT

## Key Signals

| Signal | Meaning |
|--------|---------|
| 🟢 BUY 100% | Gates pass + Excellent entry |
| 🟢 BUY 75% | Gates pass + Good entry |
| 🟡 BUY 50% | Gates pass + Fair entry |
| ⏳ WAIT | Gates pass but poor entry timing |
| ⛔ AVOID | Gates failing |
| 📤 TRIM | Overbought in upper zone |

## Features

- **Auto-fetched fundamentals**: Margins, ROCE, ROE, D/E, SBC, P/E, PEG
- **Zone system**: Accumulate/Hold/Trim/Exit with exact price levels
- **Performance tracking**: 1W, 1M, 3M, 6M, 1Y returns
- **Two modes**: Opportunity Enhancement (default) or Trend Follower
- **Configurable**: All thresholds, display options, positions adjustable

## How to Read

1. **Entry Score line green (8+)** + **Gates passing** = Good time to buy
2. **Entry Score line yellow/red** = Wait for better entry
3. **Gates failing** = Don't buy at any price
4. Check Detail Panel for exact position size recommendation

## Best For

- Long-term investors using fundamental analysis
- Position sizing based on entry quality
- Quality-first, timing-second approach

## Notes

- Works best on US stocks with financial data
- Displays in separate pane to avoid chart clutter
- Signal markers (optional) only appear on RSI bounce triggers

---

*Built based on my Investment Analysis Framework - Margin-first evaluation with quantitative entry timing.*

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.