Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 592f8c6

Browse files
committed
DOC: Futher warning that indicator lengths can affect results
Refs: d7eaa45 Fixes #1184
1 parent 5bcaee0 commit 592f8c6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

‎backtesting/backtesting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,13 @@ def I(self, # noqa: E743
119119
120120
def init():
121121
self.sma = self.I(ta.SMA, self.data.Close, self.n_sma)
122+
123+
.. warning::
124+
Rolling indicators may front-pad warm-up values with NaNs.
125+
In this case, the **backtest will only begin on the first bar when
126+
all declared indicators have non-NaN values** (e.g. bar 201 for a
127+
strategy that uses a 200-bar MA).
128+
This can affect results.
122129
"""
123130
def _format_name(name: str) -> str:
124131
return name.format(*map(_as_str, args),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /