RSI with MomentumOscillator

11 Jan 2018, 22:16RSI with MomentumOscillator#1
oneplusocposts: 30since: 09 Mar 2015

Hello 

colud you pleas help me to show rsi with momentum in one windows like pic attached

thanks 

12 Jan 2018, 08:39#2
amsmanposts: 20since: 22 Nov 2016

Normally you can open the RSI Indicator, then open the Momentum Osc., select the Source, change it from close to the RSI and both indicators will appear as above.

They are both "Bound" Indicators (both oscillate between fixed values) so I don't think its possible with these two...but I could be wrong...

12 Jan 2018, 08:48RE:#3
oneplusocposts: 30since: 09 Mar 2015

amsman said:

Normally you can open the RSI Indicator, then open the Momentum Osc., select the Source, change it from close to the RSI and both indicators will appear as above.

They are both "Bound" Indicators (both oscillate between fixed values) so I don't think its possible with these two...but I could be wrong...

THANKS 

but this way not working with 2 indicators 

thanks 

12 Jan 2018, 11:59#4
Panagiotis Charalampousposts: 1099since: 13 Jan 2017

Hi oneplusoc,

The solution is to create a custom indicator that combines the two indicators together. See a relevant discussion here.

Best Regards,

Panagiotis


Head of Community Management at cTrader
12 Jan 2018, 12:27RE:#5
oneplusocposts: 30since: 09 Mar 2015

Panagiotis Charalampous said:

Hi oneplusoc,

The solution is to create a custom indicator that combines the two indicators together. See a relevant discussion here.

Best Regards,

Panagiotis

Thanks i will try and back to you 

12 Jan 2018, 15:13#6
oneplusocposts: 30since: 09 Mar 2015

Hello Sir .

colud you pleas check whtat is this Error CS0102: The type 'cAlgo.NewIndicator' already contains a definition for 'Result'

thanks 

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

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

        [Output("Momentum", Color = Colors.Green)]
        public IndicatorDataSeries Result { get; set; }

        private RelativeStrengthIndex _rsi;
        private MomentumOscillator _momentum;

        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Closse, 14);
            _momentum = Indicators.MomentumOscillator(MarketSeries.Close, 14);
        }

        public override void Calculate(int index)
        {
            Result[index] = _rsi.Result[index];

            Result[index] = _momentum.Result[index];
        }
    }
}

12 Jan 2018, 16:44#7
Panagiotis Charalampousposts: 1099since: 13 Jan 2017

Dear oneplusoc,

See a corrected version below

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

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

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

        private RelativeStrengthIndex _rsi;
        private MomentumOscillator _momentum;

        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
            _momentum = Indicators.MomentumOscillator(MarketSeries.Close, 14);
        }

        public override void Calculate(int index)
        {
            RSI[index] = _rsi.Result[index];

            Momentum[index] = _momentum.Result[index];
        }
    }
}

Best Regards,

Panagiotis


Head of Community Management at cTrader
12 Jan 2018, 17:02RE:#8
oneplusocposts: 30since: 09 Mar 2015

Panagiotis Charalampous said:

Dear oneplusoc,

See a corrected version below

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

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class NewIndicator : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

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

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

        private RelativeStrengthIndex _rsi;
        private MomentumOscillator _momentum;

        protected override void Initialize()
        {
            _rsi = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
            _momentum = Indicators.MomentumOscillator(MarketSeries.Close, 14);
        }

        public override void Calculate(int index)
        {
            RSI[index] = _rsi.Result[index];

            Momentum[index] = _momentum.Result[index];
        }
    }
}

Best Regards,

Panagiotis

 

Thank you for the update now working but have problem with momentum line not smooth as you can see attached pic  

thanks 

 

12 Jan 2018, 17:16#9
Panagiotis Charalampousposts: 1099since: 13 Jan 2017

Hi oneplusoc,

This happens because of the scale of the chart. If you want to combine the two indicators, you will have this problem. Momentum oscillator usually oscillates around 100.

Best Regards,

Panagiotis


Head of Community Management at cTrader
12 Jan 2018, 17:24RE:#10
oneplusocposts: 30since: 09 Mar 2015

Panagiotis Charalampous said:

Hi oneplusoc,

This happens because of the scale of the chart. If you want to combine the two indicators, you will have this problem. Momentum oscillator usually oscillates around 100.

Best Regards,

Panagiotis

Noted  Appreciation