pandas-ta icon indicating copy to clipboard operation
pandas-ta copied to clipboard

Arms Index (TRIN)

Open reza1615 opened this issue 3 years ago • 8 comments

Hi, Would you please add Arms Index (TRIN) as an indicator?

reza1615 avatar Sep 01 '21 18:09 reza1615

@reza1615,

Sure. Currently I do not have implementation time. So hopefully someone is willing to help making a PR and contribute.

Kind Regards, KJ

twopirllc avatar Sep 02 '21 03:09 twopirllc

Hi @twopirllc , can I take up this issue. @reza1615, could you just tell me under which category Arms Index (TRIN) indicator comes? image

ramgarg102 avatar Sep 02 '21 10:09 ramgarg102

I couldn't find its category. Base on the definition page. it is a overal market sentiment. In my opinion it should be under performance or momentum like rsi it shows overbought

reza1615 avatar Sep 02 '21 11:09 reza1615

Hello @reza1615 and @ramgarg102,

Base on the definition page. it is a overal market sentiment.

After double checking trin, it is classified as a Market Sentiment or Comparative Analysis indicator just like the Price Relative Indicator in Issue #161. It is more of "macro" indicator that utilizes two or more symbols/tickers and thus can not be included as a DataFrame Extension indicator like all the others df.ta.sma(), df.ta.sma(), et al. All the normal categorical indicators work for a single DataFrame ticker/symbol.

However I am not opposed to including trin and #161. They will need their own Category likely named comparative. Also, it should be noted that it is the user's responsibility to manually pd.concat the results on their own if needed.

Thoughts?

KJ

twopirllc avatar Sep 02 '21 17:09 twopirllc

Hello @twopirllc

Why would the users need to manually use pd.concat() if they can use (suppose we add Trin) df.ta.trin(append=True)?

Does Trin being dependent on other indicators has something to do with it?

ramgarg102 avatar Sep 02 '21 18:09 ramgarg102

@ramgarg102

Does Trin being dependent on other indicators has something to do with it?

No.

Why would the users need to manually use pd.concat() if they can use (suppose we add Trin) df.ta.trin(append=True)?

Well a Pandas TA DataFrame is meant to represent a single ticker/symbol whereas trin depends on a basket of symbols as I described in my previous comment. TRIN typically aggregates all 500 symbols of the S&P 500 index or 50 for the Nifty 50, as detailed in the Quantinsti python code.

So in my mind it makes sense to exclude as a DataFrame Extension method. But if it were included as a DataFrame Extension method df.ta.trin(append=True) it will need to be excluded from df.ta.strategy() (but that's a simple fix).

KJ

twopirllc avatar Sep 02 '21 19:09 twopirllc

So, finally what to do?

ramgarg102 avatar Sep 02 '21 20:09 ramgarg102

@ramgarg102,

Either implement it, wait for it to be implemented, or implement in your own forked repo. Up to you.

KJ

twopirllc avatar Sep 02 '21 21:09 twopirllc