For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/
Len and buflen with resample
-
I´m building my first strategy that uses the resample functions of cerebro. I´m writing out the length and the buflen of each data feed in the next function. When I dont do any resampling, the result is as expected: len increments in every next step while buflen remains constant.
However, when I resample my data feed from 1 minute to 60 minutes, then the output for len and buflen is the same (both incrementing with each next call).
I´m trying to figure out what I´m doing wrong... here is my code:def next(self): finalS=" " for i, d in enumerate(self.datas): dt, dn, dv, dl, db = self.datetime.datetime(), d._name, d.open[0], len(d), d.buflen() finalS=finalS+"|" + " {} {} {} {} {}".format(dt, dn, dv, dl, db) print(finalS)
And a snapshot of the output with one data feed:
And with resampling:
Thanks for the help! -
Resampled data cannot be preloaded, hence the difference.
-
Got it, thanks!