MACD_RSI free

by gorin in category Oscilator at 31/10/2013
Description

This indicator is a combination of the MACD Crossover and the Relative Strength Index.
The MACD is scaled up so that the two indicators overlap.

100621 downloads
How to install
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
// -------------------------------------------------------------------------------
//
//    This is a Template used as a guideline to build your own Indicator. 
//
// -------------------------------------------------------------------------------

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

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, ScalePrecision = 5, AccessRights = AccessRights.None)]
    public class MACD_RSI : Indicator
    {
        private MacdCrossOver macdCrossOver;
        private RelativeStrengthIndex rsi;


        [Parameter()]
        public DataSeries source { get; set; }

        [Parameter(DefaultValue = 9)]
        public int Periods { get; set; }

        [Parameter(DefaultValue = 12)]
        public int shortCycle { get; set; }

        [Parameter(DefaultValue = 26)]
        public int longCycle { get; set; }


        [Output("MACD", Color = Colors.Blue)]
        public IndicatorDataSeries MACD { get; set; }

        [Output("MACD_Signal", Color = Colors.Red)]
        public IndicatorDataSeries MACD_Signal { get; set; }

        [Output("MACD_Histogram", PlotType = PlotType.Histogram, Color = Colors.LightSkyBlue)]
        public IndicatorDataSeries MACD_Histogram { get; set; }

        [Output("RSI")]
        public IndicatorDataSeries RSI { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
            macdCrossOver = Indicators.MacdCrossOver(source, longCycle, shortCycle, Periods);
            rsi = Indicators.RelativeStrengthIndex(source, Periods);
        }


        public override void Calculate(int index)
        {
            const int factor = 100000;
            MACD[index] = macdCrossOver.MACD[index] * factor;
            MACD_Histogram[index] = macdCrossOver.Histogram[index] * factor;
            MACD_Signal[index] = macdCrossOver.Signal[index] * factor;
            RSI[index] = rsi.Result[index];
        }
    }
}
Comments

Scarlett - April 13, 2018 @ 06:34

Hi, Just wondering why the RSI line is flat or on Level 0 only, no actual movement. I am using cTrader.

gustavojguerrero@gmail.com - April 16, 2019 @ 17:43

Ramiro would you give more information about your experience with the bot please

Steve.ja.marriott - May 07, 2019 @ 22:38

Same for me. The MacD part works fine, but the green RSI line is flat, no up or down movement.

bave.rowe - July 08, 2019 @ 03:23

can i anyone help to currect the issue with the green line ? 

architectural.site - December 10, 2020 @ 01:10

わたしも、RSI緑ラインが、フラットのまま!

reyx - January 24, 2021 @ 17:08

The line is flato on JPY pairs because of different conversion factor. Just change line 48 to be:
 

```int factor = SymbolName.Contains("JPY") ? 1000 : 100000;```

tvrdjan - March 26, 2021 @ 12:44

would anyone be so wonderful. to explain to me how to use this indicator strategy?

2.5