mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-19 11:08:05 +00:00
Tests and QT cleanup
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user