Ejemplo n.º 1
0
        //提取量化因子对象
        public virtual QuantifyIndex Get_Index(typeIndex typeIndex)
        {
            QuantifyIndex pIndex = null;

            if (!_QuantifyIndexs.TryGetValue(typeIndex, out pIndex))
            {
                return(null);
            }
            return(pIndex);
        }
Ejemplo n.º 2
0
        /// <summary>初始指标对象
        /// </summary>
        /// <param name="typeIndex"></param>
        /// <param name="n">指标时间步长</param>
        /// <returns></returns>
        public virtual bool Init_Index(typeIndex typeIndex, int n = 14)
        {
            if (_DataCache == null)
            {
                return(false);
            }
            QuantifyIndex pIndex = this.Get_Index(typeIndex);

            //初始指标对象
            if (pIndex == null)
            {
                pIndex = (QuantifyIndex)zxcReflectionHelper.CreateObj <Data_Quote>((Type)typeIndex.Get_AttrValue(), new object[] { _DataCache.DataCaches, n, _DataCache.DataCache_Set.Time_Frequency });
                pIndex.DataAnalyse_Trend_Trigger += new DataAnalyse_Trend_EventHandler(DataAnalyse_QuantifyIndex_EventHandler);

                //分析全部
                pIndex.Calculate_All(true);
                _QuantifyIndexs[typeIndex] = pIndex;
            }
            return(true);
        }