private CCICore(BarItemType barItemType, int barCount, TPMACore tpmaCore, IndicatorDelegates.CalculationCompletedHandler onCalculationCompleted = null) : base(DISPLAY_NAME, SHORT_NAME, DESCRIPTION, barItemType) { this.barCount = barCount; this.maxBarIndex = barCount - 1; this.tpmaCore = tpmaCore; this.identityCode = CreateIdentityCode(barCount); if (onCalculationCompleted != null) { this.Calculated += onCalculationCompleted; } }
public void BuildCore(ISessionIndicator sessionIndicator) { string coreIdentityCode = CCICore.CreateIdentityCode(periods); core = sessionIndicator.CoreIndicators.ContainsKey(coreIdentityCode) ? sessionIndicator.CoreIndicators[coreIdentityCode].IndicatorInstance as CCICore : null; if (core == null) { string tpmaIdentityCode = TPMACore.CreateIdentityCode(periods); TPMACore tpmaCore = sessionIndicator.CoreIndicators.ContainsKey(tpmaIdentityCode) ? sessionIndicator.CoreIndicators[tpmaIdentityCode].IndicatorInstance as TPMACore : null; if (tpmaCore == null) { tpmaCore = TPMACore.CreateInstance(barType, periods); sessionIndicator.CoreIndicators.Add(tpmaCore.IdentityCode, new CoreIndicator(tpmaCore)); } core = CCICore.CreateInstance(barType, periods, tpmaCore, this.OnCalculationCompleted); sessionIndicator.CoreIndicators.Add(core.IdentityCode, new CoreIndicator(core)); } }
public static CCICore CreateInstance(BarItemType barItemType, int barCount, TPMACore tpmaCore, IndicatorDelegates.CalculationCompletedHandler onCalculationCompleted = null) { return(new CCICore(barItemType, barCount, tpmaCore, onCalculationCompleted)); }