LINT_LAST_ROW_IN_COMPUTE

CompileSeen in: The editor

What happened

Inside compute() the last row is the final bar of the data, not the bar being decided. Reading it puts a value from the end of the history onto every earlier bar.

What to do

Work on the whole series, so each bar gets a value from itself and the bars before it.

Example

text
strategy.py, line 27: `close.iloc[-1]` reads the last bar of the whole history, which is later than most bars it decides on. [LINT_LAST_ROW_IN_COMPUTE]

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

Ask about this in the forum