# Data and bar types reference

> All 8 data and bar types in AlgoBarsX, each with its parameters, defaults, ranges and an example: bars, close_of, intrabar, data.coverage, range, xray, renko, heikin_ashi.

Source: https://algobarsx.com/docs/ref-fn-data/

### `bars(symbol = market.symbol, bars = bar.type)` → BarSet

Bars of another bar type or symbol. Higher-timeframe values change only when that bar confirms, so look-ahead is impossible.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `symbol` | symbol | `market.symbol` | Market to read. |
| `bars` | bartype | `bar.type` | Bar type to read. |

```algobarsx
h4 = bars(bars: 4h)
```

```algobarsx
gold = bars(XAUUSD, bars: 15m)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `close_of(symbol, bars = bar.type)` → series<price>

Close series of another symbol, aligned by bar close time.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `symbol` | symbol | required | Market to read. |
| `bars` | bartype | `bar.type` | Bar type to read. |

```algobarsx
ratio = close_of(EURUSD) / close_of(GBPUSD)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `intrabar(bars = 1m)` → list<Bar>

Lower-timeframe bars inside the current bar, as a list.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `bars` | bartype | `1m` | Lower bar type. |

```algobarsx
minute_bars = intrabar(1m)
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `data.coverage(symbol = market.symbol, bars = bar.type)` → Coverage

The stored date range for a symbol and bar type, and whether results on it are exact.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `symbol` | symbol | `market.symbol` | Market to check. |
| `bars` | bartype | `bar.type` | Bar type to check. |

#### Outputs, read with a dot

| Name | Type | What it is |
| --- | --- | --- |
| `from` | time | First available bar. |
| `to` | time | Last available bar. |
| `bars` | int | Number of bars. |
| `source` | string | "stored" or "built". |
| `exact` | bool | false when rebuilt from coarser data. |

```algobarsx
cov = data.coverage(EURUSD, bars: range(10))
```

Works in: strategy, indicator, alert. Since 1.0.

### `range(size = 10)` → bartype

Range bars of a fixed size; stored tick-built bars where they exist, otherwise built from candles.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `size` | number \| distance | `10` | Bar size; a bare number follows the chart convention for the symbol. |

```algobarsx
bars_r = bars(bars: range(10 pips))
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `xray(size = 10)` → bartype

Range bars built with the chart's x-ray algorithm.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `size` | number \| distance | `10` | Bar size. |

```algobarsx
bars_x = bars(bars: xray(10))
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `renko(size = 10)` → bartype

Renko bricks built with the chart's renko algorithm.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `size` | number \| distance | `10` | Brick size. |

```algobarsx
bars_k = bars(bars: renko(5 points))
```

Works in: strategy, indicator, alert, library. Since 1.0.

### `heikin_ashi(timeframe = 1h)` → bartype

Heikin-Ashi bars computed from time bars.

#### Parameters

| Name | Type | Default | What it is |
| --- | --- | --- | --- |
| `timeframe` | duration | `1h` | Underlying timeframe. |

```algobarsx
smooth_bars = bars(bars: heikin_ashi(1h))
```

Works in: strategy, indicator, alert, library. Since 1.0.
