RSI Identificator

All generic stuff
Post Reply
ABC
Posts: 127
Joined: 16 Jul 2019, 16:21

RSI Identificator

Post by ABC » 26 Jul 2019, 16:32

Welche Methode wird für RSI Berechnung benutzt? SMA? Verstehe nicht wocher der Unterschied kommt....
Attachments
RSI_Properties.jpg
RSI_Properties.jpg (250.14 KiB) Viewed 8247 times
RSI.jpg
RSI.jpg (212.8 KiB) Viewed 8247 times

Christian
Site Admin
Posts: 137
Joined: 13 Jul 2019, 13:36

Re: RSI Identificator

Post by Christian » 27 Jul 2019, 22:01

Hier der Code

Code: Select all

void CRelativeStrengthIndex::OnBarUpdate()
{
	float fRSI, fSumUp, fSumDown;

	DWORD dwBarIdx = m_pModule->BarIndex();

	if (m_pModule->BarIndex() > m_wPeriods) {
		
		fSumUp = fSumDown = 0.0f;
		for (WORD i = 0; i < m_wPeriods; ++i) {
			fSumUp += max(0.0f, Close(i) - Close(i+1));
			fSumDown += -(min(0.0f, Close(i) - Close(i+1)));
		}
		fSumUp = fSumUp / m_wPeriods;
		fSumDown = fSumDown / m_wPeriods;
		if(fSumUp + fSumDown == 0) {
			fRSI = 0;
		}
		else {
			fRSI = (fSumUp / (fSumUp + fSumDown) * 100);
		}

		m_Series[dwBarIdx] = fRSI;
	}
}


Post Reply