INVITE-ONLY SCRIPT

TEZ COMMUNITY TESTPHASE

27
# TEZ COMMUNITY TESTPHASE

## Overview

TEZ is a trend-following indicator based on Moving Average crossovers with advanced filtering mechanisms. It generates BUY/SELL signals when fast and slow MAs cross, but only after validating the signal against multiple filters to reduce false entries.

**Key Features:**
- MA Cross signals with swing validation
- Magnet Zone logic for optimal entry timing
- Re-entry system after stop-loss
- Built-in backtesting with PnL tracking
- Multiple trend filters (Big Trend + Local Trend)

---

## How It Works

### Signal Generation
1. **Cross Detection:** Fast MA crosses Slow MA
2. **Swing Validation:** Price must be near a swing high/low
3. **Trend Filter:** Signal direction should align with trend (configurable)
4. **Entry Mode:** Based on distance to Trend MA, the indicator chooses:
- **SOFORT (Immediate):** Far from trend → Enter immediately
- **ATTENTION:** In magnet zone → Wait for confirmation candle
- **WAIT_FOR_TREND:** Outside magnet zone → Wait for price to return to trend

### Entry Modes Explained

| Mode | Distance to Trend MA | Entry Timing |
|------|---------------------|--------------|
| SOFORT | > Swing Distance % | Next candle at Open |
| ATTENTION | ≤ Magnet Zone % | After confirmation in zone |
| WAIT_FOR_TREND | Between Magnet & Swing | When price returns to zone |

---

## Settings Guide

### 📊 Signal MAs (Fast/Slow MA)

| Setting | Default | Description |
|---------|---------|-------------|
| **Source** | Close | Price source for MA calculation |
| **Fast MA Type** | HMA | Type of fast moving average (SMA/EMA/WMA/HMA) |
| **Fast MA Length** | 20 | Period for fast MA |
| **Slow MA Type** | HMA | Type of slow moving average |
| **Slow MA Length** | 50 | Period for slow MA |

**Tip:** HMA (Hull MA) is recommended for faster response with less lag.

---

### 📈 Swing / Movement

| Setting | Default | Description |
|---------|---------|-------------|
| **Swing Lookback (Bars)** | 20 | How many bars to look back for swing high/low |
| **Swing Threshold %** | 0.0 | Minimum % distance from swing to validate signal |
| **Max Bars Beyond Threshold** | 5 | Max bars price can stay beyond threshold before signal invalidates |
| **Min Move % before TP** | 1.0 | Minimum favorable move before take-profit activates |
| **Stop-Loss Active** | true | Enable/disable stop-loss |

---

### 🧲 Entry Mode Settings

| Setting | Default | Description |
|---------|---------|-------------|
| **Magnet Zone %** | 0.5 | Zone around Trend MA considered "at trend" |
| **Max SL %** | 0.5 | Maximum stop-loss distance from entry |
| **Swing Distance %** | 2.0 | Distance from Trend MA to classify as "swing" (far from trend) |

**How Entry Modes Work:**

```
Price Distance from Trend MA:
├── > 2.0% (Swing Distance) → SOFORT (immediate entry)
├── 0.5% - 2.0% → WAIT_FOR_TREND
└── ≤ 0.5% (Magnet Zone) → ATTENTION (wait for confirmation)
```

---

### 🚫 Range Filter

| Setting | Default | Description |
|---------|---------|-------------|
| **Min Swing Distance % (Range Filter)** | 0.5 | Minimum swing size to avoid ranging markets |

**Purpose:** Filters out signals when swing highs and lows are too close together (sideways/ranging market).

---

### 💰 Backtest Parameters

| Setting | Default | Description |
|---------|---------|-------------|
| **Start Capital** | 2000 | Initial capital for PnL calculation |
| **Fee per Trade (%)** | 0.05 | Round-trip trading fee |
| **Slippage per Entry/Exit (%)** | 0.0 | Simulated slippage |

---

### 🎨 Display & Colors

| Setting | Default | Description |
|---------|---------|-------------|
| **Show Labels** | true | Display BUY/SELL/TP/SL labels |
| **Show Signal MAs** | true | Display Fast & Slow MA lines |
| **Show Trend MA** | true | Display the big Trend MA |
| **Color Potential Cross Candles** | true | Highlight candles where cross might occur |
| **Potential Bars after Far Swing** | 3 | Bars to show potential entry after swing signal |

**Candle Colors:**
- 🟢 **Green:** BUY signal / Confirmed BUY
- 🔴 **Red:** SELL signal / Confirmed SELL
- 🟡 **Yellow:** EXIT (counter-cross)
- 🟣 **Purple:** Invalidation
- 🟠 **Orange:** RANGE (filtered out)
- ⚪ **Silver:** Far from swing (potential)

---

### 🔄 Flip Behavior

| Setting | Default | Description |
|---------|---------|-------------|
| **Allow Flip after EXIT** | false | Allow immediate reversal after exit |
| **Flip only from next candle** | true | If flip allowed, wait for next candle |

---

### ⚠️ Invalidation Guard

| Setting | Default | Description |
|---------|---------|-------------|
| **Entry Invalidation by MA Order** | true | Cancel entry if MAs cross back |
| **Protection Duration (Bars)** | 1 | Bars after entry where invalidation is blocked |
| **Show Invalidation** | true | Display purple INV markers |

---

### 📊 Trend Settings (Big Trend MA)

| Setting | Default | Description |
|---------|---------|-------------|
| **Use Trend Info** | true | Enable trend filtering |
| **Trend MA Type** | HMA | Type of trend MA |
| **Trend MA Length** | 100 | Period for trend MA |
| **Trend Lookback for Angle** | 2 | Bars to calculate trend angle |
| **Trend Angle Threshold (Deg)** | 15.0 | Minimum angle to classify as trending |

**Trend Filter Modes:**
- **Off:** No trend filtering
- **Strict:** Only allow signals in trend direction
- **Smart:** Allow counter-trend near reversals

---

### 📈 Local Trend Settings

| Setting | Default | Description |
|---------|---------|-------------|
| **Local Trend MA Type** | HMA | Type of local trend MA |
| **Local Trend MA Length** | 30 | Shorter period for local trend |
| **Local Trend Angle Threshold** | 5.0 | Lower threshold for local trend |
| **Show Local Trend MA** | true | Display local trend line |

---

### 📉 Trend Visualization

| Setting | Default | Description |
|---------|---------|-------------|
| **Show Trend Background** | true | Color background based on trend |
| **BG Uptrend** | Light Green | Background color in uptrend |
| **BG Downtrend** | Light Red | Background color in downtrend |

---

### 📊 Stats Panel

| Setting | Default | Description |
|---------|---------|-------------|
| **Stats Lookback (Bars)** | 2190 | Bars for statistics calculation (~6 months on 4H) |
| **Max Confirmation Candles** | 5 | Max candles to wait for confirmation in magnet zone |

---

## Signal Labels

| Label | Meaning |
|-------|---------|
| **BUY** | Long entry signal |
| **SELL** | Short entry signal |
| **BUY WAIT** | Waiting for confirmation (long) |
| **SELL WAIT** | Waiting for confirmation (short) |
| **REBUY WAIT** | Re-entry preparation (long) |
| **RESELL WAIT** | Re-entry preparation (short) |
| **REBUY** | Re-entry after SL (long) |
| **RESELL** | Re-entry after SL (short) |
| **TP** | Take-profit reached |
| **SL** | Stop-loss hit |
| **EXIT** | Exit by counter-cross |
| **INV** | Invalidated signal |
| **RANGE** | Filtered (ranging market) |
| **X** | Against trend |

---

## Stats Panel (Bottom Right)

| Stat | Description |
|------|-------------|
| **Trades (Window)** | Number of trades in lookback period |
| **Win Rate %** | Percentage of winning trades |
| **Total PnL %** | Cumulative profit/loss |
| **End Capital** | Final capital after all trades |
| **Last Signal** | Most recent signal type |
| **Trend (Big)** | Current big trend direction + angle |
| **LocalTrend (Deg)** | Current local trend angle |

---

## Recommended Settings by Timeframe

### 4H (Default)
- Fast MA: 20, Slow MA: 50, Trend MA: 100
- Magnet Zone: 0.5%, Swing Distance: 2.0%
- Stats Lookback: 2190 bars

### 1H
- Fast MA: 20, Slow MA: 50, Trend MA: 100
- Magnet Zone: 0.3%, Swing Distance: 1.5%
- Stats Lookback: 4380 bars

### Daily
- Fast MA: 10, Slow MA: 25, Trend MA: 50
- Magnet Zone: 1.0%, Swing Distance: 3.0%
- Stats Lookback: 365 bars

---

## Alerts Available

- BUY / SELL
- REBUY WAIT / RESELL WAIT (preparation alert)
- REBUY / RESELL
- SL / TP HIT / EXIT
- CROSS BUY live / CROSS SELL live

---

## Important Notes

⚠️ **This indicator is for educational purposes only. Always do your own research and manage your risk appropriately.**

- Past performance does not guarantee future results
- Backtest results may differ from live trading
- Always use proper position sizing and risk management
- Test on demo account before live trading

---

## Version

**TEZ COMMUNITY TESTPHASE**
Based on TEZ TRUE INDICATOR v20.4

Created by TEZ

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.