Bitcoin Forum

Economy => Trading Discussion => Topic started by: tpottel on January 05, 2017, 02:19:04 PM



Title: Trying to calculate rsi
Post by: tpottel on January 05, 2017, 02:19:04 PM
Hi
I'm trying to calculate the rsi on historical bitcoin data and chart it out
I wrote the code myself, I have the issue what do I do if the averg loss is zero so I have

rs=averg gain/0, whith is infinty????


Title: Re: Trying to calculate rsi
Post by: Red-Apple on January 05, 2017, 03:21:02 PM
i am not an expert on these things and learning myself but these are my thoughts:
first of all the RS is calculated during a 14 trading days, so how can it be zero?
also the RSI that you calculate is a relative value between 0 and 100, meaning you can give it 100 if you like. many ignore extreme numbers even above 80.

good to read: http://cns.bu.edu/~gsc/CN710/fincast/Technical%20_indicators/Relative%20Strength%20Index%20%28RSI%29.htm


Title: Re: Trying to calculate rsi
Post by: thebatletbet on January 05, 2017, 06:26:35 PM
what is mean you can calculate RSI methode in metatrader 4
i think is easy use indicator
price is automatic without calculate


Title: Re: Trying to calculate rsi
Post by: beerlover on January 05, 2017, 07:07:38 PM
if the averg loss is zero
If your average loss is zero means you are in profit, theoretically no trading is possible without the event of some losses.
RSI means relative strength index or something else ?


Title: Re: Trying to calculate rsi
Post by: vk279 on January 05, 2017, 07:09:04 PM

Average Gain and Average loss are not true Averages.
When Ave Gain > Ave Loss, RS will be greater than 1.
When Ave Gain < Ave Loss, RS will be less than 1
So indicator always oscillates between 0 and 100.
If ave loss becomes zero, RSI becomes 100 by definition.
If ave gain equals zero, RSI is set to 0(by definition)




Title: Re: Trying to calculate rsi
Post by: rickadone on January 05, 2017, 09:40:39 PM

Average Gain and Average loss are not true Averages.
When Ave Gain > Ave Loss, RS will be greater than 1.
When Ave Gain < Ave Loss, RS will be less than 1
So indicator always oscillates between 0 and 100.
If ave loss becomes zero, RSI becomes 100 by definition.
If ave gain equals zero, RSI is set to 0(by definition)
Any link for this definitions would be more helpful to OP. Honestly I do not have any idea what you people are discussing here, still I understand it is about some trading tool and OP is trying to formulate it by his own coding.

I am too looking for URLs for learning it, please add if possible.


Title: Re: Trying to calculate rsi
Post by: pooya87 on January 06, 2017, 04:25:16 AM

Average Gain and Average loss are not true Averages.
When Ave Gain > Ave Loss, RS will be greater than 1.
When Ave Gain < Ave Loss, RS will be less than 1
So indicator always oscillates between 0 and 100.
If ave loss becomes zero, RSI becomes 100 by definition.
If ave gain equals zero, RSI is set to 0(by definition)
Any link for this definitions would be more helpful to OP. Honestly I do not have any idea what you people are discussing here, still I understand it is about some trading tool and OP is trying to formulate it by his own coding.

I am too looking for URLs for learning it, please add if possible.

there is one in the second post, you can also use google! to find more information about what RSI stands for and what it means. change the keywords below to whatever you like.
http://lmgtfy.com/?iie=1&q=trading+RSI+definition (i like the new lmgtfy site look :D)

www.investopedia.com/terms/r/rsi.asp
https://en.wikipedia.org/wiki/Relative_strength_index


Title: Re: Trying to calculate rsi
Post by: trigger1975 on January 06, 2017, 07:56:48 PM
Hi
I'm trying to calculate the rsi on historical bitcoin data and chart it out
I wrote the code myself, I have the issue what do I do if the averg loss is zero so I have

rs=averg gain/0, whith is infinty????

I know, this does not answer your question.

But, beside the learning effect for doing so, why don't you use a tool like ta-lib (http://ta-lib.org/) for this?  ta-lib supports tremendous amount of signals, indicators, trend indicator and even candle stick patterns.  There are lib implementations for nearly every language like NodeJS, Java, C++, C#, Python, etc.

Hope that helps,
alex