Trady icon indicating copy to clipboard operation
Trady copied to clipboard

Add TSI (True Strength Index) to indicators?

Open Jiraiyah opened this issue 5 years ago • 3 comments

Hi TSI is a momentum based indicator on par with MACD, here is the wiki page for it

https://en.wikipedia.org/wiki/True_strength_index

the formula is not that complex, would you mind adding it to the indicator library?

Jiraiyah avatar Mar 03 '19 11:03 Jiraiyah

@lppkarl please, any chance for getting this?

Jiraiyah avatar Mar 17 '19 17:03 Jiraiyah

@Jiraiyah if it's that simple, could you do a pull request with some unit tests?

irperez avatar Mar 20 '19 05:03 irperez

@Jiraiyah if it's that simple, could you do a pull request with some unit tests?

honestly i would, problem is, either i have to do it using the extension method alone, or....

If i want to make it a base structure like that lppkarl done, i need to head dive into the whole structure of the repo to figure how the base indicator structure works.

in the first scenario,... it's really really really easy... but it would ask for 4-5 method calls and i'm not sure if it's performance friendly that way or not.

in the second scenario.... well,... no one would be able to do a good job on repositories as complex as these because of how they are structured.

for example, the extention method would be something like this (pseudo code):

1- get the list, calculate the difference of close between last candle with the previous one (c0 - c1), call it m

2- get m.ema(r).ema(s) <=== this is the top section of the equation ! lets call it ts1 3- get the abs value of m, call it abm, then abm.ema(r).ema(s) <=== this is the bottom section, let's call it ts2 4- tsi = 100 * ts1 / ts2

as you see.... it's not that complex if you are willing to call the ema method 4 times for one tsi calculation, how ever, without looking into the base structure, i'm not sure if there is a way to simplify this equation or not nor i'm sure if it really needs to go on a base structure or a simple extension method would be sufficient. after all, tsi is not that complex math if you had looked into the first post and the wiki link i sent !

the thing is that i know lppkarl is using an interface for type of lists that inherit from it. this would make the method much more useful that what even you can think. the close value of a candle on top section of post is JUST AN EXAMPLE ! (caps for emphasize). there will be many things that can get benefit from tsi formula.

If you put a tsi and macd side by side on the same chart with proper settings for both, you would be surprised to see that most of the time tsi signals at least a bar or two before macd without false signals that every now and then macd has !

another thing that I'm not sure if is possible or how to do... would be interesting if there was a possibility to use different averaging in the formula for each of the 4 ! i had done it in trading view's pine script, and oh god, lots of interesting results ! just switch one of those for with RMA and...... !!!!

Jiraiyah avatar Mar 20 '19 12:03 Jiraiyah