public override void GetAll(IIndicatorValues Ind) { int period = (int)this.IndicatorParameters.List[0]; if (!Ind.MamaFama(period).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 MamaFama(); } else { prototype = (MamaFama)Ind.MamaFama(period)[1].Clone(); } Get(ref prototype, Ind); Ind.MamaFama(period)[0] = (MamaFama)prototype; Ind.MamaFama(period).IsPopulated = true; // set here so instance is guaranteed to exits } Ind.Bar.CurrentBar = oldCurrentBar; } }
protected override string GetPresentDetail(IOutputInstant Instant, IIndicatorValues Data, IndicatorParameters IndicatorParameters) { MamaFama mama = Data.MamaFama(IndicatorParameters)[Instant.ExposureDate]; if (mama != null) { return(String.Format("{0}|{1}|{2}|{3}|{4}|", mama.MAMA, mama.FAMA, mama.Alpha, (int)mama.Direction, mama.Direction)); } else { return(String.Format("{0}|{1}|{2}|{3}|{4}|", "", "", "", "", "")); } }