Beispiel #1
0
        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;
            }
        }
Beispiel #2
0
        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));
            }
        }
Beispiel #3
0
 public static CCICore CreateInstance(BarItemType barItemType, int barCount, TPMACore tpmaCore, IndicatorDelegates.CalculationCompletedHandler onCalculationCompleted = null)
 {
     return(new CCICore(barItemType, barCount, tpmaCore, onCalculationCompleted));
 }