Skip to content

Multi-Portfolio Implementation #254

Answered by kernc
Sean-Ker asked this question in Q&A
Feb 19, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

If Backtest.run() method got a new parameter yielding=False (TBD), and this main backtest loop:

for i in range(start, len(self._data)):
# Prepare data and indicators for `next` call
data._set_length(i + 1)
for attr, indicator in indicator_attrs:
# Slice indicator on the last dimension (case of 2d indicator)
setattr(strategy, attr, indicator[..., :i + 1])
# Handle orders processing and broker stuff
try:
broker.next()
except _OutOfMoneyError:
break
# Next tick, a moment before bar close
strategy.next()

were on line 1166 continued with:

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Sean-Ker
Comment options

@Sean-Ker
Comment options

Answer selected by Sean-Ker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants