RSI Alert
RSI Alert
23 Sep 2019, 19:31
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
Replies
MarkDawson
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.
@MarkDawson
ClickAlgo
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
Email: contact@clickalgo.com
Phone: (44) 203 289 6573
Website: https://clickalgo.com
Twitter | Facebook | YouTube | Pinterest | LinkedIn
PS: Why not join our instant chat group on Telegram or visit our YouTube Channel
@ClickAlgo
MarkDawson
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
@MarkDawson
ClickAlgo
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
@ClickAlgo
simonaggioriccardo
03 May 2021, 12:45
RSI ALARM
Ciao, potete gentilmente aiutarmi fornendomi il codice completo per ricevere l'RSI con integrato un allert?
@simonaggioriccardo
amirrezaik
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);
}
}
}
}
@amirrezaik
PanagiotisCharalampous
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
@PanagiotisCharalampous