INVITE-ONLY SCRIPT

Trend Speed & ALMA vs VWAP Oscillator

17
# Trend Speed ALMA VWAP Oscillator (TSAV Osc)

## Overview

The **Trend Speed ALMA VWAP Oscillator** is a MACD-style oscillator that combines three powerful concepts: the Trend Speed Analyzer's dynamic EMA, ALMA (Arnaud Legoux Moving Average) bands, and Volume Weighted Average Price (VWAP). It measures trend strength and momentum relative to VWAP, providing clear visual signals for trend direction and potential reversals.

## Key Features

- **MACD-Style Display**: Familiar oscillator layout with lines, signal lines, and histogram
- **Multiple VWAP Types**: Session, Rolling (1-24 hours), and Weekly anchored VWAP
- **Dynamic Trend Analysis**: Adaptive EMA with acceleration factor from Trend Speed Analyzer
- **ALMA Band Integration**: Fast and slow ALMA for crossover signals
- **Chart Overlay**: Optional plots of Dynamic Trend, VWAP, and ALMA bands on price chart
- **VWAP Standard Deviation Bands**: +/- 1, 2, 3 standard deviation bands

## Indicator Components

### Oscillator Pane

| Component | Description |
|-----------|-------------|
| **Trend vs VWAP Line** | Distance between Dynamic Trend EMA and VWAP (blue) |
| **Trend Signal Line** | EMA of Trend vs VWAP for crossover signals (cyan) |
| **ALMA vs VWAP Line** | Distance between fast ALMA and VWAP (orange) |
| **ALMA Signal Line** | EMA of ALMA vs VWAP (yellow) |
| **Histogram** | Configurable: Trend Strength, Trend vs VWAP, or ALMA vs VWAP |
| **Zero Line** | White reference line at zero (VWAP level) |

### Chart Overlay (Optional)

| Component | Description |
|-----------|-------------|
| **Dynamic Trend** | Dotted line colored by histogram gradient |
| **VWAP** | Thick solid line, green above/red below trend |
| **VWAP Bands** | Standard deviation bands (+/- 1, 2, 3 std) |
| **ALMA Bands** | Fast and slow ALMA with optional fill |

### Signal Markers

| Signal | Shape | Meaning |
|--------|-------|---------|
| **Triangle Up** (green) | Bottom | Trend vs VWAP crossed above signal line |
| **Triangle Down** (red) | Top | Trend vs VWAP crossed below signal line |
| **X Cross** (green) | Zero line | Dynamic Trend crossed above VWAP |
| **X Cross** (red) | Zero line | Dynamic Trend crossed below VWAP |
| **Circle** (green) | Oscillator | ALMA bullish cross (configurable source) |
| **Circle** (red) | Oscillator | ALMA bearish cross (configurable source) |
| **Background Highlight** | Full bar | Ideal entry condition met |

## VWAP Types

### Session VWAP
Resets at a configurable anchor time (default 9:30 AM EST). Best for intraday trading with regular market hours.

### Rolling VWAP
Uses a moving window of 1, 2, 3, 4, 8, 12, or 24 hours. Best for continuous markets or when you want a shorter-term volume-weighted reference.

### Weekly VWAP
Resets at the start of each trading week using `timeframe.change("W")`. Works across all market types:
- **Stocks**: Resets Monday morning
- **Futures**: Resets at futures week open
- **Crypto**: Resets at calendar week start

## Settings Guide

### VWAP Settings
- **VWAP Type**: Session, Rolling, or Weekly
- **Anchor Time**: Reset time for Session VWAP (EST timezone)
- **Rolling Period**: Window size for Rolling VWAP
- **VWAP Source**: Price source for VWAP calculation (default: hlc3)

### Trend Speed Settings
- **Maximum Length**: Upper limit for dynamic moving average (default: 50)
- **Accelerator Multiplier**: Responsiveness to price changes (default: 5.0)
- **Speed Smoothing**: Hull MA period for speed smoothing (default: 5)

### ALMA Settings
- **ALMA 1 (Fast)**: Length, Offset, Sigma for fast ALMA
- **ALMA 2 (Slow)**: Length, Offset, Sigma for slow ALMA

### MACD Settings
- **Signal Line Length**: EMA period for signal lines (default: 9)

### Display Settings
- **Histogram Source**: Choose what the histogram displays
- **ALMA Cross Source**: "ALMA Bands" (ALMA1 vs ALMA2) or "Oscillator Signal" (vs signal line)
- **Show/Hide**: Toggle individual components

### Chart Overlay
- **Show Dynamic Trend**: Dotted trend line on chart
- **Show VWAP**: Thick VWAP line on chart
- **Show VWAP Std Dev Bands**: +/- 1, 2, 3 standard deviation bands
- **Show ALMA Bands**: ALMA1 and ALMA2 on chart
- **Show ALMA Fill**: Fill between ALMA bands

## Trading Guidelines

### Bullish Signals
1. Trend vs VWAP line crosses above signal line (triangle up)
2. Dynamic Trend crosses above zero/VWAP (green X)
3. ALMA bullish cross (green circle)
4. **Ideal Long**: All three align with positive histogram

### Bearish Signals
1. Trend vs VWAP line crosses below signal line (triangle down)
2. Dynamic Trend crosses below zero/VWAP (red X)
3. ALMA bearish cross (red circle)
4. **Ideal Short**: All three align with negative histogram

### Reading the Histogram
- **Bright Green**: Strong bullish momentum (trend accelerating up)
- **Light Green**: Weak bullish momentum (trend slowing)
- **Light Red**: Weak bearish momentum (trend slowing)
- **Bright Red**: Strong bearish momentum (trend accelerating down)

### VWAP as Support/Resistance
- Price above VWAP with positive oscillator = bullish bias
- Price below VWAP with negative oscillator = bearish bias
- Oscillator crossing zero = potential trend change at VWAP

## Installation

1. Copy the source code from `trend-speed-alma-vwap-oscillator.pine`
2. Open TradingView's Pine Editor
3. Paste the code and click "Add to Chart"
4. Configure settings based on your trading style

## Files Included

- `trend-speed-alma-vwap-oscillator.pine` - Main indicator implementation
- `README.md` - This documentation file

## Based On

- **Trend Speed Analyzer** by Zeiierman - Dynamic EMA and speed calculations
- **ALMA** (Arnaud Legoux Moving Average) - Built-in TradingView function
- **VWAP** - Volume Weighted Average Price with custom anchoring

## Disclaimer

Trading involves substantial risk of loss and is not suitable for all investors. Past performance is not indicative of future results. This indicator is for educational purposes only and should not be considered as investment advice.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.