public void SetParameters(EnumBarStruct objBarStruct, int length) { if (objBarStruct != barStruct || length != _length) { string paramTag = string.Format("({0},{1})", objBarStruct.ToString(), length); Name = string.Format("MA{0}", paramTag); if (!IsSimpleMode) { graphDict["MA"].Tag = paramTag; } barStruct = objBarStruct; _length = length; Caculate(); } }
public MA(List <BarData> barDatas, EnumBarStruct objBarStruct = EnumBarStruct.Close, int length = 10, bool isSimpleMode = true, bool isShowInMain = true, string tag = "1") : base(barDatas) { Tag = tag; _length = length; barStruct = objBarStruct; IsSimpleMode = isSimpleMode; string paramTag = string.Format("({0},{1})", barStruct.ToString(), _length); Name = string.Format("MA{0}", paramTag); Description = "移动平均"; valueDict.Add("MA", new List <double>()); if (!IsSimpleMode) { graphDict.Add("MA", new IndicatorGraph() { Name = "MA", Tag = paramTag, LineStyle = EnumLineStyle.SolidLine }); } averageS = new AverageS(); IsShowInMain = isShowInMain; Caculate(); }