Skip to content

input_modifier does not apply to sub_indicators #165

@powellnorma

Description

@powellnorma

Is this on purpose? Let's say I want to pass OHLCV to MACD.add, which I initialized with input_modifier=ValueExtractor.extract_close.

However, here the value gets added to the sub_indicators before the input_modifier got applied:

else:
for sub_indicator in self.sub_indicators:
sub_indicator.add(value)
if not isinstance(value, list):
value = [value]
for input_value in value:
if input_value is not None and self.input_modifier is not None:
input_value = self.input_modifier(input_value)
self.input_values.append(input_value)

My goal is to use the resampling logic for MACD, for this to work I think I have to pass OHLCV to Indicator.add.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions