Fisher RSI free

by qualitiedx2 in category Trend at 17/02/2012
Description

This is the "fisherized" RSI.

FisherRSI

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader

using System;
using cAlgo.API;
using cAlgo.API.Indicators;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, AccessRights = AccessRights.None)]
    public class StochasticRSI2 : Indicator
    {
    	
    	[Parameter]
        public DataSeries DataSource { get; set; }
        
        [Output("FisherRSI",Color = Colors.Red)]
        public IndicatorDataSeries fisherRSI { get; set; }
		
		[Output("Trigger",Color = Colors.Blue)]
        public IndicatorDataSeries trigger { get; set; }
		
		[Parameter(DefaultValue = 14, MinValue = 2)]
        public int Period { get; set; }
		
		private RelativeStrengthIndex rsi;
		private IndicatorDataSeries value1;
		
		protected override void Initialize()
        {
            rsi = Indicators.RelativeStrengthIndex(DataSource,Period);
            value1 = CreateDataSeries();
        }
		
        public override void Calculate(int index)
        {
        	double rsiL = rsi.Result[index];
        	double rsiH = rsi.Result[index];
        	for (int i = index - Period + 1; i <= index; i++)
        	{
        		if(rsiH<rsi.Result[i]){rsiH=rsi.Result[i];}
        		if(rsiL>rsi.Result[i]){rsiL=rsi.Result[i];}
        	}
        	if (rsiH != rsiL)
        	{
        		value1[index] = ((rsi.Result[index] - rsiL) / (rsiH - rsiL));
        	}
        	fisherRSI[index] = (4*value1[index] + 3*value1[index-1]+2*value1[index-2] + value1[index-3])/10;
        	fisherRSI[index] = (0.5*Math.Log((1+1.98*(fisherRSI[index]-0.5))/(1-1.98*(fisherRSI[index]-0.5))));
        	
        	trigger[index] = fisherRSI[index-1];
        }
    }
}
Comments

rickywong19922005@gmail.com - April 26, 2019 @ 12:58

Very useful

5