Esempio n. 1
0
        public static ShiftedMA Series(DataSeries ds, int period, int shift, ChoiceOfMA option)
        {
            string description = string.Concat(new object[] { "ShiftedMA(", ds.Description, ",", period, ",", shift, ",", option, ")" });

            if (ds.Cache.ContainsKey(description))
            {
                return((ShiftedMA)ds.Cache[description]);
            }

            ShiftedMA _ShiftedMA = new ShiftedMA(ds, period, shift, option, description);

            ds.Cache[description] = _ShiftedMA;
            return(_ShiftedMA);
        }
Esempio n. 2
0
        public AlligatorLips(DataSeries ds, int period, int delay, string description)
            : base(ds, description)
        {
            base.FirstValidValue = period + delay;

            if (FirstValidValue > ds.Count || FirstValidValue < 0)
            {
                FirstValidValue = ds.Count;
            }
            if (ds.Count < (period + delay))
            {
                return;
            }

            for (int bar = FirstValidValue; bar < ds.Count; bar++)
            {
                base[bar] = ShiftedMA.Series(ds, period, delay, ChoiceOfMA.SMMA)[bar];
            }
        }