Version of AutoTrader being used
eg. Using version 0.7.10
Additional context
Error occurs on line 405 in indicators.py:
grad = [swing_data[i] - swing_data[i-1] for i in range(len(swing_data))]
This seems to me like it would always throw an error, because the first iteration will have i==0 and so i-1 will equal -1, which is expected to error.
I would personally write this like:
grad = [swing_data[i] - swing_data[i-1] for i in range(1, len(swing_data))]
this however makes the output shorter by 1 item.
Describe the bug
KeyError: -1
when running code below.To Reproduce
Version of AutoTrader being used eg. Using version
0.7.10
Additional context Error occurs on line 405 in indicators.py:
grad = [swing_data[i] - swing_data[i-1] for i in range(len(swing_data))]
This seems to me like it would always throw an error, because the first iteration will have i==0 and so
i-1
will equal-1
, which is expected to error. I would personally write this like:grad = [swing_data[i] - swing_data[i-1] for i in range(1, len(swing_data))]
this however makes the output shorter by 1 item.