Read the customer indicator value
-
I'm a newbie to Backtrader and just developed my first custom indicator (I mainly follow the samples at https://community.backtrader.com/topic/2145/full-example-of-custom-indicator/5)
However, when I try to compare indicator values, e.g. lazy is my custom indicator, and I try to compare the values of itself one units ago, i.e.
self.lazy(-1)>self.lazy(0)
I got the following error message:
bool should return bool, returned LineOwnOperation
I know the custom indicator is actually a line object. How can I get the value of it?
-
I think you are using wrong brackets. Have a look at delayed indexing. If you are doing this in next section use square brackets. Its all guess as information given is no enough to debug.
-
Thank you, rajanprabu. You're right, I'm using a wrong bracket...