Replies: 1 comment 1 reply
-
The array from beginning and to the point reached at Hopefully, you can make use of these: >>> from backtesting import Backtest, Strategy
... from backtesting.test import GOOG
...
... class S(Strategy):
... def init(self): pass
... def next(self): print(self.data.Close.size)
...
... Backtest(GOOG.iloc[:5], S).run()
2
3
4
5
... backtesting.py/backtesting/backtesting.py Lines 1147 to 1161 in 1ee5670 This, of course, only works for |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to evaluate a range of values created in a custom df column during Next()
when using the below example, am I looking at the entire array (very last Five values) or the array from the point reached at Next()
a[-5:] # last Five items
I seem to be getting unexpected behavior. My assumption is last Five from current Next() line?
Beta Was this translation helpful? Give feedback.
All reactions