This section documents the price ($coin.*) functions.
close
The closing price of each candle period.
Syntax:
$BTC.close$BTC.close[1] // Previous close
Examples:
// Current closing price$BTC.close// Price comparison$BTC.close>$BTC.close[1]// Percentage change($BTC.close-$BTC.close[1]) /$BTC.close[1] *100// Use in indicatorsta.sma($BTC.close,20)
Use Cases:
Most common price reference for technical analysis
Default source for most indicators (RSI, SMA, EMA, etc.)
Trend analysis and price comparisons
open
The opening price of each candle period.
Syntax:
Examples:
Use Cases:
Candlestick pattern analysis
Gap detection
Intraday momentum analysis
high
The highest price reached during each candle period.
Syntax:
Examples:
Use Cases:
Candlestick pattern recognition
Volatility calculations
low
The lowest price reached during each candle period.
Syntax:
Examples:
Use Cases:
Breakdown detection with precise levels
Risk management (stop loss placement below key support)
volume
The trading volume during each candle period.
Syntax:
Examples:
Use Cases:
Volume analysis and confirmation
Volume-weighted indicators
Market participation assessment
hlc3
Typical Price - Average of high, low, and close prices.
Formula:(high + low + close) / 3
Syntax:
Examples:
Use Cases:
More balanced price representation than close alone
Reduces noise in price analysis
Alternative data source for indicators
Central tendency analysis
hl2
Median Price - Average of high and low prices.
Formula:(high + low) / 2
Syntax:
Examples:
Use Cases:
Support/resistance level calculations
Noise reduction in volatile markets
Alternative price source for smoother indicators
hlcc4
Weighted Close Price - Average of high, low, and two closes.
Formula:(high + low + close + close) / 4
Syntax:
Examples:
Use Cases:
Emphasizes closing price importance
Smoother price series than close alone
Trend analysis with close bias
Reduced whipsaw in indicators
ohlc4
True Average Price - Average of open, high, low, and close.
// Current opening price
$BTC.open
// Bullish/bearish candle detection
$BTC.close > $BTC.open // Bullish candle
// Gap analysis
$BTC.open > $BTC.close[1] * 1.02 // Gap up
// Intraday range
$BTC.high - $BTC.open
$BTC.high
$BTC.high[1] // Previous high
// Current high price
$BTC.high
// Highest value in last 20 candles
ta.highest($BTC.high, 20)
// Upper wick analysis
$BTC.high - math.max($BTC.open, $BTC.close)
$BTC.low
$BTC.low[1] // Previous low
// Current low price
$BTC.low
// Lowest value in recent 20 candles
ta.lowest($BTC.low, 20)
// Lower wick analysis
math.min($BTC.open, $BTC.close) - $BTC.low
// Current typical price
$BTC.hlc3
// Typical price trend
$BTC.hlc3 > $BTC.hlc3[1]
// Use as indicator source
ta.sma($BTC.hlc3, 20)
ta.rsi($BTC.hlc3, 14)
// Price deviation from typical
math.abs($BTC.close - $BTC.hlc3)
$BTC.hl2
$BTC.hl2[1] // Previous HL2
// Current median price
$BTC.hl2
// Median price momentum
$BTC.hl2 > ta.sma($BTC.hl2, 10)
// Range midpoint analysis
$BTC.close > $BTC.hl2 // Close above range midpoint
$BTC.hlcc4
$BTC.hlcc4[1] // Previous HLCC4
// Current weighted close price
$BTC.hlcc4
// Weighted price trend
$BTC.hlcc4 > $BTC.hlcc4[5]
// Close-weighted analysis
$BTC.close > $BTC.hlcc4 // Close stronger than weighted average
// Indicator smoothing
ta.ema($BTC.hlcc4, 21)