ta-oliver / infertrade

Open source trading and investment strategy library designed for accessibility and compatibility
Apache License 2.0
34 stars 20 forks source link

ADD NEW TRADING RULE : RELATIVE STRENGTH INDEX (RSI) #146

Closed Cal231995 closed 3 years ago

Cal231995 commented 3 years ago

DESCRIPTION : RELATIVE STRENGTH INDEX

CONDITION/PARAMETER : GIVE A BUY SIGNAL WHEN RSI VALUE IS BELOW 30 VICE VERSA GIVE A SELL SIGNAL WHEN THE RSI VALUE IS ABOVE 70.

if RSI value < 30: position = max_investment

if RSI value > 70: position = -max_investment

quick link to RSI https://www.investopedia.com/terms/r/rsi.asp

RSI

Cal231995 commented 3 years ago

Hi @bi-kash @fhashim for our common reference. thanks

Cal231995 commented 3 years ago

rsi meaning Definition of RSI

Cal231995 commented 3 years ago

formula for rsi formula for rsi

fhashim commented 3 years ago

@Cal231995 can you confirm if the time period used to compute RSI is 14 days? thanks

ta-oliver commented 3 years ago

@Cal231995 can you confirm if the time period used to compute RSI is 14 days? thanks

You can see the rule (coded by @bi-kash ) here: https://github.com/ta-oliver/infertrade/blob/5f74bdeb99eb26c15df0b5417de837466cefaee1/infertrade/algos/community/allocations.py#L522

We should match the PDF documentation with the Python code (and vice-versa!).

Cal231995 commented 3 years ago

@Cal231995 can you confirm if the time period used to compute RSI is 14 days? thanks

yes , we used 14 as our default

Cal231995 commented 3 years ago

What Is the Relative Strength Index (RSI)? The Relative Strength Index (RSI), developed by J. Welles Wilder, is a momentum indicator that measures the speed and change of price movements. It is an extremely popular indicator that is used to indicate overbought and oversold signals. RSI is considered overbought when above 70 and oversold when below 30. RSI can also be used to identify the general trend of an asset. It can also be used for identifying bullish and bearish divergences.

@fhashim you can used this definition . This one's free of copyright issue. Thank you