예제 #1
0
        protected override void OnStartUp()
        {
            var period = 2 * strength + 1;

            mx = MAX(High, period);
            mn = MIN(Low, period);
        }
예제 #2
0
 protected override void OnStartUp()
 {
     DYNRSI    = RSI(Input, RSIPeriod, 1);
     DYNPrice  = SMA(DYNRSI, PricePeriod);
     DYNSignal = SMA(DYNRSI, SignalPeriod);
     // added the following Aug 19 2014 zondor
     emaEMAhls = EMA(EMA(hls, EMAPeriod1), EMAPeriod2);
     emaEMAsms = (EMA(EMA(sms, EMAPeriod1), EMAPeriod2));
     emaSMI    = EMA(smis, SMIEMAPeriod);
     MaxHI     = MAX(High, range);
     MinLO     = MIN(Low, range);
 }
예제 #3
0
        /// <summary>
        /// The Minimum shows the minimum of the last n bars.
        /// </summary>
        /// <returns></returns>
        public MIN MIN(IDataSeries input, int period)
        {
            if (cacheMIN != null)
            {
                for (int idx = 0; idx < cacheMIN.Length; idx++)
                {
                    if (cacheMIN[idx].Period == period && cacheMIN[idx].EqualsInput(input))
                    {
                        return(cacheMIN[idx]);
                    }
                }
            }

            lock (checkMIN)
            {
                checkMIN.Period = period;
                period          = checkMIN.Period;

                if (cacheMIN != null)
                {
                    for (int idx = 0; idx < cacheMIN.Length; idx++)
                    {
                        if (cacheMIN[idx].Period == period && cacheMIN[idx].EqualsInput(input))
                        {
                            return(cacheMIN[idx]);
                        }
                    }
                }

                MIN indicator = new MIN();
                indicator.BarsRequired        = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack         = MaximumBarsLookBack;
#endif
                indicator.Input  = input;
                indicator.Period = period;
                Indicators.Add(indicator);
                indicator.SetUp();

                MIN[] tmp = new MIN[cacheMIN == null ? 1 : cacheMIN.Length + 1];
                if (cacheMIN != null)
                {
                    cacheMIN.CopyTo(tmp, 0);
                }
                tmp[tmp.Length - 1] = indicator;
                cacheMIN            = tmp;
                return(indicator);
            }
        }
예제 #4
0
        /// <summary>
        /// The Minimum shows the minimum of the last n bars.
        /// </summary>
        /// <returns></returns>
        public MIN MIN(Data.IDataSeries input, int period)
        {
            if (cacheMIN != null)
                for (int idx = 0; idx < cacheMIN.Length; idx++)
                    if (cacheMIN[idx].Period == period && cacheMIN[idx].EqualsInput(input))
                        return cacheMIN[idx];

            lock (checkMIN)
            {
                checkMIN.Period = period;
                period = checkMIN.Period;

                if (cacheMIN != null)
                    for (int idx = 0; idx < cacheMIN.Length; idx++)
                        if (cacheMIN[idx].Period == period && cacheMIN[idx].EqualsInput(input))
                            return cacheMIN[idx];

                MIN indicator = new MIN();
                indicator.BarsRequired = BarsRequired;
                indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
                indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
                indicator.Input = input;
                indicator.Period = period;
                Indicators.Add(indicator);
                indicator.SetUp();

                MIN[] tmp = new MIN[cacheMIN == null ? 1 : cacheMIN.Length + 1];
                if (cacheMIN != null)
                    cacheMIN.CopyTo(tmp, 0);
                tmp[tmp.Length - 1] = indicator;
                cacheMIN = tmp;
                return indicator;
            }
        }