Tests and QT cleanup

This commit is contained in:
Miha Kralj
2022-12-21 12:31:29 -08:00
parent 9ad467cd5a
commit 5844547a79
31 changed files with 188 additions and 243 deletions
+5 -7
View File
@@ -1,4 +1,5 @@
using System.Drawing;
using System.Linq;
using TradingPlatform.BusinessLayer;
namespace QuanTAlib;
@@ -32,21 +33,18 @@ public class JMA_chart : Indicator
protected override void OnInit()
{
this.ShortName =
"JMA (" + TBars.SelectStr(this.DataSource) + ", " + this.Period + ")";
this.bars = new();
this.indicator = new(source: bars.Select(this.DataSource),
period: this.Period, useNaN: false);
this.indicator = new(source: bars.Select(this.DataSource), period: this.Period, useNaN: false);
}
protected override void OnUpdate(UpdateArgs args)
{
bool update = !(args.Reason == UpdateReason.NewBar ||
args.Reason == UpdateReason.HistoricalBar);
bool update = !(args.Reason == UpdateReason.NewBar || args.Reason == UpdateReason.HistoricalBar);
this.bars.Add(this.Time(), this.GetPrice(PriceType.Open),
this.GetPrice(PriceType.High), this.GetPrice(PriceType.Low),
this.GetPrice(PriceType.Close),
this.GetPrice(PriceType.Volume), update);
double result = this.indicator[this.indicator.Count - 1].v;
double result = this.indicator.v.Last();
this.SetValue(result);
}
}