# Other markets, bar sizes and bar types

> Higher timeframes, other symbols, Renko, Heikin Ashi and X-Ray bars.

Source: https://algobarsx.com/docs/other-data/

```algobarsx
h4 = bars(bars: higher_tf)
gold = bars(XAUUSD, bars: 15m)
gold_atr = atr(14, on: gold)
cov = data.coverage(EURUSD, bars: range(10))
spread_z = zscore(log(close_of(EURUSD) / close_of(GBPUSD)), 100)
first_hour = time_of_day between 08:00 and 09:00
recent_high = intrabar(1m).high.max()
```

- [`bars`](https://algobarsx.com/docs/ref-units/#ref-bars) reads another bar size, another symbol, or both. A higher bar's value appears only once its candle has closed, so a 5-minute rule cannot peek at a 4-hour bar early.
- [`intrabar`](https://algobarsx.com/docs/ref-fn-data/#ref-intrabar) reads the finer bars inside the current one. [`close_of`](https://algobarsx.com/docs/ref-fn-data/#ref-close-of) is a shortcut for another symbol's close.
- Many functions take `on:` to calculate on another set of bars, such as `atr(14, on: gold)`.
- [`data.coverage`](https://algobarsx.com/docs/ref-fn-data/#ref-data-coverage) tells a script how much data it actually has, and whether it is exact.

```algobarsx
coverage = data.coverage(EURUSD, bars: range(10))
enough_history = coverage.exact and coverage.bars >= 5000
```

## Several markets in one strategy

```algobarsx
strategy "EURUSD and GBPUSD Mean Reversion"
    markets: EURUSD, GBPUSD
    bars: 1h
    max_open: 2

input lookback = 200
input entry_z = 2.0
input exit_z = 0.5

eur = bars(EURUSD)
gbp = bars(GBPUSD)
hedge = beta(returns(eur.close), returns(gbp.close), lookback)
```

Full example: [EURUSD and GBPUSD Mean Reversion](https://algobarsx.com/docs/ex-05-pairs-mean-reversion/). Orders take `market:` to say which symbol they are for.

## Other bar types

The header's `bars:` accepts more than a time: [`renko`](https://algobarsx.com/docs/ref-fn-data/#ref-renko), [`heikin_ashi`](https://algobarsx.com/docs/ref-fn-data/#ref-heikin-ashi), [`range`](https://algobarsx.com/docs/ref-fn-data/#ref-range) and [`xray`](https://algobarsx.com/docs/ref-fn-data/#ref-xray).

```algobarsx
strategy "Renko Pullback"
    market: US500
    bars: renko(5)
```

```algobarsx
indicator "X-Ray Flow Bands"
    bars: xray(20)
```
