Replies: 1 comment 5 replies
-
|
Generally, you shouldn't overwrite instance variables in vectorbt because this may cause side effects (e.g. in caching). That's why most attributes are read-only properties. You can extend any indicator by subclassing it. But as soon as you need to integrate another parameter, you would need to create a new indicator. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using the
IndicatorFactory'sfrom_pandas_tamethod to get an instance of the TSI indicator (https://github.com/twopirllc/pandas-ta/blob/main/pandas_ta/momentum/tsi.py).And so far I've got
Accounting for the the implementation of TSI in
pandas_ta, the only output data I get istsi.tsi. However, I want to generate signals based on the crossover of a signal (EMA of TSI) and that of the TSI. I've been racking my brains on how to create something liketsi.signalswithout too much rewriting. That way, I assume I would be able to do something likeentries = tsi.tsi_above(tsi.signals, crossover = True).@polakowo how can I add a new attribute to my
tsiIndicatorFactoryinstance (if it is possible)?I've also realised that I can't modify
tsi.tsi- is it meant to like a frozen attribute?Beta Was this translation helpful? Give feedback.
All reactions