RSI Alert

dbmakepeace since: 06 Jun 2018;

  23 Sep 2019, 19:31
RSI Alert

Hi,

I know this might seem straight forward but I'm changing from MT4 to Ctrader.

Do you know of an indicator that acts as an RSI alert?

Thanks

PanagiotisCharalampous's avatar

PanagiotisCharalampous since: 13 Jan 2017;

  24 Sep 2019, 08:20

Hi dbmakepeace,

Thanks for posting in our forum. I am not aware if any community member has already done this but it should not be difficult to be coded into an indicator/cbot.

Best Regards,

Panagiotis

Head of Community Management at cTrader

MarkDawson since: 17 Oct 2019;

  23 Oct 2019, 20:49
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class RSI_Sound : Indicator
    {

        private RelativeStrengthIndex rsi;


        [Parameter("Sound ON", DefaultValue = 0, MaxValue = 1, MinValue = 0)]
        public bool PlaySound { get; set; }
 
        [Parameter("Media File", DefaultValue = "C:\\alarm.mp3")]
        public string MediaFile { get; set; }

        
        [Parameter("Source", Group = "RSI")]
        public DataSeries Source { get; set; }
  
        protected override void Initialize()
        {
            rsi = Indicators.RelativeStrengthIndex(Source, 14);
        }

        public override void Calculate(int index)
        {

            {
            if (rsi.Result.hasCrossedAbove(30);
            Notifications.PlaySound(MediaFile);
            
            else if (rsi.Result.hasCrossedAbove(50)
            Notifications.PlaySound(MediaFile);
                        
            else if (rsi.Result.hasCrossedBelow(50)
            Notifications.PlaySound(MediaFile);
                        
            else if (rsi.Result.hasCrossedBelow(70)
            Notifications.PlaySound(MediaFile);
            }
            
        }
 
    }
}

I'm looking for an RSI alert as well, but can't find one. I resorted to try and code myself but my lack of experience is showing here.

I don't think I'm using the hasCrossed function correctly. I just want an alert to beep whenever the rsi crossed the 30, 50, 70 mark.

ClickAlgo's avatar

ClickAlgo since: 05 Feb 2015;

  23 Oct 2019, 21:03

Hi, Mark,

This is an advanced version of a DiNapoli Stochastic RSI with sound and email alerts, not sure if it is what you are looking for.

https://clickalgo.com/ctrader-dinapoli-stochastic-linear-curve-fitting

Also, here is an automated strategy with built-in alerts.

https://clickalgo.com/ctrader-classic-relative-strength-index-rsi-strategy

Paul Hayes
Sales & Marketing
Emailcontact@clickalgo.com
Phone: (44) 203 289 6573
Websitehttps://clickalgo.com

Twitter | Facebook | YouTube | Pinterest | LinkedIn

PS: Why not join our instant chat group on Telegram or visit our YouTube Channel

~ Contact us for all your cBot & Indicator development ~

MarkDawson since: 17 Oct 2019;

  24 Oct 2019, 09:03

Thanks Paul, but not exactly what I had in mind. Just looking for a simple one that will beep when rsi crossed/touch the 30,50,70 line

ClickAlgo's avatar

ClickAlgo since: 05 Feb 2015;

  24 Oct 2019, 09:17

Hi, Mark,

You were missing the closing parenthesis in the condition statements.

        public override void Calculate(int index)
        {
            if (rsi.Result.hasCrossedAbove(30))
                Notifications.PlaySound(MediaFile);

            else if (rsi.Result.hasCrossedAbove(50))
                Notifications.PlaySound(MediaFile);

            else if (rsi.Result.hasCrossedBelow(50))
                Notifications.PlaySound(MediaFile);

            else if (rsi.Result.hasCrossedBelow(70))
                Notifications.PlaySound(MediaFile);
        }

This may also help you in the future.

https://clickalgo.com/cTrader-algorithmic-trading-school-for-beginners

~ Contact us for all your cBot & Indicator development ~

simonaggioriccardo since: 29 Jan 2021;

  03 May 2021, 12:45
RSI ALARM

Ciao, potete gentilmente aiutarmi fornendomi il codice completo per ricevere l'RSI con integrato un allert?

amirrezaik since: 19 Jan 2021;

  04 May 2021, 10:40
RE:

Hi,

Try this one

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
namespace cAlgo
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class RSIAmir : Indicator
    {

        private RelativeStrengthIndex rsi;


        [Parameter("Sound ON", DefaultValue = 0, MaxValue = 1, MinValue = 0)]
        public bool PlaySound { get; set; }

        [Parameter("Media File", DefaultValue = "C:\\Best.mp3")]
        public string MediaFile { get; set; }


        [Parameter("Source", Group = "RSI")]
        public DataSeries Source { get; set; }

        protected override void Initialize()
        {
            rsi = Indicators.RelativeStrengthIndex(Source, 14);
        }

        public override void Calculate(int index)
        {

            {
                if (rsi.Result.LastValue < 30)
                    Notifications.PlaySound(MediaFile);

                else if (rsi.Result.LastValue > 50)
                    Notifications.PlaySound(MediaFile);

                else if (rsi.Result.LastValue < 50)
                    Notifications.PlaySound(MediaFile);


                else if (rsi.Result.LastValue > 70)
                    Notifications.PlaySound(MediaFile);
            }

        }

    }
}

simonaggioriccardo since: 29 Jan 2021;

  04 May 2021, 11:41
Thanks

the indicator is perfect ..