-
AttributeError: 'FinLine' object has no attribute 'setPoints' I have a list of lines that I am using like this whenever I want to draw something because I know I will need to change them in the future, meaning I will have to access them:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
j.points = (old_p1, (old_p2[0]+1, old_p2[1])) |
Beta Was this translation helpful? Give feedback.
-
is there a way to use the absolute timestamp and not a real number of candles as the x tuple? it's messing with my other timeframes when i change, as there are more or less candles, hence the lines change place |
Beta Was this translation helpful? Give feedback.
Final answer, its closed now.
The function add_line ALWAYS transforms the raw date into ordinal/index time relative to the number of candles in the current chart.
Meaning one can CREATE lines with normal timestamp dates, but if one wants to update and not just eliminate and re-draw, one has to now use the following method to get their x coordinates for the line.points() update.
py = price where that line was innitially marked.
p1x, p2x = fplt._pdtime2index(ax, pd.Series([p1x, p2x])), where p1x can be for example the old p1x and p2x might be the new extended p2x.
old_line.points = ((p1x, py), (p2x, py))