Login Page - Create Account

Support Board


Date/Time: Sat, 22 Feb 2025 00:36:23 +0000



Post From: RSI DEMA

[2019-03-27 20:51:43]
REKT4K - Posts: 8
Good day.

I have a question on how to use/implement Double Exponential Moving Average with an RSI indicator.

I've looked at Sierra RSI source code from studies7.cpp, but this file does not contain the actual code of RSI calculation, so I just can't figure it out by myself, like I did on TradingView platform. Just as example, on TradingView the calculation looks like this:
 
src = close, len = input(14, minval=1, title="Length") 
a1 = ema(max(change(src), 0), len) 
b1 = ema(max(change(src), 0), len) 
up = 2 * a1 - b1 
c1 = ema(-min(change(src), 0), len) 
d1 = ema(-min(change(src), 0), len) 
down = 2 * c1 - d1 
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) 

But when I look at Sierra source code, I only see this in the calculation section:
 
sc.RSI(sc.BaseDataIn[InputData.GetInputDataIndex()], RSI, AvgType.GetMovAvgType(), RSILength.GetInt()); 

I may assume that calculation of "RSI", itself, is pre-defined server-side.

May I ask the developers to share the Sierra RSI calculation code used within the application? I will figure it out by myself on how to modify it to use the DEMA, it's just that I lack programming skills to write it from the scratch in a format that will be accepted by Sierra Chart.

Thx.