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:

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.

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

Syntax:

Examples:

Use Cases:

  • Most balanced price representation

  • Smooth trend analysis

  • Volatility-adjusted calculations

  • Comprehensive price averaging

Last updated

Was this helpful?