Author

Topic: Trying to calculate rsi (Read 497 times)

full member
Activity: 252
Merit: 113
NFTs on Sale: https://bit.ly/2POlV17
January 06, 2017, 03:56:48 PM
#8
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?Huh

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 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
legendary
Activity: 3472
Merit: 10611
January 06, 2017, 12:25:16 AM
#7

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 Cheesy)

www.investopedia.com/terms/r/rsi.asp
https://en.wikipedia.org/wiki/Relative_strength_index
legendary
Activity: 1176
Merit: 1024
January 05, 2017, 05:40:39 PM
#6

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.
full member
Activity: 195
Merit: 100
January 05, 2017, 03:09:04 PM
#5

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)


legendary
Activity: 2996
Merit: 1188
January 05, 2017, 03:07:38 PM
#4
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 ?
hero member
Activity: 588
Merit: 500
January 05, 2017, 02:26:35 PM
#3
what is mean you can calculate RSI methode in metatrader 4
i think is easy use indicator
price is automatic without calculate
hero member
Activity: 1470
Merit: 655
January 05, 2017, 11:21:02 AM
#2
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
newbie
Activity: 5
Merit: 0
January 05, 2017, 10:19:04 AM
#1
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?Huh
Jump to: