Store not only int values in Line object
-
I have an Indicator which is computed for a set of instruments. This set can contain from 1 to 10 instruments, so I want to assign Line object as a dict, where keys are names of these instruments and values are weights of each instrument in portfolio. At first I tried to dynamically create lines in Indicator, but found that it is impossible (https://community.backtrader.com/topic/294/add-lines-to-indicator). Now I do not know how to solve this problem, give me any hint please.
-
Store not only int values in Line object
"lines" do actually store
float
values and won't store anything else.@alexrozhnov said in Store not only int values in Line object:
At first I tried to dynamically create lines in Indicator,but found that it is impossible (https://community.backtrader.com/topic/294/add-lines-to-indicator)
You have probably misunderstood the discussion. See here:
@alexrozhnov said in Store not only int values in Line object:
Now I do not know how to solve this problem, give me any hint please
You don't provide much information to work with. But in any case it doesn't seem an Indicator may help you since from the brief description it doesn't seem like the Indicator will align to the timestamps of the data feed. But this is only an assumption.