# LINT_CENTRED_WINDOW

A centred window reads bars after the one it is placed on.

## What happened

A rolling window with its centre on the current bar takes half of its values from later bars. In a backtest those bars exist already. In live trading they do not, so the two disagree.

## What to do

Use a trailing window, which ends on the current bar. [Repainting and look-ahead](https://oathra.dev//docs/concepts/repainting-and-look-ahead) explains the difference.

## Example

```text
strategy.py, line 22: A centred window reads bars after the one it is placed on. [LINT_CENTRED_WINDOW]
```

The wording of the message depends on your file, and the code does not. A warning does not stop the file from loading.
