# IMPURE_COMPUTE

compute() reads the clock or uses randomness.

## What happened

`compute()` has to give the same signals every time it is run on the same bars. A call that reads the clock or makes random numbers inside it breaks that.

## What to do

Use the bar times in `d`, and do random work in a hook with `ctx.rng`.

## Example

```text
strategy.py, line 18: compute() must give the same signals every time: time.time() reads the clock or makes random numbers. Use the bar times in d, and do random work in a hook with ctx.rng. [IMPURE_COMPUTE]
```

The wording of the message depends on your file, and the code does not. An error stops the file from loading.
