Prices

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 indicators
ta.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:

$BTC.open
$BTC.open[1]  // Previous open

Examples:

// 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

Use Cases:

  • Candlestick pattern analysis

  • Gap detection

  • Intraday momentum analysis


high

The highest price reached during each candle period.

Syntax:

$BTC.high
$BTC.high[1]  // Previous high

Examples:

// 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)

Use Cases:

  • Candlestick pattern recognition

  • Volatility calculations


low

The lowest price reached during each candle period.

Syntax:

$BTC.low
$BTC.low[1]  // Previous low

Examples:

// 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

Use Cases:

  • Breakdown detection with precise levels

  • Risk management (stop loss placement below key support)


volume

The trading volume during each candle period.

Syntax:

$BTC.volume
$BTC.volume[1]  // Previous volume

Examples:

// Current volume
$BTC.volume

// Volume surge detection
$BTC.volume > ta.sma($BTC.volume, 20) * 2

// Volume confirmation
$BTC.close > $BTC.open and $BTC.volume > $BTC.volume[1]

// Volume-based indicators
ta.vwap($BTC)
ta.obv($BTC)

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:

$BTC.hlc3
$BTC.hlc3[1]  // Previous HLC3

Examples:

// 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)

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:

$BTC.hl2
$BTC.hl2[1]  // Previous HL2

Examples:

// 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

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:

$BTC.hlcc4
$BTC.hlcc4[1]  // Previous HLCC4

Examples:

// 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)

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.

Formula: (open + high + low + close) / 4

Syntax:

$BTC.ohlc4
$BTC.ohlc4[1]  // Previous OHLC4

Examples:

// Current true average price
$BTC.ohlc4

// Balanced price analysis
$BTC.close > $BTC.ohlc4 * 1.01

// Smoothed trend analysis
ta.sma($BTC.ohlc4, 20) > ta.sma($BTC.ohlc4, 50)

// Volatility normalization
($BTC.high - $BTC.low) / $BTC.ohlc4

Use Cases:

  • Most balanced price representation

  • Smooth trend analysis

  • Volatility-adjusted calculations

  • Comprehensive price averaging

Last updated

Was this helpful?