OPEN-SOURCE SCRIPT

Trader Assistant

59
Description of the "Trader Assistant" indicator

Overview
- Trader Assistant is a comprehensive TradingView indicator (Pine Script v5) that combines volatility analysis (ATR), trading volume monitoring, and signal generation to support decision-making.

Core components

1) ATR (Average True Range) calculation
- Uses a custom daily ATR function [calcATR()](Trader-Assistant.pine:86)
- Daily timeframe enforcement via [request.security()](Trader-Assistant.pine:107), independent of the current chart timeframe
- Configurable ATR length (default 5 bars)

2) ATR exhaustion analysis
- From daily open: how much of the daily ATR the price has moved from the open, as a percentage: [atrPercent](Trader-Assistant.pine:156)
- From daily extremes: percentage of the daily high–low range covered: [traveledATR](Trader-Assistant.pine:159)

3) Trading signals
- Long signal (💪) when ATR exhaustion is below the long threshold (default 30%)
- Short signal (✋) when ATR exhaustion is above the short threshold (default 70%)
- Color coding: green for long, red for short

4) Risk management levels
- From daily Open:
- Maximum: [dailyOpen + ATR](Trader-Assistant.pine:166)
- Minimum: [dailyOpen - ATR](Trader-Assistant.pine:167)
- Stop-loss: percentage of daily ATR (default 10%)
- Take-profit: multiple of stop-loss (default 4x)
- Slippage: percentage of stop-loss (default 10%)
- From daily High/Low:
- Maximum: [dailyLow + ATR](Trader-Assistant.pine:162)
- Minimum: [dailyHigh - ATR](Trader-Assistant.pine:163)
- Intra-day granularity via 5-minute ATR: [ta.atr()](Trader-Assistant.pine:170) over 30 bars, with corresponding SL/TP/slippage derived from it

5) Volume analysis
- Daily notional volume is built by summing 24 hourly bars: [d1 + d2 + ... + d24](Trader-Assistant.pine:142)
- Human-friendly K/M/B formatting of numbers
- Liquidity filter: line turns red when volume is below the configurable threshold (default 30M)
- Optional display toggle

Visualization

Table content (bottom-left of the chart), three columns:
- Columns: label, “From Open”, “From High/Low”
- Rows:
- Today’s maximum with ATR: “From Open” vs “From Low”
- Stop-loss: daily ATR vs 5-minute ATR
- Take-profit: daily ATR vs 5-minute ATR
- Slippage: daily ATR vs 5-minute ATR
- Today’s minimum with ATR: “From Open” vs “From High”
- Day volume (optional): value and color-coded sufficiency
- ATR value
- ATR exhaustion: percentage with emoji signal in both columns

Display settings and color cues
- Adjustable font size (0–3)
- Blue for max/min rows
- Green/red for signal rows
- Red for insufficient volume

Configurable inputs

ATR:
- Number of bars for ATR
- Upper/lower deviation limits for outlier handling (as inputs)
- Stop-loss size (% of daily ATR)
- Take-profit multiplier
- Slippage as % of stop-loss

Signals:
- Long threshold (% ATR exhaustion)
- Short threshold (% ATR exhaustion)

Volume:
- Toggle display
- Average period and averaging type (inputs exist; not used in current calculations)
- Minimum day volume threshold (in millions)

Technical notes
- Multi-timeframe aggregation via [request.security()](Trader-Assistant.pine:107) for daily and 5-minute data
- Tick-accurate formatting with [fRound()](Trader-Assistant.pine:34) and [fFormat()](Trader-Assistant.pine:37)
- Direct hourly summation for daily volume for simplicity and clarity: [d1 + d2 + ... + d24](Trader-Assistant.pine:142)
- Table adapts the number of rows based on whether volume is shown

Intended use
- Intraday trading: identify entry timing based on daily ATR exhaustion
- Risk management: automatic SL/TP/slippage calculations
- Trade filtering: ensure sufficient liquidity before acting
- Volatility assessment: track current movement relative to average daily range

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。