refresh with new QT DLL

This commit is contained in:
Miha Kralj
2024-10-12 20:36:37 -07:00
parent cc45cebeb4
commit b3b3b24a25
65 changed files with 2593 additions and 1189 deletions
+27 -12
View File
@@ -1,26 +1,41 @@
using System.Drawing;
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
public class RviIndicator : IndicatorBase
public class RviIndicator : Indicator, IWatchlistIndicator
{
[InputParameter("Period", sortIndex: 1, 2, 100, 1, 0)]
public int Period { get; set; } = 10;
[InputParameter("Periods", sortIndex: 1, 2, 100, 1, 0)]
public int Periods { get; set; } = 10;
private Rvi? rvi;
protected override AbstractBase QuanTAlib => rvi!;
public override string ShortName => $"RVI {Period} : {SourceName}";
protected LineSeries? RviSeries;
public int MinHistoryDepths => Periods;
int IWatchlistIndicator.MinHistoryDepths => MinHistoryDepths;
public RviIndicator() : base()
public RviIndicator()
{
Name = "RVI - Relative Volatility Index";
Description = "Measures the direction of volatility, helping to identify overbought or oversold conditions in price.";
SeparateWindow = true;
}
protected override void InitIndicator()
{
rvi = new Rvi(Period);
MinHistoryDepths = rvi.WarmupPeriod;
base.InitIndicator();
RviSeries = new("RVI", Color.Blue, 2, LineStyle.Solid);
AddLineSeries(RviSeries);
}
protected override void OnInit()
{
rvi = new Rvi(Periods);
base.OnInit();
}
protected override void OnUpdate(UpdateArgs args)
{
TBar input = IndicatorExtensions.GetInputBar(this, args);
TValue result = rvi!.Calc(input);
RviSeries!.SetValue(result.Value);
}
public override string ShortName => $"RVI ({Periods})";
}