public override void GetAll(IIndicatorValues Ind) { int period = (int)this.IndicatorParameters.List[0]; int smoothingPeriod = (int)this.IndicatorParameters.List[1]; decimal thresholdPercentage = (decimal)this.IndicatorParameters.List[2]; if (!Ind.PFE(period, smoothingPeriod, thresholdPercentage).IsPopulated) { int oldCurrentBar = Ind.Bar.CurrentBar; for (int i = 1; i <= Ind.Bar.MaxBar; i++) { Ind.Bar.CurrentBar = i; object prototype = null; if (i == 1) { prototype = new PFE(thresholdPercentage); } else { prototype = (PFE)Ind.PFE(period, smoothingPeriod, thresholdPercentage)[1].Clone(); } Get(ref prototype, Ind); Ind.PFE(period, smoothingPeriod, thresholdPercentage)[0] = (PFE)prototype; Ind.PFE(period, smoothingPeriod, thresholdPercentage).IsPopulated = true; // set here so instance is guaranteed to exits } Ind.Bar.CurrentBar = oldCurrentBar; } }
protected override string GetPresentDetail(IOutputInstant Instant, IIndicatorValues Data, IndicatorParameters IndicatorParameters) { PFE pfe = Data.PFE(IndicatorParameters)[Instant.ExposureDate]; if (pfe != null) { return(String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|", pfe.Value, (int)pfe.Trendiness, pfe.Trendiness, (int)pfe.Direction, pfe.Direction, (int)pfe.Oscillation, pfe.Oscillation)); } else { return(String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|", "", "", "", "", "", "", "")); } }
public Genesis(int n) : base(n) { T3 = new AdaptiveSmoothing(n); T32 = new AdaptiveSmoothing(5 * n); CCI = new CCI(n); WILLR = new WilliamsR(n); Gann = new GannHiLo(n); KST = new KST(); CH = new Chaikin(); BB = new BollingerBands(); QChannel = new QSPolyChannel(); FI = new ForceIndex(30); PFE = new PFE(150); RWI = new RWI(30); AC = new AC(10); }