AM
Topics
19 Jan 2021, 21:42
1228
2
Replies
amirrezaik
03 May 2021, 09:31
( Updated at: 03 May 2021, 09:32 )
RE:
Hi,
How much you charging to do this for RSI?
Thanks,
Amir
@amirrezaik
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